Nginx+Litespeed+PHP+MariaDB 编译基础 代码: yum -y install yum-fastestmirror yum -y update yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar yum -y install libtool libtool-libs kernel-devel autoconf213 glibc yum -y install libjpeg libjpeg-devel libpng libpng-devel libevent libevent-devel yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel geoip-devel yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel pcre-devel expat-devel yum -y install openssl openssl-devel vim-minimal unzip vixie-cron 完成后,我习惯yum clean all 清理一下,能多出一些空间来。 首先建立一个目录用于下载安装的文件吧。 代码: cd ../ mkdir llmp cd llmp/ 1.编译依赖库autoconf、libiconv等 代码: ##################编译libiconv-1.14################# wget -c http://mirrors.ustc.edu.cn/gnu/libiconv/libiconv-1.14.tar.gz tar xvfz libiconv-1.14.tar.gz cd /llmp/libiconv-1.14/srclib/ sed -i -e '/gets is a security/d' ./stdio.in.h cd ../ ./configure --prefix=/usr/local/libiconv make make install cd ../ 代码: #############编译Libmcrypt###################### wget -c http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2 tar xvfj libmcrypt-2.5.8.tar.bz2 cd libmcrypt-2.5.8 ./configure make make install /sbin/ldconfig export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH cd libltdl ./configure --enable-ltdl-install make make install cd ../../ 代码: ############编译mhash-0.9.9.9#################### wget -c http://ncu.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2 tar xvfj mhash-0.9.9.9.tar.bz2 cd mhash-0.9.9.9 ./configure make make install cd ../ 代码: ############编译Mcrypt########## wget -c http://ncu.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz tar zxvf mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8 ./configure make make install cd ../ 代码: ###################创建需要的符号链接############ ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4 ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8 ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2 ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1 ln -s /usr/local/lib/libltdl.a /usr/lib/libltdl.a ln -s /usr/local/lib/llibltdl.la /usr/lib/libltdl.la ln -s /usr/local/lib/libltdl.so /usr/lib/libltdl.so ln -s /usr/local/lib/libltdl.so.3 /usr/lib/libltdl.so.3 ln -s /usr/local/lib/libltdl.so.3.1.0 /usr/lib/libltdl.so.3.1.0
编译LiteSpeed 代码: ###################编译LiteSpeed############ wget -c http://www.litespeedtech.com/packages/4.0/lsws-4.2.7-std-i386-linux.tar.gz tar zxvf lsws-4.2.7-std-i386-linux.tar.gz cd lsws-4.2.7 ./install.sh cd ../ 出现--More--(27%)的许可协议,可以直接按空格键或者回车跳到最后. 接下来几步注意了: 1.Do you agree with above license?Yes 2.Destination [/usr/local/lsws]:设置根目录页,可以直接回车 3.User name [admin]:管理员名称,可以直接回车 4.Password:管理员密码 5.Retype password:重复密码 6.Email addresses [root@localhost]:邮箱 7.User [nobody]:回车 8.Group [nobody]:回车 9.HTTP port [8088]:回车,如果你只用Litespeed这里就设80,你如果用Nginx做前端,80就给Nginx用这里就要换一个端口,自己随便定个没有被占用的端口 10.Admin HTTP port [7080]:回车 11.Setup up PHP [Y/n]:千万要输Y 不然PHP打不开 12.Suffix for PHP script(comma separated list) [php ]:回车 13.Would you like to install AWStats Add-on module [y/N]?统计工具。用不用自定,我不用 14.when the server restarts [Y/n]?千万输Y 15.Would you like to start it right now [Y/n]?这个也是Y 安装后可以自动启动 完成后,请先别关SSH,稍后需要使用。现在就可以访问 IP:7080 来管理LiteSpeed.
编译PHP5.6.11 编辑 代码: /usr/local/lsws/admin/html/utility/build_php/buildconf.inc.php 加入对应版本后进入后台升级 进入Litespeed管理后台安装PHP(我选择了PHP Mail Header Patch+memcache+Zend OPcache) 代码: '--with-libxml-dir=/usr/include/libxml2' '--with-config-file-path=/usr/local/php/etc/' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-gd' '--enable-gd-native-ttf' '--with-zlib' '--with-mcrypt' '--with-pdo-mysql' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zip' '--with-xmlrpc' '--enable-fpm' '--enable-mbstring' '--with-zlib-dir' '--with-bz2' '--with-curl' '--enable-exif' '--enable-ftp' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-freetype-dir=/usr/lib' '--with-iconv' '--enable-xml' '--enable-bcmath' '--enable-sysvsem' '--enable-inline-optimization' '--without-pdo-sqlite' '--without-sqlite3' '--with-curlwrappers' '--enable-mbregex' '--with-openssl' '--enable-pcntl' '--with-gettext' '--enable-session' '--with-litespeed' '--disable-fileinfo' '--enable-opcache'
编译NGINX1.12.0 代码: wget -c http://sourceforge.net/projects/pcre/files/pcre/8.36/pcre-8.36.tar.gz wget -c http://nginx.org/download/nginx-1.12.0.tar.gz ###########编译 pcre 库############# tar xvfz pcre-8.36.tar.gz cd pcre-8.36/ ./configure make make install cd ../ ###############创建WEB专用用户####### groupadd www useradd -s /sbin/nologin -g www www mkdir -p /home/wwwroot chmod +w /home/wwwroot mkdir -p /home/wwwlogs chmod 777 /home/wwwlogs chown -R www:www /home/wwwroot ###########编译nginx############# tar xvfz nginx-1.12.0.tar.gz cd nginx-1.12.0/ ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 make make install cd ../ ##########拷贝配置文件到nginx##### /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/proxy.conf /usr/local/nginx/conf/servers/site.conf ######获取nginx自动启动脚本###### /etc/init.d/nginx chmod +x /etc/init.d/nginx #######添加为系统开机启动服务##### chkconfig --level 345 nginx on /etc/init.d/nginx start
[root@mk1 llmp]# /usr/local/lsws/admin/html.4.2.7/utility/build_php/buildconf.inc.php -bash: /usr/local/lsws/admin/html.4.2.7/utility/build_php/buildconf.inc.php: Permission denied