You are here
Home > Redhat > Apache Configuration

Apache Configuration

1. Basic method

2. Virtual Hosting

      a. IP Based

      b. Name Based

IP Based

<VirtualHost 192.168.1.1:80>

ServerName training.com

ServerAdminadmin@training.com

DocumentRoot /var/www/html/training

<Directory /var/www/html/training>

Order allow,deny

Allow from all

</Directory>

DirectoryIndex index.html index.html.var

ErrorLog /etc/httpd/logs/error_log

CustomLog /etc/httpd/logs/access_log

</VirtualHost>
 

<VirtualHost 192.168.1.2:80>

ServerName onlinetraining.com

ServerAdmin admin@onlinetraining.com

DocumentRoot /var/www/html/online

<Directory /var/www/html/online>

Order allow,deny

Allow from all

</Directory>

DirectoryIndex index.html index.html.var

ErrorLog /etc/httpd/logs/error_log

CustomLog /etc/httpd/logs/access_log

</VirtualHost>

NameVirtualHost 192.168.1.10:80

<VirtualHost192.168.1.10:80>

ServerName onlinefair.com

ServerAdmin admin@onlinefair.com

DocumentRoot /var/www/html/onlinefair

<Directory /var/www/html/onlinefair>

Order allow,deny

Allow from all

</Directory>

DirectoryIndex index.html index.html.var

ErrorLog /etc/httpd/logs/error_log

CustomLog /etc/httpd/logs/access_log

</VirtualHost>

<VirtualHost192.168.1.10:80>

ServerName onlinejob.com

ServerAdmin root@onlinejob.com

DocumentRoot /var/www/html/job

<Directory /var/www/html/job>

<Directory /var/www/html/job>

Order allow,deny

Allow from all

</Directory>

DirectoryIndex index.html index.html.var

ErrorLog /etc/httpd/logs/error_log

# CustomLog /etc/httpd/logs/access_log

</VirtualHost>

 

Leave a Reply

Top