0

How do you diagnose problems accessing an Apache site on Fedora?

I deleted everything in my /var/log, then restarted rsyslog and httpd. Then cat /var/log/messages gives me:

Jun  3 21:43:09 localhost kernel: imklog 5.8.10, log source = /proc/kmsg started.
Jun  3 21:43:09 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="29043" x-info="http://www.rsyslog.com"] start
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module alias_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module auth_basic_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module authn_file_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module authz_default_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module authz_groupfile_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module authz_host_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module authz_user_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module autoindex_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module deflate_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module dir_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module env_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module headers_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module log_config_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module mime_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module negotiation_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module rewrite_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module setenvif_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module ssl_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module status_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] module wsgi_module is already loaded, skipping
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] NameVirtualHost *:444 has no VirtualHosts
Jun  3 21:43:15 localhost httpd[29065]: [Mon Jun 03 21:43:15 2013] [warn] NameVirtualHost *:443 has no VirtualHosts
Jun  3 21:43:15 localhost systemd[1]: PID file /var/run/httpd/httpd.pid not readable (yet?) after start.

[root@localhost ~]# ls -lah /var/run/httpd
total 4.0K
drwxr-xr-x  2 apache apache   60 Jun  3 21:43 .
drwxr-xr-x 31 root   root   1.1K Jun  3 21:43 ..
-rw-r--r--  1 root   root      6 Jun  3 21:43 httpd.pid
[root@localhost ~]# ls -lah /var/log/httpd
total 12K
drwxr-xr-x 2 apache apache 4.0K Jun  3 21:43 .
drwxr-xr-x 3 root   root   4.0K Jun  3 21:43 ..
-rw-r--r-- 1 root   root      0 Jun  3 21:43 mysite-access.log
-rw-r--r-- 1 root   root      0 Jun  3 21:43 mysite-error.log
-rw-r--r-- 1 root   root      0 Jun  3 21:43 mysite-rewrite.log
-rw-r--r-- 1 root   root   2.3K Jun  3 21:43 error.log
srwx------ 1 apache root      0 Jun  3 21:43 wsgi.29066.0.1.sock

My /var/log/httpd/error.log shows:

[Mon Jun 03 21:43:15 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jun 03 21:43:15 2013] [notice] SSL FIPS mode disabled
[Mon Jun 03 21:43:15 2013] [warn] module alias_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module auth_basic_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module authn_file_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module authz_default_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module authz_groupfile_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module authz_host_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module authz_user_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module autoindex_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module deflate_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module dir_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module env_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module headers_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module log_config_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module mime_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module negotiation_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module rewrite_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module setenvif_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module ssl_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module status_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [warn] module wsgi_module is already loaded, skipping
[Mon Jun 03 21:43:15 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Jun 03 21:43:15 2013] [notice] Digest: done
[Mon Jun 03 21:43:15 2013] [notice] SSL FIPS mode disabled
[Mon Jun 03 21:43:15 2013] [warn] mod_wsgi: Compiled for Python/2.7.2.
[Mon Jun 03 21:43:15 2013] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Mon Jun 03 21:43:15 2013] [notice] Apache/2.2.22 (Unix) DAV/2 mod_ssl/2.2.22 OpenSSL/1.0.0j-fips mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations

I have only a single site enabled in my /etc/httpd/sites-enabled/mydomain.conf:

<VirtualHost *:80>
    ServerName www.mydomain.com
    ServerAlias mydomain.com *.mydomain.com
    DocumentRoot /usr/local/mydomain
    RewriteEngine On
    AllowEncodedSlashes On
    Alias /media/ /usr/local/mydomain/media
    <Directory /usr/local/mydomain>
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
</VirtualHost>

Running netstat -tulpn shows httpd is bound to port 80.

In my /etc/hosts I have:

192.168.1.2 www.mydomain.com

which is the domain of the server.

I've also disabled iptables on the server service iptables stop.

I have a sample file for testing: cat /usr/local/mydomain/media/test.txt:

hello world

However, when I access http://www.mydomain.com/media/test.txt I get "Firefox can't establish a connection to the server at www.mydomain.com" as though the server wasn't even running.

I see no error messages in /var/log/messages or /var/log/httpd/error.log. What am I doing wrong?

1
  • Can you access the server from the machine itself? What happens if you do curl localhost on the server?
    – Alex V
    Jun 4, 2013 at 2:58

1 Answer 1

0

You have to give a little more information please - make sure that ports are accessible, are you able to display that default apache "It works" page, you can also try connecting from command line of some other box to this box on port 80 and see if you can connect.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .