httpd start failing

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
smartidiot
Posts: 3
Joined: 2010/04/27 12:47:47

httpd start failing

Post by smartidiot » 2010/04/27 12:56:47

I installed CentOS 5.4 on an Intel x86 box. ALl services seems to be fine however httpd is not starting somehow. SELinux is enabled in enforcing mode. I want to use a different path for web server hence not using default path settings. I changed the directory and file context to httpd_sys_content_t ion recursive mode using chcon -Rv command. I even persisted the file contexts. Still httpd startup fails.

Worst part is that I don't even get any error, it simply say "startp failed". I have attached a screen shot of the same. I checked using dmesg and system logs but didn't find any errors for httpd startup failure.

Any help on where to look and how to debug the issue further would be highly appreciated. Thanks in advance.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

httpd start failing

Post by pschaff » 2010/04/27 13:37:38

Welcome to the CentOS fora. The following reading is recommended for new users:
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14274&forum=47]Readme First[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14408&forum=47]Installing Software[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14273&forum=47]Where to Find Answers[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]How to provide information about your system[/url]

The forum attachment function is permanently broken. You can post a link to somewhere you can post public images, or better yet, show the exact text of the error.

What output do you get from[code]
chkconfig --list httpd
service httpd restart
[/code]?

smartidiot
Posts: 3
Joined: 2010/04/27 12:47:47

Re: httpd start failing

Post by smartidiot » 2010/04/28 05:49:42

Thanks for your response. Below if the output of commands you mentioned.

[code]
[root@xxx ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:on 6:off

[root@xxx ~]# service httpd start
Starting httpd: [FAILED]
[/code]

In the pop-up also it doesn't mention the error specifically.

I noticed one thing though. I created a partition for web server /web on my server and have set the httpd context recursively. When I do ls -lZ, it shows as below which seems to be correct context.

[code]
drwxr-xr-x apache apache system_u:object_r:httpd_sys_content_t web
[/code]

However when I use matchpathcon command on same directory, it shows

[code]
[root@xxx ~]# matchpathcon /web
/web system_u:object_r:default_t
[/code]

Here seems to be a mismatch in security context. Not sure if it means anything.

smartidiot
Posts: 3
Joined: 2010/04/27 12:47:47

Re: httpd start failing

Post by smartidiot » 2010/04/28 06:35:43

Looks like I found something, need to see if this is the issue. httpd error logs say,

[code]
[Wed Apr 28 11:33:36 2010] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile]
[/code]

Now, any idea why I am getting this? I don't want to disable SSL.

milosb
Posts: 661
Joined: 2009/01/18 00:39:15
Location: 44 49′14″N 20 27′44″E

Re: httpd start failing

Post by milosb » 2010/05/01 20:56:15

[quote]
smartidiot wrote:
However when I use matchpathcon command on same directory, it shows

[code]
[root@xxx ~]# matchpathcon /web
/web system_u:object_r:default_t
[/code]

Here seems to be a mismatch in security context. Not sure if it means anything.[/quote]

Well unless 'something relevant' shows up in [b]/var/log/audit/audit.log[/b] when attempt to start Apache, I doubt SELinux is the culprit here. Like it says in the manual:
[i][b]
matchpathcon - get the default SELinux security context for the specified path from the file contexts configuration.
[/i][/b]
which in my interpretation means your [b]/web[/b] folder will inherit the default [b]/[/b] SELinux context since it's not one of the original [b]/[/b] folders, and hence shouldn't have any default context configuration.

BTW, have you tried disabling SSL to see if Apache will start, or rule it out as the source of the problem?

Post Reply