Question
How to change port 80 into 8080 on my wordpress?
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.
- edit nginx configuration
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;
}
}
- edit wordpress configuration.
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 ?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
What to do if I am using Apache and not nginx?