龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

CentOS 6 編譯安裝Nginx1.3.9+PHP5.4

2015.09.10 | 1849閱讀 | 0條評論 | 服務(wù)器配置

[1].安裝Nginx

1,添加一個不能登錄且沒有主目錄的用戶:


1 # useradd www -M -s /sbin/nologin


2,必要的組件


# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libtool-ltdl-devel pcre-devel


3,編譯nginx并安裝

# wget http://www.nginx.com.cn/download/nginx-1.3.9.tar.gz

# tar -zxvf nginx-1.3.9.tar.gz

# cd nginx-1.3.9

# ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module --with-http_ssl_module

# make 

# make install

[2].安裝PHP


1,安裝必要的組件


# yum -y install libjpeg-devel libpng-devel

# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz

# tar -zxvf libmcrypt-2.5.7.tar.gz

# cd libmcrypt-2.5.7

# ./configure

# make 

# make install


==64位系統(tǒng)==


1 # ln -s /usr/lib64/mysql/ /usr/lib/mysql


==64位系統(tǒng)==


2,編譯php并安裝

# wget http://cn2.php.net/get/php-5.4.13.tar.gz/from/this/mirror


# tar -zxvf php-5.4.13.tar.gz


# cd php-5.4.13



 #./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/lib--with-iconv --with-zlib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-mysql --with-mysqli --with-pdo-mysql --enable-ftp --with-jpeg-dir --with-freetype-dir --with-png-dir --enable-fpm --with-fpm-user=www --with-fpm-group=www


如果在32位機器上裝到時候可能會碰到checking size of char... configure: error: cannot compute sizeof (char)這個問題。需要去掉--disable-rpath


如果直接編譯出錯,執(zhí)行以下兩行在進行編譯

# mv configure configure.bak

# ./buildconf --force


#make 

#make install


3,拷貝和修改php配置文件


# cp php.ini-production /usr/local/php/lib/php.ini 或是/usr/local/lib/php.ini

 # cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

 # /usr/local/php/bin/php --ini //測試ini文件是否加載


修改php.ini


[PHP]

safe_mode = On

register_globals = Off

magic_quotes_gpc = Off

allow_url_fopen = Off

allow_url_include = Off

expose_php=Off

disable_functions = shell_exec,system,exec,passthru,show_source,curl_exec,curl_multi_exec,get_cfg_var

[Date]

date.timezone = "Asia/Shanghai"


修改php-fpm.conf


[global]

pid = run/php-fpm.pid

error_log = log/php-fpm.log

log_level = notice

emergency_restart_threshold = 0

emergency_restart_interval = 0

[www]

pm.max_children = 256

pm.start_servers = 20

pm.min_spare_servers = 5

pm.max_spare_servers = 256

pm.max_requests = 500


贊 (

發(fā)表評論

主站蜘蛛池模板: 久久亚洲精品人成综合网| 色噜噜狠狠狠狠色综合久一| 激情综合色五月丁香六月欧美| 久久亚洲欧洲国产综合| 精品国产综合区久久久久久| 综合久久一区二区三区| 天天综合久久久网| 综合网在线观看| 久久婷婷五月综合成人D啪| 亚洲国产综合专区在线电影| 色天使久久综合网天天| 国产人成精品综合欧美成人| 亚洲中文字幕无码久久综合网 | 日韩欧美在线综合网| 亚洲综合图色40p| 小说区 图片区色 综合区| 久久国产综合精品五月天| 欧美综合区自拍亚洲综合天堂| 亚洲综合色自拍一区| 精品综合久久久久久888蜜芽| 色狠狠久久综合网| 色婷婷综合缴情综免费观看| 亚洲综合色区在线观看| 国产色综合一区二区三区| 99久久国产综合精品五月天喷水| 国产天天综合永久精品日| 婷婷久久综合九色综合98| 亚洲AV人无码综合在线观看 | 婷婷五月综合缴情在线视频| 亚洲综合av永久无码精品一区二区| 久久综合狠狠综合久久激情 | 国产亚洲综合网曝门系列| 狠狠色综合网站久久久久久久高清| 色欲香天天综合网无码| 五月婷婷综合在线| 亚洲国产天堂久久综合网站| 色狠狠成人综合色| 欧美一区二区三区久久综合| 婷婷五月综合色视频| 久久综合九色综合网站| 国产精品 综合 第五页|