7 February 2018

APACHE - Accessing multiple domain names using port 80

If you plan to publish 2 or more domain urls from the same apache server, this configuration will help you but the requirement is the document root path should be different for all domains.

<VirtualHost *:80>
       ServerName my-server1.com
       DocumentRoot /var/www/html/my-app1
    <Directory /var/www/html/my-app1>
Options FollowSymLinks
AllowOverride All
    Require all granted
    </Directory>
</VirtualHost>


<VirtualHost *:80>
       ServerName my-server2.com
       DocumentRoot /var/www/html/my-app2
    <Directory /var/www/html/my-app2>
Options FollowSymLinks
AllowOverride All
    Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
       ServerName my-server3.com
       DocumentRoot /var/www/html/my-app3
    <Directory /var/www/html/my-app3>
Options FollowSymLinks
AllowOverride All
    Require all granted
    </Directory>
</VirtualHost>

No comments:

APACHE - failed to start

[On] Red Hat Enterprise Linux Server release 7.4 (Maipo) Apache was not running and attempt to start the httpd service failed. The natural t...