Fix httpd apache wont start problem in Fedora 18


I found that I can’t start httpd / apache services in Fedora 18. There is several problem here. Let’s go to the first problem by running “service httpd start” :

1
2
Redirecting to /bin/systemctl restart  httpd.service
Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.

This give me errors :

1
sudo systemctl status httpd.service

and the results is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
httpd.service – The Apache HTTP Server
          Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
          Active: failed (Result: exit-code) since Wed 2013-01-23 17:29:43 SGT; 59s ago
         Process: 3322 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=0/SUCCESS)
         Process: 3320 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
          Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"

Jan 23 17:29:43 fedora httpd[3320]: AH00557: httpd: apr_sockaddr_info_get() failed for fedora
Jan 23 17:29:43 fedora httpd[3320]: AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 1… message
Jan 23 17:29:43 fedora systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 23 17:29:43 fedora httpd[3322]: AH00557: httpd: apr_sockaddr_info_get() failed for fedora
Jan 23 17:29:43 fedora httpd[3322]: AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 1… message
Jan 23 17:29:43 fedora httpd[3322]: httpd (no pid file) not running
Jan 23 17:29:43 fedora systemd[1]: Failed to start The Apache HTTP Server.
Jan 23 17:29:43 fedora systemd[1]: Unit httpd.service entered failed state


And for

1
sudo journalctl -xn

give me this results:

1
2
3
4
5
6
7
8
— Unit httpd.service has begun starting up.
Jan 23 17:30:59 fedora httpd[3349]: AH00557: httpd: apr_sockaddr_info_get() failed for fedora
Jan 23 17:30:59 fedora httpd[3349]: AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. S
Jan 23 17:30:59 fedora systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 23 17:30:59 fedora httpd[3351]: AH00557: httpd: apr_sockaddr_info_get() failed for fedora
Jan 23 17:30:59 fedora httpd[3351]: AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. S
Jan 23 17:30:59 fedora httpd[3351]: httpd (no pid file) not running
Jan 23 17:30:59 fedora systemd[1]: Failed to start The Apache HTTP Server.

This errors happen because the “ServerName” is not correctly configured in “/etc/httpd/conf/httpd.conf”.
Then, open the httpd.conf and add this values:

1
ServerName localhost

If you still got problem, check on “sudo tail -f /var/log/httpd/error_log” and see if you got this error
Did you got this errors :

1
2
3
[Wed Jan 23 17:37:22.713845 2013] [suexec:notice] [pid 3579] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jan 23 17:37:22.715277 2013] [unique_id:alert] [pid 3579] (EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "fedora"
AH00016: Configuration Failed

To solve this issue, just add your hostname into hosts and set the IP. First, get your hostname by:

1
cat /etc/hostname

Then put the values (for instance: fedora) into “/etc/hosts” and assign IP by:

1
127.0.0.1       fedora

If you have SELINUX problem, you can disabled by edit “/etc/selinux/config” and set into “disabled” by:

1
2
3
4
5
6
7
8
9
10
11
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing – SELinux security policy is enforced.
#     permissive – SELinux prints warnings instead of enforcing.
#     disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted – Targeted processes are protected,
#     minimum – Modification of targeted policy. Only selected processes are protected.
#     mls – Multi Level Security protection.
SELINUXTYPE=targeted

Now, when you’re executing “sudo service httpd start”, the services will up and works again! 😀


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.