By elearn
I have installed LEMP +wordpress on my 127.0.0.1/wp. Now i want to make 80 into 8080,let 127.0.0.1:8080/wp can be visited.
server {
listen 8080;
server_name 127.0.0.1;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
vim /var/www/html/wp/wp-config.php
Add the following lines at the end of the file:
define('WP_SITEURL','http://localhost:8080/wp/');
define('WP_HOME','http://localhost:8080/wp/');
3.Access mysql and run the following queries:
update wp_options set option_value='http://localhost:8080' where option_name='siteurl';
update wp_options set option_value='http://localhost:8080' where option_name='home';
Why htpp://127.0.0.1:8080/wp can get nothing ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
No firewall ,nothing.
I met a big trouble!I try to set nginx configuration to test and test, install and uninstall many times. My os messed up.
root@pengsir:/home/debian8# dpkg -l nginx
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii nginx 1.6.2-5 all small, powerful, scalable web/pro
root@pengsir:/home/debian8# service nginx start
root@pengsir:/home/debian8# service nginx status
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Sun 2015-09-06 21:32:33 HKT; 1min 17s ago
Process: 15457 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 15455 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 15458 (nginx)
CGroup: /system.slice/nginx.service
├─15458 nginx: master process /usr/sbin/nginx -g daemon on; master...
├─15459 nginx: worker process
├─15460 nginx: worker process
├─15461 nginx: worker process
└─15462 nginx: worker process
It seems like that nginx is in good status, but an error occurs when to input 127.0.0.1:8080
Unable to connect
Iceweasel can't establish a connection to the server at 127.0.0.1:8080.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Iceweasel is permitted to access the Web.
@Martijns Indeed did you restart nginx? Also a simple one; are you running any firewall / did you portforward the port?
Perhaps a stupid question, but you did restart Nginx after you’ve made the changes? Is the main nginx.conf also listening at 8080?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.