Apache Virtual Hosts#

For multiple domains and subdomains on one IP address#

Create a file called vhost.conf in /etc/httpd/conf.d
NameVirtualHost *:80
<VirtualHost *:80>
        ServerName $domain
        DocumentRoot /var/www/html/$domain
        <Directory /var/www/html/$domain>
                Options Indexes FollowSymLinks +ExecCGI
                AllowOverride All
                Allow from All
                Order Allow,Deny
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName $domain2
        DocumentRoot /var/www/html/$domain2
        <Directory /var/www/html/$domain2>
                Options Indexes FollowSymLinks +ExecCGI
                AllowOverride All
                Allow from All
                Order Allow,Deny
        </Directory>
</VirtualHost>

  • Set Permissions
chmod 755 /var/www/html/$domain
chown apache:apache /var/www/html/$domain

  • Restart Apache

Centos 6

service apache restart

Centos 7


systemctl restart httpd

Back to Linux

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 21-Mar-2018 11:52 by Hyve Support
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X
    

All Pages

Page views: 2291

Private Tomcat

Linux

MySQL

Email

SQL Server

ASP

JSP

C#

Web Mail

Windows Plesk

Linux Plesk

PHP

Gaming

ASP.NET

Persits ASPUpload

Wiki Help

Referring Pages:
...nobody

JSPWiki v2.8.1