Centos 7에 nginx 1.8 설치

Centos 7에 nginx 1.8 설치

Centos 7에 nginx 1.8을 설치하려고 합니다. 다음 단계를 시도했습니다.

  1. nginx 저장소를 다음에서 설치합니다.http://nginx.org/en/linux_packages.html

    wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
    
  2. nginx 설치

    yum install nginx
    
  3. Nginx를 시작합니다:

    sudo systemctl start nginx
    

그러나 아무 일도 일어나지 않습니다. nginx가 시작되지 않습니다. Centos 6에서도 똑같은 단계가 잘 작동합니다.

출력은 다음과 같습니다 systemctl status nginx.

nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled)
   Active: inactive (dead) since Thu 2015-08-06 14:30:51 UTC; 21s ago
  Process: 29865 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 29776 (code=exited, status=0/SUCCESS)

Aug 06 13:31:12 vultr.guest systemd[1]: Failed to read PID from file /run/nginx.pid: Invalid argument
Aug 06 13:31:12 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 13:31:30 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 13:31:54 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 13:31:57 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 13:32:04 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 14:30:20 vultr.guest systemd[1]: Started The nginx HTTP and reverse proxy server.
Aug 06 14:30:51 vultr.guest systemd[1]: Stopping The nginx HTTP and reverse proxy server...
Aug 06 14:30:51 vultr.guest systemd[1]: Stopped The nginx HTTP and reverse proxy server.
Aug 06 14:30:56 vultr.guest systemd[1]: Stopped The nginx HTTP and reverse proxy server.

답변1

아래 명령을 시도해 보세요.

hostnamectl
hostnamectl set-hostname servername.domain.com
hostnamectl
systemctl restart sshd.service

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx
systemctl enable nginx.service
systemctl start nginx.service

systemctl stop httpd.service  or systemctl disable httpd
yum remove httpd
systemctl disable httpd.service

systemctl enable nginx.service
systemctl start nginx.service

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

http://서버IP주소/

관련 정보