8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7でnginx入れたらハマったのでメモ

Last updated at Posted at 2016-05-07

環境

vagrant on mac

[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)

問題

sudo yum install nginx
sudo systemctl start nginx

nginxインストールして起動したが、ブラウザからnginxページを参照できない

解決

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload

firewall設定を変更したらブラウザからnginxページを参照できるようになった
via http://qiita.com/yanagikouta/items/6c2b0cbd02876e61c71c

ansible task

- name: Install epel
  sudo: yes
  yum: name=epel-release state=latest

- name: Install nginx
  sudo: yes
  yum: name=nginx state=latest

- name: Firewall
  sudo: yes
  firewalld: service=http permanent=true state=enabled immediate=true

- name: Start nginx
  sudo: yes
  service: name=nginx state=started enabled=yes

経緯

CentOS6で使っていたansibleをそのまま流したらハマった

8
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?