Click to See Complete Forum and Search --> : Simple question - restarting Apache
mstembri3
02-24-2001, 10:14 AM
I've made a change to the httpd.conf file and would like to know if there is a way to shut down apache without having to reboot the whole computer.
I looked at apache's documentation and found a few commands - TERM and HUP. The documentation didn't explain how to use these commands in a way that my newbie mind could understand.
They provided an example of:
kill -TERM `cat /usr/local/apache/logs/httpd.pid`
But that doesn't look like what I'm after.
Thanks for the help!
bugfix
02-24-2001, 10:25 AM
The example they provide looks about right for killing the process, httpd.pid is a log file that simply stores the process ID of the http deamon, the 'cat' command is similar to the 'type' command in DOS.
You can find out the process ID of the http daemon manually be typing 'ps -aux' then you can kill it by typing
kill -TERM [number]
To restart it just find where httpd is located and run it.
FoBoT
02-24-2001, 10:26 AM
i just tried httpd down to stop it
and httpd to restart
maybe??
bugfix
02-24-2001, 10:32 AM
Some people are always looking for the easy way out. Just shows how long its been since I've used Apache, doesn't it? :D
HuggyBear
02-24-2001, 10:35 AM
Originally posted by mstembri3:
I've made a change to the httpd.conf file and would like to know if there is a way to shut down apache without having to reboot the whole computer.
I looked at apache's documentation and found a few commands - TERM and HUP. The documentation didn't explain how to use these commands in a way that my newbie mind could understand.
They provided an example of:
kill -TERM `cat /usr/local/apache/logs/httpd.pid`
But that doesn't look like what I'm after.
Thanks for the help!
Maybe I'm not understanding you but it should be. apachectl stop or start or restart
There are other options to. Just use "apachectl restart". Some distros require you to be in the apach directory where apachectl is in order for it to work.
Hope this helps
Huggy
trekker
02-24-2001, 10:36 AM
Try "/etc/rc.d/init.d/httpd restart" or "/usr/local/apache/bin/apachectl restart" depending on which version your apache is.
mstembri3
02-24-2001, 10:39 AM
a) when I typed in ps -aux, over 800 things printed to teh screen. Many had 'apache' in the name/path, but I have no clue which to terminate.
b) 'httpd down' does not work.
mstembri3
02-24-2001, 10:48 AM
httpd is located in the usr/sbin directory. I typed in 'httpd restart' and it went back to the prompt, but no errors.
There is another httpd in the ctc/rc.d/init.d/ directory. Typing 'httpd restart' does the same thing -- just goes back to a prompt.
Does this mean apache restarted?
(There isn't a usr/local/apache directory.)
trekker
02-24-2001, 10:53 AM
You should see something like this:
Shutting down http: [OK]
Starting httpd: [OK]
Maybe you can try "/etc/rc.d/init.d/httpd stop" followed by "/etc/rc.d/init.d/httpd start" and see if you can get anything.
mstembri3
02-24-2001, 10:58 AM
Ok, I just went ahead and rebooted the machine to make the changes.
The reason for the reboot/attempted restart was that I wanted to change the default DocumentRoot from var/www to home/httpd/html
I added home/httpd/html to the DocumentRoot section of httpd.conf, and commented out the existing var/www (with a #). After rebooting, I get an apache 'access denied' error when trying to reach the index.html page. Switch back to var/www (commenting out home/httpd/html) and the apache test page appears just fine.
Should I be doing anything to the folder permissions when I change defualt DocumentRoot? Right now httpd and html is 775.