Answer the question
In order to leave comments, you need to log in
How to configure apache webserver this way?
There is a domain.ru domain
, it is directed to the SP 111.112.123.124 , it is
necessary that the domain.ru domain looks at the /var/www/site1 directory,
and all substituted ones automatically look at the /var/www/site2 directory,
but the hello.domain.ru subdomain looks at the directory /var/www/site3
now I have ServerAlias: *.domain.ru looks at /var/www/site1 and it is necessary that at /var/www/site2
Answer the question
In order to leave comments, you need to log in
<VirtualHost 111.112.123.124:80>
ServerName site1.ru
ServerAlias www.site1.ru
ServerAdmin [email protected]
DocumentRoot /var/www/site1.ru
ErrorLog logs/ami-com_error_log
LogLevel warn
CustomLog logs/ami-com_access_log combined
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site1.ru>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 111.112.123.124:80>
ServerName hello.domain.ru
ServerAlias www.hello.domain.ru
ServerAdmin [email protected]
DocumentRoot /var/www/site3.ru
ErrorLog logs/ami-com_error_log
LogLevel warn
CustomLog logs/ami-com_access_log combined
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site3.ru>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Require all granted
</Directory>
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question