部署Nginxhtml
操做系統CentOS 7.2nginx
1.安裝epel庫vim
$ yum install epel-release -y
2.安裝nginx瀏覽器
$ yum -y install nginx
3.啓動nginxyii
$ systemctl start nginx.service
4.在瀏覽器中訪問雲主機,會訪問到ngnix的默認頁面,默認頁面中指明瞭默認頁面和配置文件的位置。網站
5.建立網站的根目錄,沿襲Apache默認的根目錄spa
$ mkdir -p /var/www/rainyii.club/public_html
6.建立index文件操作系統
7.添加虛擬主機配置文件rest
$ vim /etc/nginx/conf.d/vitual.conf
8.添加如下代碼code
server{ listen 80; server_name rainyii.club; root /var/www/rainyii.club/public_html; index index.html; }
9.檢查配置文件是否正常
$ nginx -t
10.重啓nginx
$ systemctl restart nginx