오늘: 13|어제: 19|전체: 234,382|회원: 118 (+0)|문서: 56,040 (+0)|댓글: 8,019 (+0)|첨부파일: 1,389 (+0)


조회 수 2153 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
Extra Form

Getting started

Add necessary repositories:

CentOS 5.x i386:

sudo rpm -ivh http://mirror.yandex.ru/epel/5/i386/epel-release-5-4.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

CentOS 5.x x86_64:
sudo rpm -ivh http://mirror.yandex.ru/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

CentOS 6.x i386:
sudo rpm -ivh http://mirror.yandex.ru/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

CentOS 6.x x86_64:
sudo rpm -ivh http://mirror.yandex.ru/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Create?/etc/yum.repos.d/nginx.repo?file and add:

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

Installing Nginx, PHP 5.3.10 and PHP-FPM

To install Nginx, PHP 5.3.10 and PHP-FPM run:

yum install nginx php php-fpm php-common

Install some PHP modules: PEAR (php-pear), PDO (php-pdo), MySQL (php-mysql), Memcache (php-pecl-memcache), Memcached (php-pecl-memcached), GD (php-gd), XML (php-xml), MBString (php-mbstring), MCrypt (php-mcrypt)

yum --enablerepo=remi install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

Enable Nginx and PHP-FPM. You can do it this way:

/etc/init.d/nginx start
/etc/init.d/php-fpm start

or this way:

service nginx start
service php-fpm start

To start Nginx on boot:

chkconfig --add nginx
chkconfig --levels 235 nginx on

To start PHP-FPM on boot:

chkconfig --add php-fpm
chkconfig --levels 235 php-fpm on

Configuring Nginx

Creating folders for our website and logs:

mkdir -p /home/web/www/howtounix.info/public_html
mkdir /home/web/www/howtounix.info/logs
chown -R nginx:nginx /home/web/www/howtounix.info

Create folders for virtual hosts:

mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled

Add to?/etc/nginx/nginx.conf?file after "include /etc/nginx/conf.d/*.conf":

include /etc/nginx/sites-enabled/*;

Add virtual host. In?/etc/nginx/sites-available/?directory create the file named as your website. In our case it's howtounix.info, add:

server {
    server_name howtounix.info;
    access_log /home/web/www/howtounix.info/logs/access.log;
    error_log /home/web/www/howtounix.info/logs/error.log;
    root /home/web/www/howtounix.info/public_html;

    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 /home/web/www/howtounix.info/public_html$fastcgi_script_name;
    }
}

Create a symlink to the virtual host and restart Nginx:

cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/howtounix.info

service nginx restart

Add the virtual host to?/etc/host?file:

127.0.0.1               localhost howtounix.info
It will be the same pattern for an external IP address.

Check on Nginx and PHP-FPM. Create?index.php?file in?/home/web/www/howtounix.info/public_html/?directory and add:

<?php 
    phpinfo();
?>

Navigate your website in a browser to check how it works.


List of Articles
글쓴이 분류 제목 조회 수
Luatic™ PHP 루아틱 CDN 사용하기 4 file 1403
Luatic™ XpressEngine 로그인풀림방지 - 주소 고정하기 file 2123
루아틱 Etc 돈한푼 안들이고 내 사이트 만들기 1탄 3 18382
Luatic™ XpressEngine 다올 버전별 업데이트 방법 file 1310
Luatic™ Etc 나라별 국가 코드 1 2292
Omega3 PHP 꺼두면 좋은 PHP Fuction 2 3274
merkava Etc 그룹웨어-그룹오피스 설치 file 1445
Luatic™ 그누보드 5 ? 서버 이전 후 글쓰기/댓글쓰기가 안될때 729
Luatic™ Etc 구글 검색엔진 최적화 매뉴얼 1601
Luatic™ Linux 갤럭시 S3 에 Ubuntu Linux 설치하기 (영문) 3 file 27813
루아틱 PHP 간단한 페이징 7 3083
Luatic™ MySQL XE에서 MariaDB 사용하는 방법 5 file 3064
하얀바나나 XpressEngine XE, 재설치를 했는데도 설정이 그대로 남아 있을 때! 685
루아틱 XpressEngine XE 인증메일을 Gmail로 보내는 법 2 4115
Luatic™ XpressEngine XE 엮인글 삭제 쿼리문 file 10125
Luatic™ XpressEngine XE 레이아웃 제작 실무 노하우 1 file 1141
Luatic™ PHP XE Cache 적용하기 file 16365
Luatic™ XpressEngine XE Admin help - 설치부터 관리까지 3 file 3052
Luatic™ XpressEngine XE 1.8 에서 짧은 주소(rewrite) 없다고 나올때 file 917
루아틱 Windows Windows 2003에서 IIS 6.0 설치(SSL 설정 2) 13482
Board Pagination ‹ Prev 1 2 3 4 5 6 Next ›
/ 6

처음