CentOS7 Nginx導入/起動の一括シェル
まずSuper Userとしてログインする。
su root
Nginxのデフォルトポートは80なので、一旦Apacheを停止
systemctl stop httpd
本番だ!一括シェル
cd /etc/yum.repos.d
git init
git remote add origin https://github.com/keiwt/nginx-repo.git
git pull origin master
yum -y install nginx
systemctl start nginx.service
systemctl enable nginx.service
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-service=ssh
firewall-cmd --reload
ip a
一個ずつ入れてもいいですけど、一括の方は楽だね。
最後、
http://{ip address}/
で確認できる。
0コメント