Answer the question
In order to leave comments, you need to log in
How to create a virtual host in Apache2?
There is: Apache2, domain and website (example.ru).
Goal: host another site (site.example.ru).
2 configuration files are created in site-available:
1. For example.ru:
<VirtualHost *:80>
ServerName example.ru
ServerAlias example.ru *.exapmle.ru
ServerAdmin [email protected]
DocumentRoot /home/artem/themezv
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName site.example.ru
ServerAlias site.example.ru *.site.example.ru
ServerAdmin [email protected]
DocumentRoot /home/artem/liza
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question