: This article describes how to install nginx on ubuntu. if you are interested in the PHP Tutorial, refer to it. Recently, I feel that I have not been in touch with the lnmp development environment to build, configure, and so on. as a result, sometimes I cannot remember how to use the environment, so I configure the environment separately.
I tried to install apt-get install nginx first, but a strange error occurred, causing apt-get remove nginx to fail.
find / -name '*nginx*' | xargs rm -rf
Delete all the nginx files, but re-installing the nginx still fails. temporarily abandon the apt-get installation method, and use the source code method.
su
cd /usr/local/src
wget http://nginx.org/download/nginx-1.9.6.tar.gz
tar -zxvf nginx-1.9.6.tar.gz
cd nginx-1.9.6
./configure --prefix=/usr/local/nginx
make
make install
ln -s /usr/local/nginx/sbinb/nginx /etc/init.d
An error occurred when I started it.
Starting nginx: nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already inuse)nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already inuse)nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already inuse)nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already inuse)nginx: [emerg] bind() to0.0.0.0:80 failed (98: Address already inuse)nginx: [emerg] still could not bind()
It may be because apt-get fails to be installed, or other programs occupy the port and kill the program that occupies the port.
sudo fuser -k 80/tcp
Restart. No problem
/etc/init.d/nginx
But when I run/etc/init.d/nginx stopAn error occurred again. invalid stop. I am wondering how to stop nginx. I just used this.
killall -9 nginx
You can do it directly at startup./etc/init.d/nginxOK.killall -9 nginx
Then run localhost: 80 in the browser.
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above section describes how to install nginx on ubuntu, including some content. I hope my friends who are interested in the PHP Tutorial can help me.