Adding a new IP to apache2 web server

I have just had a second IP for my web server and wish to use it for a dedicated domain name.

Here is how you configure apache2 to serve requests on that IP to a specific virtualhost

assumptions:
new IP is 192.168.1.2
new website is called newip.labby.co.uk

<VirtualHost 192.168.1.2>
UseCanonicalName Off
ServerName newip.labby.co.uk
ServerAlias *.newip.labby.co.uk
ServerAlias *
DocumentRoot /var/www/newip.labby.co.uk
ErrorLog /var/log/apache2/error-newip.labby.co.uk.log
LogLevel warn
CustomLog /var/log/apache2/access-newip.labby.co.uk.log
<Directory /var/www/newip.labby.co.uk>
Allow From All
Options +Indexes +FollowSymLinks
</Directory>
</virtualhost>

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge