Re: [CentOS] Virtual Hosts question

2014-02-06 Thread Steven Tardy
On Thu, Feb 6, 2014 at 11:54 AM, Joseph Hesse  wrote:

>
> == httpd.conf ==
> ServerName 192.168.0.99
>
> NameVirtualHost *:80
>
> 
>   ServerName IDoNotExist.com
>   DocumentRoot /var/www/html
>   DirectoryIndex Index.html index.html
> 
>
> 
>   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
> 
> == httpd.conf ==
>
> Tail of error.log ==
> [Thu Feb 06 10:26:01 2014] [error] [client 24.118.254.66] Directory
> index forbidden by Options directive: /var/www/wordpress/
> == error.log ==
>


update your httpd.conf...
  http://httpd.apache.org/docs/2.2/mod/core.html#options

 == httpd.conf ==
ServerName 192.168.0.99

NameVirtualHost *:80


 Options Indexes FollowSymLinks


< 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 ==
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Virtual Hosts question

2014-02-06 Thread Always Learning

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
> 
> 
>   ServerName IDoNotExist.com
>   DocumentRoot /var/www/html
>   DirectoryIndex Index.html index.html
> 
> 
> 
>   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
> 
> == httpd.conf ==

I have about 20+ virtual hosts.

In my Virtual Hosts Apache entries I have



I never have * as a domain name.

I do not have:   ServerAlias

I have: ErrorLog  ///err.


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.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Virtual Hosts question

2014-02-06 Thread Paul Heinlein

On Thu, 6 Feb 2014, 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).

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.

I want the first virtual host to be a default and accessed whenever a
user types http://X.com (no sub directory).  There is a valid
/var/www/html/index.html file.

Unfortunately it doesn't work.  The error is "Directory index forbidden
by Options directive: /var/www/wordpress/" and googling didn't help.

I have my httpd.conf and error.log below.

Thank you, Joe

== httpd.conf ==
ServerName 192.168.0.99

NameVirtualHost *:80


 ServerName IDoNotExist.com
 DocumentRoot /var/www/html
 DirectoryIndex Index.html index.html



Since the ServerName for your first virtual host is NOT X.com, no one 
will get to this virtual host unless they specify the IP address 
associated with X.com, so /var/www/html won't be the DocumentRoot for 
people attempting to reach X.com.




 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



Here's the host people will reach via http://X.com/.

My first guess is that the Unix permissions on /var/www/wordpress or 
the index.php file within it are too restrictive.


My second guess is that the SELinux labels for them might be 
incorrect.


My third guess is that there's a restriction somewhere in the 
httpd.conf that you didn't snip for us.



== httpd.conf ==


--
Paul Heinlein
heinl...@madboa.com
45°38' N, 122°6' W___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Virtual Hosts question

2014-02-06 Thread Joseph Hesse
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).

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.

I want the first virtual host to be a default and accessed whenever a 
user types http://X.com (no sub directory).  There is a valid 
/var/www/html/index.html file.

Unfortunately it doesn't work.  The error is "Directory index forbidden 
by Options directive: /var/www/wordpress/" and googling didn't help.

I have my httpd.conf and error.log below.

Thank you, Joe

== httpd.conf ==
ServerName 192.168.0.99

NameVirtualHost *:80


  ServerName IDoNotExist.com
  DocumentRoot /var/www/html
  DirectoryIndex Index.html index.html



  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

== httpd.conf ==

Tail of error.log ==
[Thu Feb 06 10:25:48 2014] [notice] suEXEC mechanism enabled (wrapper: 
/usr/sbin/suexec)
[Thu Feb 06 10:25:48 2014] [notice] Digest: generating secret for digest 
authentication ...
[Thu Feb 06 10:25:48 2014] [notice] Digest: done
[Thu Feb 06 10:25:49 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 
configured -- resuming normal operations
[Thu Feb 06 10:26:01 2014] [error] [client 24.118.254.66] Directory 
index forbidden by Options directive: /var/www/wordpress/
[Thu Feb 06 10:26:01 2014] [error] [client 24.118.254.66] File does not 
exist: /var/www/wordpress/favicon.ico
== error.log ==
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos