LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2015, 06:35 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
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.

1. 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;
}
}

2. edit wordpress configuration.
vim /var/www/html/wp/wp-config.php
# to add tow lines at the end of the file.
define('WP_SITEURL','http://localhost:8080/wp/');
define('WP_HOME','http://localhost:8080/wp/');

3.change the mysql
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 ?
 
Old 09-06-2015, 12:12 AM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Restart Apache2 (happy now?)
#1 telnet localhost 8080 Pass or fail?
If fail: Do you have a firewall enabled? SELINUX enabled?

#2 If telnet connects, then http://codex.wordpress.org/Changing_The_Site_URL

8080 is kind of a bad port to use. Other applications use it.

Last edited by mpapet; 09-06-2015 at 07:01 PM.
 
Old 09-06-2015, 02:46 AM   #3
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
The web server is nginx or apache2!
 
Old 09-06-2015, 05:21 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
you tell us.

if you installed a LAMP stack, that implies apache.

however, you are posting code snippets for nginx configuration?
 
Old 09-07-2015, 08:38 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Required reading: http://codex.wordpress.org/Hardening_WordPress
 
Old 09-20-2015, 09:30 PM   #6
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
Why wordpress can work only on nginx but not apache2 ?

it is a another problem , i make a new post.

Last edited by luofeiyu; 09-20-2015 at 09:42 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Wordpress redirecting connections on port 8080 to 80 slipstreamed Linux - Server 1 02-20-2014 01:26 PM
Tomcat6 stops listening on port 80 when i change from port 8080 to port 80 trongthect Linux - Server 1 07-27-2012 05:41 PM
[SOLVED] Tomcat6 stops listening when i change from port 8080 Droa Linux - Server 7 07-26-2012 03:56 PM
change IMAP port from 143 to 8080 irishbitte Linux - Desktop 5 11-25-2009 04:36 PM
How do you change port 8080 to port 80? bt101 Linux - Networking 10 03-18-2009 03:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration