日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

centos6.3 nginx php,CentOS 6.3下nginx、php-fpm、drupal快速部署

發布時間:2025/3/8 php 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos6.3 nginx php,CentOS 6.3下nginx、php-fpm、drupal快速部署 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一切本著從簡原則來做,能yum/rpm的,堅決不手工編譯 :)

本次部署環境基于CentOS 6.3 x86_64系統。

0. 準備工作#更新yum[root@imysql?~]#?yum?-y?update[root@imysql?~]#?yum?install?libaio-devel.x86_64#drupal?8.0需要用到curl模塊[root@imysql?~]#?yum?install?curl-devel[root@imysql?~]#?yum?-y?install?libpng-devel?libjpeg-devel?freetype-devel?gmp-devel?libxml2-devel

1. 安裝nginx#安裝nginx官方yum源包[root@imysql?~]#?rpm?-ivh?http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm[root@imysql?~]#?yum?-y?install?nginx[root@imysql?~]#?chkconfig?nginx?on

2. 安裝php-fpm#安裝php?yum源包[root@imysql?~]#?rpm?-ivh?rpm?-Uvh?http://repo.webtatic.com/yum/el6/latest.rpm[root@imysql?~]#?yum?-y?install?php54w

3. 配置nginx+php

/etc/nginx/nginx.conf 配置文件可以不用做任何修改。

編輯 /etc/nginx/conf.d/default.conf,以本站為例,配置文件如下:server?{????listen???????80;????server_name??imysql.com?*.imysql.com;????root???/data/www/imysql.cn/;????index?index.php?index.htm?index.html?index.shtml;????error_page??404???????????????/page_not_found;????error_page???500?502?503?504??/page_not_found;????location?~?/\.ht?{????????deny??all;????}????if?($fastcgi_script_name?~?\..*\/.*php)?{????????return?403;????}????location?/?{????????if?(!-e?$request_filename)?{????????????rewrite?^/(.*)$?/index.php?q=$1?last;????????}????}????location?~?\.php$?{????????fastcgi_pass???127.0.0.1:9000;????????fastcgi_index??index.php;????????fastcgi_param??SCRIPT_FILENAME??$document_root$fastcgi_script_name;????????include????????fastcgi_params;????}????location?~?.*\.(gif|jpg|jpeg|png|bmp|swf)$?{????????expires?30d;????}????location?~?.*\.(js|css)?$?{????????expires?1h;????}????location?^~?/sites/default/files/imagecache/?{????????index?index.php?index.html;????????if?(!-e?$request_filename)?{????????????rewrite?^/(.*)$?/index.php?q=$1?last;?break;????????}????}}

上述配置包括了nginx虛擬主機的配置,以及drupal的rewrite規則配置,簡單快速。

4. 啟動測試

每次修改完配置文件后,都記得執行下面的命令測試配置文件正確性:[root@imysql?~]#?/etc/init.d/nginx?configtestnginx:?the?configuration?file?/etc/nginx/nginx.conf?syntax?is?oknginx:?configuration?file?/etc/nginx/nginx.conf?test?is?successful

確認配置文件無誤后,執行下面的命令重載nginx,使其生效:[root@imysql?~]#?/etc/init.d/nginx?reload#或者restart[root@imysql?~]#?/etc/init.d/nginx?restart

大功告成 )

總結

以上是生活随笔為你收集整理的centos6.3 nginx php,CentOS 6.3下nginx、php-fpm、drupal快速部署的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。