LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2010, 05:22 AM   #1
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Rep: Reputation: 15
Command for restarting Apache?


guys,

i know it's a very simple command to restart apache via ssh. can anyone help please?

Thanks.
 
Old 06-14-2010, 05:26 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by chetanmadaan View Post
guys,

i know it's a very simple command to restart apache via ssh. can anyone help please?

Thanks.
many ways...depends how it is installed (source or package install)...
Which distro??

Code:
service httpd restart

--


Code:
apachectl restart
--

Code:
/etc/init.d/httpd restart
 
Old 06-14-2010, 05:35 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,272

Rep: Reputation: 148Reputation: 148
First of all you didn't specify which distro you are using, as centosboy mentioned, /etc/init.d startup scripts are based on Linux system if you are using Unix based system(solaris9 or more)you will have to use smf (system management facility). In Unix also having /etc/init.d startup script but smf may be easy

Last edited by kirukan; 06-14-2010 at 07:21 AM.
 
Old 06-14-2010, 05:39 AM   #4
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by centosboy View Post
many ways...depends how it is installed (source or package install)...
Which distro??

Code:
service httpd restart

--


Code:
apachectl restart
--

Code:
/etc/init.d/httpd restart
I am sorry but none out of these worked.


strange: when i type just HTTP in root. i get a different path for apache.

/usr/local/apache/bin/httpd for usage.
i also tried /usr/local/apache/bin/httpd restart but didn't worked.
 
Old 06-14-2010, 05:49 AM   #5
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 394

Rep: Reputation: 61
As others have asked, which distribution are you using? It's going to be very hard to help you if you don't supply required information.
 
Old 06-14-2010, 05:50 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
In that case use
Code:
/usr/local/apache/bin/apachectl restart
 
Old 06-14-2010, 05:55 AM   #7
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by chetanmadaan View Post
I am sorry but none out of these worked.


strange: when i type just HTTP in root. i get a different path for apache.

/usr/local/apache/bin/httpd for usage.
i also tried /usr/local/apache/bin/httpd restart but didn't worked.
didnt work??

paste the command used AND the output
 
Old 06-14-2010, 05:59 AM   #8
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by centosboy View Post
didnt work??

paste the command used AND the output
Last login: Mon Jun 14 02:53:39 2010
nexudf@ip-173-201-26-125 [~]# su -
Password:
root@ip-173-201-26-125 [~]# /usr/local/apache/bin/apachectl restart
root@ip-173-201-26-125 [~]#
 
Old 06-14-2010, 06:06 AM   #9
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by chetanmadaan View Post
Last login: Mon Jun 14 02:53:39 2010
nexudf@ip-173-201-26-125 [~]# su -
Password:
root@ip-173-201-26-125 [~]# /usr/local/apache/bin/apachectl restart
root@ip-173-201-26-125 [~]#

lol...how do you know this didnt work??

what did the error log tell you?? By default at /var/log/httpd/access_log
 
Old 06-14-2010, 06:45 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,520

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
oot@ip-173-201-26-125 [~]# /usr/local/apache/bin/apachectl restart
root@ip-173-201-26-125 [~]#
So the above command exited without errors. That means that apache was restarted.
You can verify it reading error_log as already centosboy mentioned above.

Regards
 
Old 06-14-2010, 06:47 AM   #11
shijuhcl
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
/etc/init.d/httpd restart
 
Old 06-14-2010, 06:56 AM   #12
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by shijuhcl View Post
/etc/init.d/httpd restart

already suggested in post #2
 
  


Reply


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
Error during restarting apache your_shadow03 Linux - Newbie 2 04-14-2010 10:43 PM
Apache keeps restarting and slows down breadfan311 Linux - Server 0 05-06-2008 04:01 AM
problem restarting apache merrsh1 Debian 3 06-04-2007 07:44 AM
Restarting apache fof3 Linux - Newbie 2 07-22-2006 11:01 PM
restarting Apache Xiled Linux - Networking 7 10-09-2001 11:24 AM


All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration