1、查看系统的codename
lsb_release -c
2、在 /etc/apt/sources.list 填加nginx软件源
deb http://extras.ubuntu.com/ubuntu codename main
deb-src http://extras.ubuntu.com/ubuntu codename main
deb http://nginx.org/packages/mainline/ubuntu/ codename nginx
deb-src http://nginx.org/packages/ubuntu/ codename nginx
3、下载并导入
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
4、更新apt-get源
sudo apt-get update
5、安装nginx
sudo apt-get install nginx
6、查看系统版本
cat /etc/issue
7、查看系统全部信息
uname -a
8、查看nginx版本
nginx -v
9、安装成功的检查
在浏览器中输入
localhost
10、成功的显示
Welcome to nginx!Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working.
Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com
Thank you for using nginx.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
华丽丽的结束分割线,喜欢nginx的朋友不要错过哦!