Moving from standard Apache httpd install to virtual hosts

1. 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 “<html>
<title>intranet test index</title>
” > index.htm

2. 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

    ServerAdmin [email protected]
    DocumentRoot /home/intranet/www
    ServerAlias intranet
    LogLevel info
    ErrorLog /home/intranet/logs/error.log
    CustomLog /home/intranet/logs/access.log combined

3. Reboot Apache Httpd

$ apachectl graceful