LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-07-2010, 08:48 AM   #1
Kraiser10
Member
 
Registered: Mar 2010
Posts: 48

Rep: Reputation: 15
Chrooted apache how to restart?


Code:
Restarting Apache

Once chrooted, Apache cannot access anything located above ChrootDir. For that reason restarting Apache with 'apachectl reload', 'apachectl graceful' or 'kill -HUP apache_pid' will not work as expected. Apache will not be able to read its config file, open logs or load modules (unless you put them inside the jail, but mod_chroot is all about not doing that!). Use 'apachectl stop' followed by 'apachectl start' to restart mod_chroot-enabled Apache.
i tried apache2ctl stop and the result:
httpd (no pid file) not running
after that apache is still working.
OS debian lenny

Last edited by Kraiser10; 04-09-2010 at 08:53 AM.
 
Old 04-08-2010, 02:04 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

I guess you have to run these commands from inside the chroot directory

Regards
 
Old 04-08-2010, 07:47 AM   #3
Kraiser10
Member
 
Registered: Mar 2010
Posts: 48

Original Poster
Rep: Reputation: 15
Only PHP scripts are inside chroot dir.
 
Old 04-08-2010, 07:52 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by Kraiser10 View Post
Code:
Restarting Apache

Once chrooted, Apache cannot access anything located above ChrootDir. For that reason restarting Apache with 'apachectl reload', 'apachectl graceful' or 'kill -HUP apache_pid' will not work as expected. Apache will not be able to read its config file, open logs or load modules (unless you put them inside the jail, but mod_chroot is all about not doing that!). Use 'apachectl stop' followed by 'apachectl start' to restart mod_chroot-enabled Apache.
i tried apache2ctl stop and the result:
httpd (no pid file) not running
after that apache is still working.
OS debian lenny
What is the output of
Quote:
#service httpd status
Just to know if apache is still running, if its not running try starting the service again.
 
Old 04-08-2010, 08:43 AM   #5
Kraiser10
Member
 
Registered: Mar 2010
Posts: 48

Original Poster
Rep: Reputation: 15
It's still running i can access web throught browser and it's still in top so...
 
Old 04-08-2010, 04:54 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
Only PHP scripts are inside chroot dir.
Then apache is not exactly chrooted. You need to tweak other things also, most significant of them being the PidFile, that is used to start/stop/restart etc httpd.
You can find more details about mod_chroot for apache2 here

Regards
 
Old 04-08-2010, 10:55 PM   #7
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by Kraiser10 View Post
It's still running i can access web throught browser and it's still in top so...
Can you see httpd with pstree or top?
If yes then you will find the pid, kill httpd and then try starting it again. You can also use pidof httpd to determine the pid of httpd.
 
Old 04-09-2010, 07:49 AM   #8
Kraiser10
Member
 
Registered: Mar 2010
Posts: 48

Original Poster
Rep: Reputation: 15
Oh yeah thanks it worked :-)
 
Old 04-09-2010, 07:54 AM   #9
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Bangalore, India
Distribution: Linux Mint 13
Posts: 590

Rep: Reputation: 64
Quote:
Originally Posted by Kraiser10 View Post
Oh yeah thanks it worked :-)
You are welcome, now you can mark the thread as solved. Have a great day.
 
  


Reply

Tags
apache, chroot, debian, restart


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache chrooted? clau_bolson Linux - Server 1 12-23-2008 08:08 AM
Chrooted Apache and phpsysinfo jaakkop Linux - Networking 0 09-18-2006 10:41 AM
chrooted apache problem ixion Linux - Security 19 03-29-2005 03:21 AM
chrooted apache on suse dominant Linux - Security 3 11-10-2004 11:08 AM
Chrooted Apache dominant Linux - Security 4 09-20-2004 02:48 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration