[CentOS] Virtual Hosts question

Thu Feb 6 17:14:29 UTC 2014
Always Learning <centos at u62.u22.net>

On Thu, 2014-02-06 at 10:54 -0600, Joseph Hesse wrote:

> I am running Wordpress on a CentOS 6.5 server which is behind a router. 
> The private IP is 192.168.0.99, the public URL is X.com (name changed).

> ============== httpd.conf ==============
> ServerName 192.168.0.99
> 
> NameVirtualHost *:80
> 
> <VirtualHost *:80>
>   ServerName IDoNotExist.com
>   DocumentRoot /var/www/html
>   DirectoryIndex Index.html index.html
> </VirtualHost>
> 
> <VirtualHost *:80>
>   ServerName X.com
>  ServerAlias www.X.com
>   DocumentRoot /var/www/wordpress
>   DirectoryIndex Index.html index.html index.php Index.php
>   CustomLog logs/access_log_custom common
> </VirtualHost>
> ============== httpd.conf ==============

I have about 20+ virtual hosts.

In my Virtual Hosts Apache entries I have

<VirtualHost example.com:80 www.example.com:80>

I never have * as a domain name.

I do not have:   ServerAlias

I have:     ErrorLog  /xxxx/xxxx/err.xxxx

--------------------
My advice is to simplify this

> DirectoryIndex Index.html index.html index.php Index.php

Have only index.html and index.php

Good Luck.

--------------------

To solve the OPTIONS problem, you need to find the OPTIONS entries in
your Apache configurations files.

--------------------------

I do not understand how you can have multiple 'virtual hosts' all
sharing exactly the same domain name and port number.

> I have two virtual hosts in my httpd.conf file.  The second one,
> listed below, is for Wordpress and it is accessed with
> http://X.com/d4i or  http://www.X.com/d4i. They work fine.
>
> Actually, not show, I have more Wordpress virtual hosts, and
> they are accessed with http://X.com/s1, http://X.com/s2, etc.
> and they work.

My understanding is ONE virtual host = one domain.name

You can have:-

	sub-domain1.example.com
	sub-domain2.example.com

as 2 virtual hosts.

-- 
Paul.
England,
EU.

   Our systems are exclusively Linux. No Micro$oft Windoze here.