国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
在fedora16下安裝nginx + php-fpm
在fedora16下安裝nginx + php-fpm
1、安裝Nginx
直接運行如下命令:
yum install nginx
然后我們創(chuàng)建系統(tǒng)啟動nginx的鏈接,并啟動它:
systemctl enable nginx.service
systemctl start nginx.service
在您的Web服務器的IP地址或主機到瀏覽器(如http://192.168.0.100),你應該看到nginx的歡迎頁面類型:
 
nginx-fedora
2、安裝PHP5
需要安裝一些列的模塊,輸入以下命令:
yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
然后打開的/etc/php.ini并設定cgi.fix_pathinfo = 0:
vi /etc/php.ini
[...]
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
cgi.fix_pathinfo=0
[...]
此外,以避免類似以下錯誤
[13-Nov-2011 22:13:16] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /usr/share/nginx/html/info.php on line 2
… /var/log/php-fpm/www-error.log 中,當你調用一個PHP腳本在您的瀏覽器,你應該在/etc/php.ini文件中設置date.timezone:
[...]
[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "Europe/Berlin"
[...]
你可以找到正確的時區(qū)為您的系統(tǒng),運行命令:
cat /etc/sysconfig/clock
[root@server1 ~]# cat /etc/sysconfig/clock
ZONE="Europe/Berlin"
[root@server1 ~]#
下一步創(chuàng)建系統(tǒng)啟動或者PHP-FPM并啟動它:
systemctl enable php-fpm.service
systemctl start php-fpm.service
PHP-FPM是一個守護進程運行FastCGI服務器的端口9000。
3、nginx設置
輸入命令:
vi /etc/nginx/nginx.conf
配置是很容易理解。
你可以再以下網(wǎng)址了解更多配置信息:
http://wiki.codemongers.com/NginxFullExample
http://wiki.codemongers.com/NginxFullExample2
按照以下配置設置值:
[...]
worker_processes 4;
[...]
keepalive_timeout 2;
[...]
虛擬主機是指在服務器{}容器。默認的虛擬主機是指在該文件 /etc/nginx/conf.d/default.conf -讓我們作如下修改:
[...]
server {
listen 80;
server_name _;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/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/html;
}
# 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$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
[...]
保存和重啟服務:
systemctl reload nginx.service
現(xiàn)在你可以建立一個探針文件進行測試
4、建立 PHP-FPM 使用一個 Unix Socket
vi /etc/php-fpm.d/www.conf
[...]
;listen = 127.0.0.1:9000
listen = /tmp/php5-fpm.sock
[...]
重啟PHP-FPM
systemctl restart php-fpm.service
配置文件:
vi /etc/nginx/conf.d/default.conf
配置內容如下:
[...]
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
[...]
重啟Nginx:
systemctl reload nginx.service
文章參考:
" nginx: http://fedoraproject.org/
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
centos6安裝nginx+mysql+php
yum安裝nginx-mysql-php-fastcgi構建LNMP服務器
brew安裝Nginx
lnmp環(huán)境快速搭建及原理解析
實現(xiàn)動靜分離的LNMMP網(wǎng)站架構
RHEL / CentOS 7 安裝 Nginx, MySQL, PHP (LEMP) | Linux 技術手札
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服