Công cụ thành viên

Công cụ trang web


web_server:cai-dat-lemp-cho-centos7

Khác biệt

Đây là những khác biệt giữa hai phiên bản của trang.

Liên kết đến bản xem so sánh này

Phiên bản trước của cả hai bênPhiên bản trước
Phiên bản sau
Phiên bản trước
web_server:cai-dat-lemp-cho-centos7 [2016/08/01 18:51] vuthaoweb_server:cai-dat-lemp-cho-centos7 [2018/06/01 09:23] (hiện tại) – [Cấu hình rewite] hoaquynhtim99
Dòng 40: Dòng 40:
  
 <code> <code>
-yum --enablerepo=remi,remi-php56 install nginx php-fpm php-mysql php-common php-mbstring php-mcrypt php-gd -y+yum --enablerepo=remi,remi-php56 install nginx php-fpm php-mysql php-common php-mbstring php-mcrypt php-gd php-xml php-zip php-memcached php-opcache -y
 </code> </code>
  
Dòng 63: Dòng 63:
 Nếu dùng firewalld Nếu dùng firewalld
 <code> <code>
-firewall-cmd --reload 
 firewall-cmd --permanent --zone=public --add-port=80/tcp firewall-cmd --permanent --zone=public --add-port=80/tcp
 +firewall-cmd --reload
 </code> </code>
  
Dòng 104: Dòng 104:
 Sửa thành Sửa thành
 <code> <code>
-    location / { 
         root   /usr/share/nginx/html;         root   /usr/share/nginx/html;
         index  index.html index.php index.htm;         index  index.html index.php index.htm;
-    } 
 </code> </code>
  
Dòng 125: Dòng 123:
 <code> <code>
     location ~ \.php$ {     location ~ \.php$ {
-        root           /usr/share/nginx/html; 
         fastcgi_pass   127.0.0.1:9000;         fastcgi_pass   127.0.0.1:9000;
         fastcgi_index  index.php;         fastcgi_index  index.php;
Dòng 131: Dòng 128:
         include        fastcgi_params;         include        fastcgi_params;
     }     }
 +</code>
 +
 +Chạy đoạn code sau để sửa lỗi session
 +<code>
 +sed -i 's/php_value\[session.save_handler\]/;php_value\[session.save_handler\]/g' /etc/php-fpm.d/www.conf
 +sed -i 's/php_value\[session.save_path\]/;php_value\[session.save_path\]/g' /etc/php-fpm.d/www.conf
 +sed -i 's/php_value\[soap.wsdl_cache_dir\]/;php_value\[soap.wsdl_cache_dir\]/g' /etc/php-fpm.d/www.conf
 +sed -i 's/;session.save_path = \"\/tmp\"/session.save_path = \"\/tmp\"/g' /etc/php.ini 
 </code> </code>
  
 Khởi động lại PHP-FPM Khởi động lại PHP-FPM
 <code> <code>
-service php-fpm restart+systemctl restart nginx 
 +systemctl restart php-fpm
 </code> </code>
  
Dòng 243: Dòng 249:
 yum install wget unzip yum install wget unzip
 cd /root/ cd /root/
-wget https://github.com/nukeviet/nukeviet/archive/develop.zip +wget https://github.com/nukeviet/nukeviet/releases/download/4.0.29/nukeviet4.0official-setup.zip 
-unzip develop.zip  +unzip nukeviet4.0official-setup.zip 
-mv nukeviet-develop/* /usr/share/nginx/html/+mv ./nukeviet/* /usr/share/nginx/html/
 chown -R nginx:nginx /usr/share/nginx/html/ chown -R nginx:nginx /usr/share/nginx/html/
 rm -f /usr/share/nginx/html/index.html rm -f /usr/share/nginx/html/index.html
Dòng 258: Dòng 264:
 <code> <code>
     location ~ \.php$ {     location ~ \.php$ {
-        root           /usr/share/nginx/html; 
         fastcgi_pass   127.0.0.1:9000;         fastcgi_pass   127.0.0.1:9000;
         fastcgi_index  index.php;         fastcgi_index  index.php;
Dòng 270: Dòng 275:
  if ($request_filename ~ /robots.txt$){  if ($request_filename ~ /robots.txt$){
  rewrite ^(.*)$ /robots.php?action=$http_host break;  rewrite ^(.*)$ /robots.php?action=$http_host break;
- } + } 
 + 
 +        # Thiết lập rewrite chỉ có từ NukeViet 4.3.00 
 + rewrite ^/install/check\.rewrite$ /install/rewrite.php break;
  
  rewrite ^/(.*?)sitemap\.xml$ /index.php?nv=SitemapIndex break;  rewrite ^/(.*?)sitemap\.xml$ /index.php?nv=SitemapIndex break;
web_server/cai-dat-lemp-cho-centos7.1470052280.txt.gz · Sửa đổi lần cuối: 2016/08/01 18:51 bởi vuthao