3 sites, same virtual host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have 3 sites and one virtual host for each of them. They are Drupal
sites sharing the same document root but with different databases.

The vhosts are like this:

<VirtualHost 1.2.3.4:80>
  ServerName my_site_1.net
  DocumentRoot /var/www/html/my_site
  ErrorLog logs/my_site_1-error_log
  CustomLog logs/my_site_1-access_log combined
  ... # many lines here
</VirtualHost>

I would like to make it one only virtual host for all the three. They
are almost the same except for the log files. I would like to have
something like this:

<VirtualHost 1.2.3.4:80>
  ServerName my_site_1.net
  ServerAlias my_site_2.net
  ServerAlias my_site_3.net
  DocumentRoot /var/www/html/my_site

  If (domain == 'my_site_1.net') {
     ErrorLog logs/my_site_1-error_log
     CustomLog logs/my_site_1-access_log combined
  }
  else If (domain == 'my_site_2.net') {
     ErrorLog logs/my_site_2-error_log
     CustomLog logs/my_site_2-access_log combined
  }
  else {
     ErrorLog logs/my_site_3-error_log
     CustomLog logs/my_site_3-access_log combined
  }

  ... # many lines here
</VirtualHost>

Obviously i know there are no if() commands. It is just to show what i want.

Regards,
--
Clodoaldo Pinto Neto

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux