Home > Backend Development > PHP Tutorial > ubuntu installation nginx one

ubuntu installation nginx one

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:05:54
Original
1005 people have browsed it

Recently, I feel like I haven’t been exposed to lnmp development environment setup, configuration, etc. for a long time. As a result, sometimes I can’t remember when using it, so I configure the configuration environment separately and practice
I first tried to install it with apt-get install nginx, but a very strange error occurred, causing apt-get remove nginx to also fail. Finally, I passed

find / -name '*nginx*' | xargs rm -rf

Deleted all the nginx files, but the reinstallation still failed. I temporarily gave up the apt-get installation method and used 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

when I An error occurred during startup

<code>Starting nginx: nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>)
nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>)
nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>)
nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>)
nginx: [emerg] bind() <span>to</span><span>0.0</span><span>.0</span><span>.0</span>:<span>80</span> failed (<span>98</span>: Address already <span>in</span><span>use</span>)
nginx: [emerg] still could <span>not</span> bind()</code>
Copy after login

It may be because the previous apt-get installation failed, or other programs occupy this port. Kill the program occupying this port

sudo fuser -k 80/tcp

Restart , no problem

/etc/init.d/nginx

But when I run /etc/init.d/nginx stop, something goes wrong again, invalid stop. I am very confused, how to stop nginx? I just use this

killall -9 nginx

and it’s done. When starting, just /etc/init.d/nginx and it’s ok. When stopping, just killall -9 nginx

Then the browser runs localhost: 80 Done

ubuntu 安装 nginx一

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the installation of nginx on ubuntu, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Error restarting nginx
From 1970-01-01 08:00:00
0
0
0
server - Nginx configuration webapp problem
From 1970-01-01 08:00:00
0
0
0
Nginx default.conf problem
From 1970-01-01 08:00:00
0
0
0
centos7 - NGINX exception occurs
From 1970-01-01 08:00:00
0
0
0
nginx load balancing
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template