美文网首页
Debian下手动安装LiteSpeed+PHP+MySQL教程

Debian下手动安装LiteSpeed+PHP+MySQL教程

作者: 7f4cf71ba8f6 | 来源:发表于2018-10-22 02:23 被阅读32次

    Debian系统是Linux分枝,最小化的系统占用系统资源异常的少,而且操作起来也很简单。

    下面是llsmp一键部署包步骤

    1.整理Debian,去除不用要的软体包

    2.部署MySQL及相关的库文件

    3.部署LiteSpeed

    4.编译PHP

    5.配置eAccelerator

    6.部署Zend Loader

    1.整理Debian,去除不用要的软体包

    apt-get update

    apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin

    apt-get -y purge lynx memtester unixodbc python-* odbcinst-* sudo tcpdump ttf-*

    apt-get autoremove && apt-get clean

    2.部署MySQL及相关的库文件

    apt-get remove apache

    apt-get update

    apt-get install autoconf gcc g++ libjpeg62-dev libpng12-dev libxml2-dev curl libcurl4-openssl-dev libmcrypt-dev libmhash-dev libfreetype6-dev patch make mcrypt mysql-server libmysql++-dev zlib-bin zlib1g-dev

    apt-get update && apt-get upgrade

    export PHP_AUTOCONF=/usr/bin/autoconf

    export PHP_AUTOHEADER=/usr/bin/autoheader

    部署时半途会查问MySQL的密钥,陆续输入两次便可

    3.部署LiteSpeed

    访问LiteSpeed官网博得最新版本的下载链接:http://litespeedtech.com/litespeed-web-server-downloads.html

    cd /tmp

    wget http://litespeedtech.com/packages/4.0/lsws-4.1.13-std-i386-linux.tar.gz

    tar zxvf lsws*

    cd lsws*

    cd ./install.sh

    出现批准协议,只需持续按下【空格】键到最后,输入Yes(注意Y大写)

    交互回复如次问题

    Destination [/usr/local/lsws]: 回车

    User name [admin]:管理员账号(原始admin)

    Password:管理员密钥

    Retype password:密钥确认

    Email addresses [root@localhost]:伏笔科技的email

    User [nobody]:原始,直接回车

    Group [nogroup]:原始,直接回车

    HTTP port [8088]:写80

    Admin HTTP port [7080]:Litespeed面板端口,可原始,直接Enter

    Setup up PHP [Y/n]:原始,直接回车

    Suffix for PHP script(comma separated list) [php]:原始,直接回车

    Would you like to install AWStats Add-on module [y/N]?原始,直接回车

    Would you like to have LiteSpeed Web Server started automatically when the server restarts [Y/n]?原始,直接回车

    Would you like to start it right now [Y/n]?原始,直接回车

    此刻不要关闭SSH窗口,后头还要用到~

    4.编译PHP

    访问litespeed管理后台:http://ip:7080

    点击Actions->Compile PHP

    挑选PHP版本,点击Next(我挑选的是5.3.15)

    在编译参数中填写为如次段,

    ’–with-pdo-mysql’ ’–with-mysql’ ’–with-mysqli’ ’–with-zlib’ ’–with-gd’ ’–enable-shmop’ ’–enable-track-vars’ ’–enable-sockets’ ’–enable-sysvsem’ ’–enable-sysvshm’ ’–enable-magic-quotes’ ’–enable-mbstring’ ’–with-iconv’ ’–with-litespeed’ ’–enable-inline-optimization’ ’–with-curl’ ’–with-curlwrappers’ ’–with-mcrypt’ ’–with-mhash’ ’–with-mime-magic’ ’–with-openssl’ ’–with-freetype-dir=/usr/lib’ ’–with-jpeg-dir=/usr/lib’

    小内存云主机在编译的时候,会出现内存不够的问题”virtual memory exhausted: Cannot allocate memory”,此刻在参数栏处再加个”?disable-fileinfo”,重新编译一下应当就OK了~

    下面可选部署组件,我只挑选了eAccelerator;

    点击Build PHP 5.x.x

    LiteSpeed开始下载包,下载完成后,点击Next

    此刻不要革新页面!

    在SSH启动如次command:

    /usr/local/lsws/phpbuild/buildphp_manual_run.sh

    直到浏览器提示“*Complete*”就算是大功告成了~

    5.配置eAccelerator

    PHP固然部署好了,但之前咱们挑选的eAccelerator还需要配置一下

    建立eAccelerator的缓存目录

    mkdir /usr/local/eaccelerator_cache

    chmod -R 777 /usr/local/eaccelerator_cache

    修改php.ini

    cp /usr/local/lsws/php/php.ini /usr/local/lsws/lsphp5/lib/

    vi /usr/local/lsws/lsphp5/lib/php.ini

    在php.ini后头进入如次字段

    [eaccelerator]

    zend_extension=”/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/eaccelerator.so”

    eaccelerator.shm_size=”1″

    eaccelerator.cache_dir=”/usr/local/eaccelerator_cache”

    eaccelerator.enable=”1″

    eaccelerator.optimizer=”1″

    eaccelerator.check_mtime=”1″

    eaccelerator.debug=”0″

    eaccelerator.filter=””

    eaccelerator.shm_max=”0″

    eaccelerator.shm_ttl=”3600″

    eaccelerator.shm_prune_period=”3600″

    eaccelerator.shm_only=”0″

    eaccelerator.compress=”1″

    eaccelerator.compress_level=”9″

    eaccelerator.keys = “disk_only”

    eaccelerator.sessions = “disk_only”

    eaccelerator.content = “disk_only”

    这时,能openhttp://ip/phpinfo.php看看eAccelerator部署的怎么样~

    6.部署Zend Loader

    wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz

    tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz

    mkdir -p /usr/local/zend/

    cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so /usr/local/zend/

    修改php.ini

    vi /usr/local/lsws/lsphp5/lib/php.ini

    增加如次字段

    [Zend.loader]

    zend_loader.enable=1

    zend_loader.disable_licensing=1

    zend_loader.obfuscation_level_support=3

    zend_loader.license_path=

    zend_extension=”/usr/local/zend/ZendGuardLoader.so“

    查看能否部署成功

    /usr/local/lsws/lsphp5/bin/php -v

    最后rebootlitespeed见效~

    /etc/init.d/lsws restart

    环境基本配置好了

    相关文章

      网友评论

          本文标题:Debian下手动安装LiteSpeed+PHP+MySQL教程

          本文链接:https://www.haomeiwen.com/subject/ylhwzftx.html