HOME | LINUX | CISCO NETWORKING |   
PosgreSQL | Nginx | MariaDB | Bash Shell | GlusterFS | XEN | Cluster | VIM | Iptables | Nagios | Qmail  


Nginx 설치하기
nginx with php, pgsql
Original Site : http://www.if-not-true-then-false.com/2011/install-nginx-php-fpm-on-fedora-centos-red-hat-rhel/comment-page-2/
1. Fedora 19/20/21 용 저장소 인스톨

 # Fedora 19/20/21에서 사용할 rpm 
 rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
 rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
  
 # Fedora 21 용
 rpm -Uvh http://rpms.famillecollet.com/remi-release-21.rpm
  
 # Fedora 20 용
 rpm -Uvh http://rpms.famillecollet.com/remi-release-20.rpm
  
 # Fedora 19 용 
 rpm -Uvh http://rpms.famillecollet.com/remi-release-19.rpm

 
1. CentOS 5/6/7 용 저장소 설치하기

 # CentOS 7과  Red Hat (RHEL) 7용 설치 
 rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
  
 # CentOS 7 and Red Hat (RHEL) 7 용 
 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
  
  
 # CentOS 6 and Red Hat (RHEL) 6 용 
 rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
  
 # CentOS 6 and Red Hat (RHEL) 6 용 
 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  
  
 # CentOS 5 and Red Hat (RHEL) 5 용 
 rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  
 # CentOS 5 and Red Hat (RHEL) 5 용 
 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
 
 
2. CentOS 5.11/6.6/7용 Nginx 저장소
/etc/yum.repos.d/nginx.repo 파일에 저장

 [nginx]
 name=nginx repo
 baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
 gpgcheck=0
 enabled=1  

 
2. Red Hat (RHEL) 7/6.6/5.11용 Nginx 저장소

 [nginx]
 name=nginx repo
 baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
 gpgcheck=0
 enabled=1

 
3. Nginx, PHP 5.6.6 and PHP-FPM 설치하기 (Fedora 21)

  yum --enablerepo=remi install nginx php-fpm php-common
 
 
3. Nginx, PHP 5.6.6 and PHP-FPM 설치하기 (Fedora 19/20)

 yum --enablerepo=remi,remi-php56 install nginx php-fpm php-common
 
 
3. CentOS 7/6.6/5.11 and Red Hat (RHEL) 7/6.6/5.11 설치하기
 
 yum --enablerepo=remi,remi-php56 install nginx php-fpm php-common

 
4. PHP 5.6.6 모듈 설치 (Fedora 21)
List : OPcache (php-opcache) ? The Zend OPcache provides faster PHP execution through opcode caching and optimization. APCu, CLI, PEAR, PDO, MySQL, PostgreSQL, SQLite, Memcache, GD, XML, MBString, MCrypt
 

  yum --enablerepo=remi install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-pecl-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
 
4. PHP 5.6.6 모듈 설치 (Fedora 19/20)

 yum --enablerepo=remi,remi-php56 install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-pecl-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
 
 
4. PHP 5.6.6 모듈 설치 (CentOS 5/6/7 , RedHat 5/6/7)
 
 yum --enablerepo=remi,remi-php56 install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-pecl-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
 
 
5. Nginx and PHP-FPM 설정하기
  
 ## public_html directory and logs directory ##
 mkdir -p /home/drupal/www
 chown -R nobody:nobody /home/drupal 

 mkdir -p /home/drupal/www
 mkdir -p /var/log/nginx 
 chown -R nginx.nginx /var/log/nginx 
 
 
6. /etc/nginx 버추얼호스트 설정

 mkdir /etc/nginx/vhost/vhost.conf 
 
 # /etc/nginx/nginx.conf 에 아래내용을 추가하기 
 include /etc/nginx/vhost/*.conf;

 
7. 버추얼호스트 내용 생성
  
 server {
    server_name testsite.local;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    root /home/druapl/www;
 
    location / {
        index index.html index.htm index.php;
    }
 
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/testsite.local/public_html$fastcgi_script_name;
    }
 }
 
 
8. 데몬 재시작
 
 chkconfig --add nginx 
 chkconfig --add php-fpm
 chkconfig --level 2345 nginx on 
 chkconfig --level 2345 php-fpm on 

 service nginx restart 
 service php-fpm restart 

 


Home | Linux | Network | About Me |