SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need to restart apache

    Hi,

    I want to restart apache using ssh. How can I get the apache path (can i get it from php.ini) and what are the things I need to do in order to restart apache.

    Do I need to go to apache/bin and run the command?

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,191
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Apache controls PHP not the other way around, to restart Apache simply do the following...

    1. Open Putty or your SSH software
    2. Log into your server using your server IP address and SSH login details
    3. Type the following command into the terminal window and hit enter
      /etc/init.d/httpd restart

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,067
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    It depends on the platform, but on most servers the command SgtLegend provided will work

    On others (e.g. debian) you might need
    Code:
    /etc/init.d/apache2 restart
    or

    Code:
    apachectl restart
    And instead of "restart" you can also use "graceful", which also restarts Apache without actually shutting it down, but just reloading the config, so you don't have any downtime.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  4. #4
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    if it's apache2, Scallio, it'll actually probably be 'apache2ctl restart'

  5. #5
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,067
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by StarLion View Post
    if it's apache2, Scallio, it'll actually probably be 'apache2ctl restart'
    Oddly, I've also seen servers with apachectl for Apache 2, but yeah, most servers probably have apache2ctl
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  6. #6
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •