- First you need to create an appropiate directory for virtual host. (Using the example of creating an intranet)
$ su –
$ useradd intranet
$ chmod 755 /home/intranet # needed for apache nobody process
$ cd /home/intranet
$ mkdir www logs
$ cd www
$ echo “
- Second, you need to reconfig Apache Httpd for virtual host management.
$ cd /opt/httpd/conf
echo “Include conf/httpd.include” » httpd.conf
$ vi httpd.include
NameVirtualHost 111.111.111.111 <VirtualHost 111.111.111.111> ServerAdmin webmaster@site.com.au DocumentRoot /home/intranet/www ServerName intranet.site.com.au ServerAlias intranet LogLevel info ErrorLog /home/intranet/logs/error.log CustomLog /home/intranet/logs/access.log combined </VirtualHost>
- Reboot Apache Httpd
$ apachectl graceful