T
T
ThemeZV2014-09-02 19:07:46
Apache HTTP Server
ThemeZV, 2014-09-02 19:07:46

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>

2. For site.example.ru:
<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>

But example.ru opens, and site.example.ru gives a dns lookup error.
I ask for help in setting up. And because I did it myself, but I have no experience, is everything correct in the configurations above?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
falsebyte, 2014-09-03
@ThemeZ

Check records on the DNS side
How to create a subdomain on a server with a dedicated ip?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question