ubuntu 安装nginx

1,安装nginx

sudo apt-get install nginx

启动nginx
service nginx start  启动
service nginx stop   停止
service nginx reload   重启  
service nginx restart   重新开始
service nginx status   状态

也可以用另外的方法启动
systemctl start nginx
systemctl start nginx.service
systemctl stop nginx
systemctl reload nginx
systemctl restart nginx
systemctl status nginx

PS:自己测试报错,希望有人能解决,报错如下
System has not been booted with systemd as init system (PID 1). Can't operate.

2,启动nginx后

看下自己的端口,ifconfig拿到ip测试下

在htm5页面上输入自己的ip,端口默认是80
1,nginx默认开始页面只想 /var/www/html文件下的页面

 

posted @ 2018-11-23 17:11  forjie  阅读(5403)  评论(0编辑  收藏  举报