Recently I am trying to learn managing nginx web server. Most probably it is going to take the place of Apache or at least seat beside Apache. The main benefit Nginx is claimed to be low memory footprint.
So far I have configured three VPS with nginx (also mysql & php). But every time I felt uneasy to start and stop the service as it can’t be started or stopped as ordinary service call.
To start apache/httpd we write:
service httpd start
But to start Nginx we have to write:
[I assume that Nginx is installed in default directory]
Again to stop apache, we write:
service httpd stop
But in case of Nginx:
kill -9 `cat /usr/local/nginx/logs/nginx.pid`
killall -9 nginx
Today I thought to make it a bit easier. So after mining the internet, I have made a small script to take care of start, stop, restart and check the status of Nginx. I am new to shell scripting.
How to implement it?
I expect your Nginx installation is completed successfully and you can start/stop the server using the earlier methods.
Last two days, I am playing or learning to play with nginx web server. I have heard some reputation about it and saw some performance chart in the web. I liked it for its, as claimed, extremely low memory footprint for one of my small VPS.
After reading some tutorial in Projanmo Forum, I am successfully configured nginx, with with fastcgi, php-fpm, mysql etc. When I visit the website, I found some problems. Some section were not working. Later I found, where I used $_SERVER['PHP_SELF'] were not not working. Later investigating the phpinfo(); I have seen that some global php variables are empty. I found nothing on net. Later alamgir bro, helped to sort out. In fact the whole tutorial is contributed by him.
Solving this issue is real easy. Just add the following the in your nginx php configuration section.
The changed codes may look like: [copied directly from his mail]