Expertise level: Easy
To add a VirtualHost entry, follow this procedure:
- Login to your server as root in an ssh session.
- Make a copy of the current httpd.conf file (the path of the file may be different).
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
- Open the file /etc/httpd/conf/httpd.conf using your favourite text editor.
- Navigate to the end of the file and add the VirtualHost entry in the following format:
ScriptAlias /cgi-bin /home/user/public_html/cgi-bin
suPHP_UserGroup user user
Make sure you have entered the correct IP address using one of your server's IPs.
DocumentRoot directory is the web files directory.
- Save the file and exit.
- Restart Apache using this command:
Verify if the document root directory "/home/user/public_html" is accessible through the browser when accessing http://yourdomain.com (The domain must resolve on the IP address you have entered into the VirtualHost).