LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Chrooted apache how to restart? (https://www.linuxquestions.org/questions/linux-software-2/chrooted-apache-how-to-restart-800583/)

Kraiser10 04-07-2010 08:48 AM

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

bathory 04-08-2010 02:04 AM

Hi,

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

Regards

Kraiser10 04-08-2010 07:47 AM

Only PHP scripts are inside chroot dir.

Sayan Acharjee 04-08-2010 07:52 AM

Quote:

Originally Posted by Kraiser10 (Post 3927457)
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.

Kraiser10 04-08-2010 08:43 AM

It's still running i can access web throught browser and it's still in top so...

bathory 04-08-2010 04:54 PM

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

Sayan Acharjee 04-08-2010 10:55 PM

Quote:

Originally Posted by Kraiser10 (Post 3928543)
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.

Kraiser10 04-09-2010 07:49 AM

Oh yeah thanks it worked :-)

Sayan Acharjee 04-09-2010 07:54 AM

Quote:

Originally Posted by Kraiser10 (Post 3929839)
Oh yeah thanks it worked :-)

You are welcome, now you can mark the thread as solved. :) Have a great day.


All times are GMT -5. The time now is 10:27 PM.