上回咱申请了一个服务器,这回我们来给部署起来用html
因为我们申请的服务器是linux系统,一般是使用ssh远程链接上去经过命令行界面管理.此处推荐使用xshell.node
百度网盘 >>linux
安装过程不赘述.想来都能本身看懂nginx
Nginx:一个实现http服务的工具shell
须要在命令行界面执行如下命令:
一行一行输入,输入完以后记得按回车,并等待动做完成.
期间若是命令行弹出什么东西须要确认直接确认便可浏览器
apt update apt install -y nginx
将nginx的配置文件拉到本地修改
该文件在服务器的这个位置: /etc/nginx/nginx.conf服务器
user root; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; server { listen 80; location / { root /home/www/; index index.html; } } }
输入命令:app
systemctl restart nginx
若是像我同样,没有任何报错多余信息输出的话,说明nginx启动成功:
ssh
随便打开一个浏览器,输入服务器的ip便可访问
tcp