ubuntu 아래 LNMP 설치
ubuntu 에 nginx 서 비 스 를 설치 하 는 방법 에 대해 말씀 드 리 겠 습 니 다.
1. mysql 설치
  
  
  
  
   
   
   
   - sudo apt-get install mysql-server mysql-client 
 
  
  
  
  
  설치 과정 에서 루트 사용자 의 비밀 번 호 를 입력 해 야 합 니 다.
2. nginx 설치
  
  
  
  
   
   
   
   - sudo apt-get install nginx 
 
  
  
  
  
  3. 설치 완료 후.다음 nginx 서 비 스 를 다시 시작 합 니 다.
  
  
  
  
   
   
   
   - sudo service nginx restart 
 
  
  
  
  
  시작 한 후에 우 리 는 아래 의 우리 주 소 를 방문 할 수 있다.nginx 의 환영 인터페이스 가 나 올 수 있 는 지 확인 합 니 다.
4. 여기 서 우 리 는 php 5 - fpm 를 사용 하여 우리 의 php 로 해석 합 니 다.
  
  
  
  
   
   
   
   - sudo apt-get install php5-fpm 
 
  
  
  
  
  5. 이제 nginx 의 사이트 설정 을 수정 해 야 합 니 다.
ngnix 설정 파일 은 / etc / nginx / sites - avable / default 에 저 장 됩 니 다.
  
  
  
  
   
   
   
   - server { 
 
   
   
   
   -         listen   80; ## listen for ipv4; this line is default and implied 
 
   
   
   
   -         listen   [::]:80 default ipv6only=on; ## listen for ipv6 
 
   
   
   
   -         root /usr/share/nginx/www; 
 
   
   
   
   -         index index.php index.html index.htm; 
 
   
   
   
   -         # Make site accessible from http://localhost/ 
 
   
   
   
   -         server_name _; 
 
   
   
   
   -         location / { 
 
   
   
   
   -                 # First attempt to serve request as file, then 
 
   
   
   
   -                 # as directory, then fall back to index.html 
 
   
   
   
   -                 try_files $uri $uri/ /index.html; 
 
   
   
   
   -         } 
 
   
   
   
   -         location /doc { 
 
   
   
   
   -                 root /usr/share; 
 
   
   
   
   -                 autoindex on; 
 
   
   
   
   -                 allow 127.0.0.1; 
 
   
   
   
   -                 deny all; 
 
   
   
   
   -         } 
 
   
   
   
   -         #error_page 404 /404.html; 
 
   
   
   
   -         # redirect server error pages to the static page /50x.html 
 
   
   
   
   -         # 
 
   
   
   
   -         error_page 500 502 503 504 /50x.html; 
 
   
   
   
   -         location = /50x.html { 
 
   
   
   
   -                 root /usr/share/nginx/www; 
 
   
   
   
   -         } 
 
   
   
   
   -         # proxy the PHP scripts to Apache listening on 127.0.0.1:80 
 
   
   
   
   -         # 
 
   
   
   
   -         #location ~ \.php$ { 
 
   
   
   
   -         #       proxy_pass http://127.0.0.1; 
 
   
   
   
   -         #} 
 
   
   
   
   -         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
 
   
   
   
   -         # 
 
   
   
   
   -         location ~ \.php$ { 
 
   
   
   
   -                 try_files $uri =404; 
 
   
   
   
   -                 fastcgi_pass 127.0.0.1:9000; 
 
   
   
   
   -                 fastcgi_index index.php; 
 
   
   
   
   -                 include fastcgi_params; 
 
   
   
   
   -         } 
 
   
   
   
   -         # deny access to .htaccess files, if Apache's document root 
 
   
   
   
   -         # concurs with nginx's one 
 
   
   
   
   -         # 
 
   
   
   
   -         location ~ /\.ht { 
 
   
   
   
   -                 deny all; 
 
   
   
   
   -         } 
 
   
   
   
   - } 
 
  
  
  
  
  php 분석 코드 가 추가 되 었 습 니 다.
6. phop 5 와 관련 된 구성 요 소 를 설치 하고 있 습 니 다.
  
  
  
  
   
   
   
   - sudo apt-cache search php5 
 
  
  
  
  
  
  
  
  
  
   
   
   
   - apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl 
 
  
  
  
  
  7. 서비스 재 개
  
  
  
  
   
   
   
   - sudo service php5-fpm restart 
 
   
   
   
   - sudo service nginx 
 
  
  
  
  
  8. 프로 브 파일 을 써 보 세 요.허허...
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.