Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up a virtual host on a Fedora 18 installation. This is on Rackspace.

Following is my /etc/httpd/conf/httpd.conf (I deleted all the comment lines for brevity):

ServerRoot "/etc/httpd"

Listen 80

Include conf.modules.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
</Directory>

DocumentRoot "/var/www/html"

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

<IfModule mime_module>
    TypesConfig /etc/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

MIMEMagicFile conf/magic

EnableSendfile on

Include conf.d/*.conf

Here is my /etc/httpd/conf.d/00-rails.conf

<VirtualHost *:80>
    ServerName test.myinstall.com
    DocumentRoot /home/test/public
    <Directory /home/test/public>
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride all
        Order deny,allow
        Allow from all
        Options -MultiViews
    </Directory>
</VirtualHost>

In my /home/test/public I added an index.html file with the following in it:

<h3>This is a test page</h3>

The problem is that when I go to test.myinstall.com, I see the Fedora test page, as opposed to the message in index.html

When I do apachectl -S, here's what I get:

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server test.myinstall.com (/etc/httpd/conf.d/00-rails.conf:1)
         port 80 namevhost test.myinstall.com (/etc/httpd/conf.d/00-rails.conf:1)
         port 80 namevhost test.myinstall.com (/etc/httpd/conf.d/00-rails.conf:1)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authn-socache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default 
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

Additional info:

Here's my /etc/hosts file:

#this is the IPv6 address
#I used xxx to mask the real address
2001:xxxx:xxxx:xxxx:xxxx:d0a5:ff04:ab82 test.myinstall.com
#this is the externally accessible IP address
64.49.xxx.xx    test.myinstall.com
#this is the internal Rackspace IP address
10.xxx.xx.xx    test.myinstall.com  

Any ideas?

apache error log:

[Tue Apr 23 23:28:25.617954 2013] [suexec:notice] [pid 25527] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[ 2013-04-23 23:28:26.0266 25531/7f638fcdd740 agents/HelperAgent/Main.cpp:554 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.25527/generation-0/request.socket
[ 2013-04-23 23:28:26.0432 25536/7f4251e71800 agents/LoggingAgent/Main.cpp:272 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.25527/generation-0/logging.socket
[Tue Apr 23 23:28:26.084527 2013] [auth_digest:notice] [pid 25527] AH01757: generating secret for digest authentication ...
[ 2013-04-23 23:28:27.0253 25550/7f5362aa7740 agents/HelperAgent/Main.cpp:554 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.25527/generation-1/request.socket
[Tue Apr 23 23:28:27.041518 2013] [lbmethod_heartbeat:notice] [pid 25527] AH02282: No slotmem from mod_heartmonitor
[ 2013-04-23 23:28:27.0498 25555/7f21c5883800 agents/LoggingAgent/Main.cpp:272 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.25527/generation-1/logging.socket
[Tue Apr 23 23:28:27.064938 2013] [mpm_prefork:notice] [pid 25527] AH00163: Apache/2.4.4 (Fedora) Phusion_Passenger/4.0.0.rc6 configured -- resuming normal operations
[Tue Apr 23 23:28:27.065043 2013] [core:notice] [pid 25527] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Apr 23 23:28:33.851049 2013] [authz_core:error] [pid 25565] [client 66.xxx.141.202:2300] AH01630: client denied by server configuration: /home/test/public/
[Tue Apr 23 23:28:35.637170 2013] [authz_core:error] [pid 25565] [client 66.xxx.141.202:2300] AH01630: client denied by server configuration: /home/test/public/
[Tue Apr 23 23:50:49.520907 2013] [authz_core:error] [pid 25567] [client 66.xxx.141.202:56561] AH01630: client denied by server configuration: /home/test/public/
[Tue Apr 23 23:50:49.744630 2013] [authz_core:error] [pid 25567] [client 66.xxx.141.202:56561] AH01630: client denied by server configuration: /home/test/public/favicon.ico

Permissions for /home/test:

drwxr-xr-x. 2 test apache 4096 Apr 10 05:17 app
drwxr-xr-x. 2 test apache 4096 Apr 10 20:11 public
share|improve this question
1  
So what was logged in the Apache error_log? –  Michael Hampton Apr 24 '13 at 0:03
    
See my edits to the questions –  EastsideDeveloper Apr 24 '13 at 0:17

1 Answer 1

up vote 1 down vote accepted

The problem as shown in your error log is that you don't have permission to read the /home/test/public directory.

[Tue Apr 23 23:28:33.851049 2013] [authz_core:error] [pid 25565] [client 66.xxx.141.202:2300] AH01630: client denied by server configuration: /home/test/public/

The reason for this is that you have denied access to it:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

While you have a separate <Directory /home/test/public> entry, it doesn't allow access. It seems to have the old Apache 2.2-style Order, Allow and Deny directives. These have no effect in Apache 2.4, and have been replaced with the Require directive.

To resolve the issue, allow access to the directory. Remove the old directives and replace them with the new one:

<Directory /home/test/public>
    Require all granted
</Directory>
share|improve this answer
    
This solved the problem –  EastsideDeveloper Apr 24 '13 at 1:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.