T
T
trall2014-05-10 09:20:18
Apache HTTP Server
trall, 2014-05-10 09:20:18

How to make apache on multiple domains?

httpd.conf is now like this:
c040119dffc54480a21723e004a9ef73.PNG
But if you go to dropsydies.ru, the site w2myd.ru will be displayed. How to make the content for the site dropsydies.ru be served from the folder /var/www/dropsydies.ru, and for w2myd.ru - /var/www/w2myd.ru?
If I change, then dropsydies.ru is displayed everywhere, and vice versa, w2myd.ru
PS. Server IP - 162.243.255.87

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2014-05-10
@sashablashenkov

Here is the config for Apacke 2.4 (should work on 2.2 too):

<VirtualHost *:80>
  ServerAdmin [email protected]
  ServerName test
  serverAlias www.test

  DocumentRoot /web/test/www
  <Directory /web/test/www>
    Options -Indexes +FollowSymLinks -MultiViews
    AllowOverride All
    Require all granted
  </Directory>

  ErrorLog /web/test/error.log

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel info

  #CustomLog /web/test/access.log combined

</VirtualHost>

Edit, save in /etc/apache2/sites-available with the *.conf extension (in this case test.conf), for some reason the extension is important for 2.4.
In the terminal:
Depending on the OS, the path may change, but the essence is the same.
Instead of putting it in /etc/apache2/sites-available and enabling it through the terminal, you can immediately put the file in /etc/apache2/sites-enabled.
Well, reload the web server configuration:
sudo service apache2 reload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question