./configure --PRefix=/usr/local/libxml2makemake install
失败的话执行 make clean,再重复上述操作
-下载php ..../configure --prefix=/usr/local/php --with-MySQL=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2makemake install
也可以使用yum安装软件包:
yum list | grep xxxyum install -y libpng-devel libjpeg-devel freetype-devel libmcrypt-devel ..../configure --prefix=/usr/local/php5.6 --with-config-file-path=/usr/local/php5.6/etc --enable-fpm --with-libxml-dir=/usr/local/libxml2 --with-png-dir --with-jpeg-dir --with-freetype-dir --with-gd --with-mcrypt --enable-soap --enable-mbstring=all --enable-sockets --with-mysqli=mysqlnd --with-pdo-mysql --enable-mysqlnd --with-zlib-dir=/usr/local/zlib --disable-fileinfo
#测试php-fpm配置/usr/local/php/sbin/php-fpm -t/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf -t#启动php-fpm/usr/local/php/sbin/php-fpm/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf#关闭php-fpmkill -INT `cat /usr/local/php/var/run/php-fpm.pid`#重启php-fpmkill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
Nginx需要依赖下面3个包
wget http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz./configure --prefix=/usr/local/zlibmake && make install
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz./configure --prefix=/usr/local/pcremake && make install
wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz./config --prefix=/usr/local/opensslmake && make install
groupadd -r nginx
/#创建系统工作组,系统工作组的组ID小于500
useradd -r -g nginx -s /bin/false -M nginx
/#-r 建立系统帐号/#-g<群组> 指定用户所属的群组/#-s<shell> 指定用户登入后所使用的shell,"/bin/false"su不到该用户/#-M 不自动建立用户的登入目录
wget http://nginx.org/download/nginx-1.9.9.tar.gz./configure --sbin-path=/usr/local/nginx/ --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module --with-pcre=/home/install/pcre-8.38 --with-zlib=/home/install/zlib-1.2.8 --with-openssl=/home/install/openssl-1.0.2e --with-http_stub_status_module --user=nginx --group=nginx
--with-zlib 和 --with-openssl --with-openssl #指向解压的源码目录
--with-http_stub_status_module #启用nginx的NginxStatus功能,用来监控Nginx的当前状态:
location /nginx_status { # Turn on nginx stats stub_status on; # I do not need logs for stats access_log off; # Security: Only allow access from 192.168.1.100 IP # #allow 192.168.1.100; # Send rest of the world to /dev/null # #deny all; }
这段代码是加在默认的server里的, 假设默认server的配置为 listen 127.0.0.1:80; server_name 127.0.0.1; 那么访问nginx的状态,就可以通过 curl 127.0.0.1/nginx_status访问了 返回结果类似于: Active connections: 1 server accepts handled requests 655 655 1985 Reading: 0 Writing: 1 Waiting: 0
新闻热点
疑难解答