LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-25-2007, 09:24 PM   #1
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Rep: Reputation: 15
Exclamation Service httpd failed


Hi all,

I am running Fedora Core 6 with Apache Server 2.2.3. I seem to have a problem starting the httpd service:

# /sbin/service httpd start
Starting httpd: [FAILED]

I tried this:

/usr/sbin/httpd -k start

And it worked, but for some reason, the service doesn't work. I also tried:

/usr/sbin/apachectl -k start

It would give no error, but it wouldn't start. Please help!
 
Old 03-25-2007, 10:55 PM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
What do you see in the Apache error_log (most likely located in /var/log/httpd)? My first guess is that you have a log file over the 2-GB size limit. It would really help to know what is being logged, though.
 
Old 03-26-2007, 12:07 PM   #3
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Original Poster
Rep: Reputation: 15
There is nothing in the Apache error_log about not being able to start up and it is only 160 KB. The log only shows stuff from the /usr/sbin/httpd (the working one)...
 
Old 03-26-2007, 10:05 PM   #4
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Original Poster
Rep: Reputation: 15
I also recently figured out that the problem was SELinux. I disabled SELinux for HTTPD and it worked but I do not know what in SELinux is causing httpd not to work...it is something to do with the httpd init script and apachectl cuz /usr/sbin/httpd works as I stated in my first post.
 
Old 03-26-2007, 10:34 PM   #5
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Original Poster
Rep: Reputation: 15
This is what it says in /var/log/messages:

Code:
Mar 26 23:31:42 moenterprise kernel: audit(1174966302.964:37): avc:  denied  { search } for  pid=4004 comm="httpd" name=57656220536572766572 dev=dm-0 ino=1638988 scontext=user_u:system_r:httpd_t:s0 tcontext=root:object_r:user_home_t:s0 tclass=dir

Last edited by moenterprise; 03-26-2007 at 10:37 PM.
 
Old 03-27-2007, 07:47 PM   #6
moenterprise
Member
 
Registered: Mar 2007
Distribution: Fedora Core 6
Posts: 94

Original Poster
Rep: Reputation: 15
Ok. I figured it out. I have my DocumentRoot in my /home directory, therefore, I had to change the folder's security context to httpd_sys_content_t.
Then everything worked!
 
Old 03-27-2007, 10:09 PM   #7
ashesh0326
Member
 
Registered: Jan 2007
Distribution: Suse 10.0, FC 6
Posts: 93

Rep: Reputation: 15
moenterprise,
I had to say, I don't think putting the document root in the /home directory can be a good idea. One little bug in your script can put your entire system at risk.
Rather, I'd recommend you to get the document root to be the default; /var/www/html (or /var/www/htdocs), I think that would be much better.
Changing permissions for the /home directory cannot be a good idea, and neither can it be a good idea to change permissions for the whole apache user/group.
Better still, put your document/scripts in some other partition of your hard drive, or in some other hard drive for that matter.
One of my friends' systems got compromised this way. ;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Service httpd nnadithya Linux - Server 5 12-16-2006 09:08 PM
service httpd status, results in httpd dead but subsys locked squadja Red Hat 2 09-11-2004 10:31 PM
starting httpd as service strimp099 Red Hat 10 04-12-2004 07:38 PM
httpd as a service joshf Linux - Software 5 07-10-2003 07:54 AM
Using HTTPD Service skopje909 Linux - General 1 11-15-2001 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration