LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-15-2007, 07:50 AM   #1
rlee923
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 6
Posts: 88

Rep: Reputation: 17
config selinux to run apache server


Hi,

I've nearly finished all the LAMP setup from the tarballs most recent versions, but I couldn't get apache server to run.

when i tried this:

/usr/local/apache2/bin/apachectl

it gives me this error msghttpd:

Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied



After doing some serious search, I realised that I need to modify selinux (either make it permissive or disabled).

Is there any way to modify the policy so I allow apache server to run without disabling selinux?

I've tried what you can get from the GUI options(under System-> Admin SElinux level and firewall-> SElinux -> disable SELinux on httpd daemon) but didn't work. And I tried to just diable SElinux fully, and it worked.

If anyone has any idea, about this matter please help.

Thanks in advance.

Cheers.

Last edited by rlee923; 03-15-2007 at 07:51 AM.
 
Old 03-15-2007, 08:25 AM   #2
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30
hi,
this might be helpful,
http://fedora.redhat.com/docs/selinux-faq-fc5/

specifically, try audittoallow command.if u found any particular file context changed try restorecon command

regards,
Nirmal Tom.
 
Old 03-16-2007, 04:06 AM   #3
rlee923
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 6
Posts: 88

Original Poster
Rep: Reputation: 17
Thanks for the reply, I might dig into it tomorrow, looks like I have to go through the documentation of selinux part.

Cheers
 
Old 03-16-2007, 05:31 AM   #4
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30
hi,
ya ,its not too easy to get rid off these errors.Fedora 6 contains setroubleshoot , a graphical application to give permission to errors pointed by selinux.

But on my experience, its not so powerful.Usually u get selinux errors on apache for the contents under /var/www/html (i.e) web files we put new.in your case it seems an error on library file.If you reinstall apache(a simple hack try), i think u can avoid the error easily.

Also, try ls -Z for the file given error and u can find two terms in it.

scontext-context set for the file
tcontext-target context needed for file

Use chcon command to set context needed.


The document i point above contains a part for apache itself.



Note: if u change contexts too much, u can restore the contexts for all the files in the system with ease.


regards,
Nirmal Tom.
 
  


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
SELinux config mmy Linux - Security 1 02-06-2007 03:59 PM
SELinux Config Lines Linux31 Fedora - Installation 3 08-27-2004 01:03 AM
can you run an apache server alongside a postfix server mikew101 Linux - Software 5 07-10-2003 07:32 AM
Apache Server Config, Mail Server, & Uploading johan the olive Linux - Networking 5 03-14-2003 11:42 PM
Apache server and MySQL server won't run at startup! dday007 Linux - General 2 02-07-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:38 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