Tagged: NGINX Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 11:51 am on April 8, 2017 Permalink | Reply
    Tags: , NGINX   

    Categories: Linux, Windows ( 95 )

    How to check which web server is running on a domain 

    Sometimes we must know what web server is running on a particular domain. Usually web hosts should be able to tell a client this, but if the client is afraid to ask, there is a way to ask the web server directly for this information.

    Just to clarify: the web server is the process that serves files (HTML, PHP, ASP, images, etc) from a remote machine to your local web browser. The most likely choices in this day and age (2017) are Apache, NGINX or IIS. The latter is used by Windows servers, and the two former are used by Linux servers. There are other web servers too, such as lighttpd, but they’re used less commonly.

    By asking the web server for this information, we can tell exactly who’s serving those files.

    How to ask the Web Server

    Let’s open a Terminal or Command Line Prompt window and utilise the good old fashioned Telnet protocol. Replace yourserver.com with the actual domain in question: (More …)





     
  • Jay Versluis 8:24 am on April 21, 2015 Permalink | Reply
    Tags: , , NGINX   

    Categories: Plesk ( 70 )

    How to fix Apache/NGINX trouble after restarting your Plesk server 

    Plesk-LogoSome of my servers have a weird habit of throwing an Apache error after a restart: NGINX is running fine, but Apache can’t start and all websites are down. I have no idea why some servers do it and some do not. But when they do, it’s just plain annoying.

    Here are two ways to fix this problem.

    Restart Apache gracefully

    The quickest option is to shutdown NGINX, restart Apache, tell it to shutdown gracefully and then bring up NGINX again. Here are the commands that will work on CentOS 7:

    systemctl stop nginx.service
    systemctl restart httpd.service
    apachectl graceful
    systemctl restart nginx.service
    

    Likewise, on CentOS 6 we can use the service command to do the same:

    service nginx stop
    service httpd restart
    apachectl graceful
    service nginx restart
    

    Note that Apache doesn’t always like a restart – in which case, stop the service first, give it a moment and then restart it. Quirks and habits I guess.

    Thanks to Mike Yrabedra for this tip!

    If you find yourself doing this a lot, consider writing a quick script with the above commands, or restart your server less often (sometimes it’s enough to restart Plesk, or not reboot the machine at all). Alternatively, you can remove NGINX altogether and avoid such problems in the future.

    Removing NGINX from Plesk

    NGINX is not necessary – Apache will do a good job by itself. If you want to get rid of it completely, head over to Tools and Settings (or the Server Tab if you’re in Power User Mode) and select Updates and Upgrades. You’ll be taken to the Parallels Installer. Select Add/Remove Components.

    Screen Shot 2015-04-21 at 08.10.45

    Scroll down to the NGINX section under Web Hosting Features and untick both NGINX options. Now click Continue at the bottom and NGINX will be removed, leaving Apache in charge for all website connections. There’s no need to restart Plesk.

    Screen_Shot_2015-04-21_at_08_11_17

    Why would anyone want to use both NGINX and Apache together?

    Very good question indeed. Both are excellent web servers, and logic dictates that you should use one or the other. Using two web servers together is a certain sign of trouble.

    From what I understand, NGINX is not designed to be a replacement web server in Plesk (even though NGINX can be used in this way on a LAMP Stack). Instead it is implemented as an enhancement to Apache, sitting in front of it. Static files are therefore served from NGINX via Apache, and NGINX acts as a reverse proxy server.

    The benefits are faster connections and a smaller memory footprint. Read more about how NGINX and Apache are implemented in Plesk in the following articles:





     
    • Jay Versluis 10:18 pm on August 13, 2015 Permalink | Reply

      I’ve written a quick script that will work with CentOS 6 and CentOS 7 servers. Feel free to grab it from GitHub:

    • Jens 4:14 am on October 21, 2016 Permalink | Reply

      Awesome, it works! Thanks.

      • Jay Versluis 10:36 pm on October 21, 2016 Permalink | Reply

        Great to hear, Jens!

    • Dilip Kumar 12:36 pm on April 25, 2017 Permalink | Reply

      OMG… I thought there was error in the host, when the sites appear down after restart. Thanks buddy for helping, after restarting apache and nginx, sites are working now.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel