版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yitengtongweishi/article/details/82150685
blockchain@ThinkPad-T460:~$ sudo add-apt-repository ppa:nginx/stable
blockchain@ThinkPad-T460:~$ sudo apt-get update
blockchain@ThinkPad-T460:~$ sudo apt-get install software-properties-common
blockchain@ThinkPad-T460:~$ sudo apt-get install nginx
查看 nginx 版本
blockchain@ThinkPad-T460:~$ nginx -v
nginx version: nginx/1.12.2
blockchain@ThinkPad-T460:~$
启动 nginx
blockchain@ThinkPad-T460:~$ sudo /etc/init.d/nginx start
start: Job is already running: nginx
blockchain@ThinkPad-T460:~$
blockchain@ThinkPad-T460:~$ ps -ef | grep nginx
root 15943 1 0 15:39 ? 00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 15945 15943 0 15:39 ? 00:00:00 nginx: worker process
www-data 15946 15943 0 15:39 ? 00:00:00 nginx: worker process
www-data 15947 15943 0 15:39 ? 00:00:00 nginx: worker process
www-data 15948 15943 0 15:39 ? 00:00:00 nginx: worker process
blockch+ 16003 2577 0 15:51 pts/1 00:00:00 grep --color=auto nginx
然后访问 http://localhost/ ,出现如下页面,表明一切正常。