Wednesday, October 10, 2012

Changing Apache port number

I've changed apache default port 80 to 8000.

1. Resources

Creating a web server to host Ruby on Rails and PHP using Phusion Passenger, Nginx, and Apache


2. Back up original port config file

$ cd /etc/apache2
$ sudo cp ports.conf ports.conf.bak.original


3. Change the port

$ sudo gedit ports.conf

From:

NameVirtualHost *:80
Listen 80

To:

NameVirtualHost *:8000
Listen 8000


4. Change the virtual host

$ cd /etc/apache2/sites-enabled
$ sudo gedit 000-default

From

<VirtualHost *:80>
...
</virtualhost>

To

<VirtualHost *:8000>
...
</virtualhost>


5. Restart the Apache

$ sudo /etc/init.d/apache2 restart


6. Test

http://localhost:8000













http://localhost:8000/phpinfo.php

No comments:

Post a Comment