nightfox1405241487 0 Report post Posted March 15, 2006 I've worked with Apache long enough that I know (or at least I thought I knew) how to restart it. The problem: my terminal is filled with "command not found" and other errors and the such.httpd restart, right? NOPE! Command not found!apachectl restart, NOPE! Command not found!I'm out of ideas! I can't just keep physically re-booting the machine when I need JUST apache to restart! Thanks for any help, my system is Debain 3.1 r1.[N]F Share this post Link to post Share on other sites
Houdini 0 Report post Posted March 15, 2006 /sbin/service httpd reload Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 16, 2006 /sbin/service httpd reload Houdini is close but the proper commands you can do is/sbin/service httpd start/sbin/service httpd stop/sbin/service httpd restartWhich restart is is the one you've after, can only be performed by root or a super user.I usually do:su -c "/sbin/service httpd restart"Which is similar to sudo but I feel is much better to use than sudo, it may not work with some older distributions.Cheers,MC Share this post Link to post Share on other sites
XIII 0 Report post Posted March 16, 2006 /sbin/service httpd reload  i think that depends on the version, right?for me it works when i type: sudo /etc/apache/apachectl restarti think this is because my apache version is 1.3, right? Share this post Link to post Share on other sites
yordan 10 Report post Posted March 16, 2006 i think that depends on the version, right?Really depends on version.On my system I have to do cd $ORACLE_HOME/Apache/Apache/bin./apachectl stop./apachectl startsounds rather different, isn't it ? Share this post Link to post Share on other sites
XIII 0 Report post Posted March 17, 2006 Really depends on version. On my system I have to do cd $ORACLE_HOME/Apache/Apache/bin ./apachectl stop ./apachectl start sounds rather different, isn't it ? Â Nope, it's the same mate, as it's the same command, me too i can do it directly by ./apachectl restart or stop then start, i meant the difference is wither it's httpd, apache 1.34 or apache2, that's what i meant Share this post Link to post Share on other sites
OpaQue 15 Report post Posted March 17, 2006 Try these.1. service apache restart2. /etc/init.d/httpd restart Share this post Link to post Share on other sites
nightfox1405241487 0 Report post Posted March 18, 2006 I don't get this... I've tried every command you guys have given and none of them work!service apache restart gives me: "bash: service: command not found"/etc/init.d/httpd restart gives me: "bash: /etc/init.d/httpd: No such file or directory"/etc/apache/apachectl restart gives me: "/etc/apache/apachectl: No such file or directory"/sbin/service httpd reload gives me: "/sbin/service: No such file or directory"hmm... I don't know... the file structure seems to be normal.var/www contains all of the default documents, etc/apache2 seems to have everything normal. Is there a way I could go about uninstalling Apache and re-installing it?[N]F Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 19, 2006 OK then, give us the important information that we need.What distribution are you running? What version of Apache do you have installed?Going by what you've said you say you've got Apache2, in /etc/Apache2, that sounds like Debian or a variant of it.So the command that you will need to use is/etc/init.d/apache2 restartorapache2ctl restartFor the apache2ctl command, If it returns command not found, do:which apache2ctlAnd it will show paths of where this command could exist, then you would do /path/to/apache2ctl restartCheers,MC Share this post Link to post Share on other sites
bakr_2k5 0 Report post Posted September 25, 2006 (edited) I've worked with Apache long enough that I know (or at least I thought I knew) how to restart it. The problem: my terminal is filled with "command not found" and other errors and the such.httpd restart, right? NOPE! Command not found!apachectl restart, NOPE! Command not found!I'm out of ideas! I can't just keep physically re-booting the machine when I need JUST apache to restart! Thanks for any help, my system is Debain 3.1 r1.[N]F Hi nightfox,try this command as root:httpd -k restart bakr_2k5<edit>Uh yes sorry about that, kinda old thread but anyway didn't know if the problem was gone </edit> Edited September 25, 2006 by bakr_2k5 (see edit history) Share this post Link to post Share on other sites
yordan 10 Report post Posted September 25, 2006 Still useful. However, this syntax is not worth everywhere. On my system, CONSOLE SYNOPSIS httpd [ -X ] [ -L libexecdir ] [ -d serverroot ] [ -f config ] [ -C directive ] [ -c directive ] [ -D paramètre ] httpd [ -h ] [ -l ] [ -v ] [ -V ] [ -S ] [ -? ]so, the option -k seems not to exist on my Redhat, nor the -restart option. Share this post Link to post Share on other sites
bakr_2k5 0 Report post Posted September 25, 2006 I use Fedora Core 5 and it states in the man pages: NAME httpd - Apache Hypertext Transfer Protocol ServerSYNOPSIS httpd [ -d serverroot ] [ -f config ] [ -C directive ] [ -c directive ] [ -D parameter ] [ -e level ] [ -E file ] [ -k start|restart|grace- ful|stop|graceful-stop ] [ -R directory ] [ -h ] [ -l ] [ -L ] [ -S ] [ -t ] [ -v ] [ -V ] [ -X ] [ -M ] Strange .. Maybe some different versions? Share this post Link to post Share on other sites
yordan 10 Report post Posted September 25, 2006 Strange .. Maybe some different versions?Probably, yes. I'm using "Kernel 2.6.9-22.EL on an i686." Share this post Link to post Share on other sites
bakr_2k5 0 Report post Posted September 25, 2006 (edited) Probably, yes. I'm using "Kernel 2.6.9-22.EL on an i686." I'm on a 2.6.17-1.2187_FC5 64bit (x86_64)Perhaps RedHat packages are a bit more expert orientated?Since RedHat is really a server distro...Well who knows.These commands work too on my systemCONSOLE apachectl restartapachectl -k restart/etc/rc.d/init.d/httpd restart bakr_2k5 Edited September 25, 2006 by bakr_2k5 (see edit history) Share this post Link to post Share on other sites
iGuest 3 Report post Posted August 6, 2008 Replying to mastercomputersReplying to nightfoxHow was apache installed ??If its residing under one of the system path then simple "service httpd restart" should have worked but if its source compiled with a different --prefix folder which you are not aware of then use "ps -wwaux | grep httpd" to get process listing , this will also give you the path under which you have the binaries, in my case I got thisDaemon 30146 0.0 0.0 171808 5548 ? S 22:12 0:00 /usr/local/apache/bin/httpd -k startDaemon 30321 0.0 0.0 171808 5552 ? S 22:21 0:00 /usr/local/apache/bin/httpd -k startDaemon 31419 0.0 0.0 171808 5544 ? S 23:18 0:00 /usr/local/apache/bin/httpd -k startDaemon 31421 0.0 0.0 171808 5552 ? S 23:18 0:00 /usr/local/apache/bin/httpd -k startMy apache resides under "/usr/local/apache" so I can use/usr/local/apache/bin/apachectl restart/graceful/reload, I hope this info may be of some use.-reply by Robinson Share this post Link to post Share on other sites