lnmp 환경 구축 (nginx 부하 설정)
yum install yum-priorities -y
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
yum install nginx
systemctl start nginx.service # nginx
systemctl stop nginx.service #
systemctl restart nginx.service #
systemctl enable nginx.service #
2. nginx 포트 번호 변경 (자신의 요구 에 따라)
cd /etc/nginx/conf.d/
vim default.conf
listen 80 listen 81
systemctl restart nginx.service # nginx
3. 방문http://ip:81nginx 홈 페이지 를 볼 수 있 습 니 다.
4. 다음 설치 php - fpm
yum install php-fpm
systemctl start php-fpm.service # php-fpm
systemctl enable php-fpm.service #
5. nginx 프로필 인식 php 변경
vi / etc / nginx / conf. d / default. conf, 이전 \ # 를 제거 하면 됩 니 다.param
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$fastcgi_script_name; //
include fastcgi_params;
}
6. / usr / share / nginx / html 에 test. php 를 새로 만 듭 니 다.
방문 하 다.http://ip:81/test.phpnginx 의 phop 페이지 를 볼 수 있 습 니 다.
7. 부하 설정
upstream site{
server 172.16.170.138;
server 172.16.170.139;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
proxy_pass http://site;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.