Friday, December 7, 2012

Apache add virtual host on a new port

1. Create a site

$> cp /etc/apache2/sites-available/default /etc/apache2/sites-available/newsite

edit /etc/apache2/sites-available/newsite:

<VirtualHost *:8082>
        ServerAdmin ops@example.com

        DocumentRoot /home/yourname/www
...

2. Enable a site


$> ln -s /etc/apache2/sites-available/newsite /etc/apache2/site-enabled/newsite
or
$> sudo a2ensite newsite


3. Listen to the port

edit /etc/apache2/ports.conf

Listen 80
Listen 8082
NameVirtualHost *:80
NameVirtualHost *:8082

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.