[email protected] +91-120-6025102

Avail Best discounts

Please fill in the form below and we will contact you within 24 hours.

Basic Commands Of Nginx

For those starting out with Nginx, there could be a few hurdles in the way of coming to grips with its basic commands and operations. There are a few things that you must know while working with this web server. This knowledge will certainly benefit you. Here is a review of a few basic manipulation commands to start, reload, stop, restart or check the health of your Nginx configuration.

The very first step is to know the basics of installing Nginx. Most web servers run on Ubuntu/Debian and Centos/RHEL which are all Linux distributions. You can install Nginx on Ubuntu/Debian with apt-get install nginx command. The process of installing on CentOS and RHEL is easy too but it is important to remember that on these two, you must install Nginx repo first.

If you are using init.d scripts such as service nginx start, you will discover that starting Nginx is really simple and hassle-free. If you use the script -service nginx stop - it will kill all Nginx processes and help you stop Nginx install. It may take some time for the kill process to be completed on busy servers. Killall 9 nginx is a command that can help accelerate the process and gives you an aggressive kill command. Similarly, a single line stop and restart can be initiated by using service nginx restart script.

Other basic commands of Nginx that you must know for smoother operation are reload and check Nginx configuration. Reload can be achieved by a simple command like service nginx reload. Check Nginx configuration is a useful command and can come handy while editing your Nginx configuration files. If there is an error in your Nginx configuration, this command will help you find out the exact line where the error is located.

You might also have to find out if Nginx is running. This can be found out by using the command service nginx status. By using advanced commands,you can see which Nginx processes are running presently, along with some other important information such as name of the user who runs the process, CPU and memory usage and more.

Service nginx upgrade is the command that you can run to restart Nginx after an upgrade. This command will ensure that Nginx is started with the new binaries along with the old version. It will also move the listening sockets to the new binary files and then shut down the old binaries which will ensure zero downtime upgrade.

Was this answer helpful? #4 #0

Related Questions

Submit Query

Please fill in the form below and we will contact you within 24 hours.