Debian系統(tǒng)一直是筆者和喜歡的Linux分枝,最小化的系統(tǒng)占用系統(tǒng)資源非常的少,而且操作起來也很簡單。之前陸陸續(xù)續(xù)的折騰了一下LiteSpeed,最近就把一些手動安裝的心得貼出來和大家分享吧,如果實(shí)在懶得動腦,可以參考之前的文章,使用llsmp一鍵安裝包。下面開始安裝!
1.清理Debian,去除不必要的軟件包
2.安裝MySQL及相關(guān)的庫文件
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及相關(guān)的庫文件
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
安裝時(shí)中途會詢問MySQL的密碼,連續(xù)輸入兩次即可
3.安裝LiteSpeed
訪問LiteSpeed官網(wǎng)獲得最新版本的下載鏈接: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
出現(xiàn)許可協(xié)議,只需持續(xù)按下【空格】鍵到最后,輸入Yes(注意Y大寫)
交互回答如下問題
Destination [/usr/local/lsws]: 回車
User name [admin]:管理員賬號(默認(rèn)admin)
Password:管理員密碼
Retype password:密碼確認(rèn)
Email addresses [root@localhost]:你的郵箱
User [nobody]:默認(rèn),直接回車
Group [nogroup]:默認(rèn),直接回車
HTTP port [8088]:寫80
Admin HTTP port [7080]:Litespeed面板端口,可默認(rèn),直接Enter
Setup up PHP [Y/n]:默認(rèn),直接回車
Suffix for PHP script(comma separated list) [php]:默認(rèn),直接回車
Would you like to install AWStats Add-on module [y/N]?默認(rèn),直接回車
Would you like to have LiteSpeed Web Server started automatically when the server restarts [Y/n]?默認(rèn),直接回車
Would you like to start it right now [Y/n]?默認(rèn),直接回車
此時(shí)不要關(guān)閉SSH窗口,后面還要用到~
4.編譯PHP
訪問litespeed管理后臺:http://ip:7080
點(diǎn)擊Actions->Compile PHP
選擇PHP版本,點(diǎn)擊Next(我選擇的是5.3.15)
在編譯參數(shù)中填寫為如下段,
‘–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’
小內(nèi)存VPS在編譯的時(shí)候,會出現(xiàn)內(nèi)存不夠的問題”virtual memory exhausted: Cannot allocate memory”,此時(shí)在參數(shù)欄處再加個(gè)”–disable-fileinfo”,重新編譯一下應(yīng)該就OK了~
下面可選安裝組件,我只選擇了eAccelerator;
點(diǎn)擊Build PHP 5.x.x
LiteSpeed開始下載包,下載完成后,點(diǎn)擊Next
此時(shí)不要刷新頁面!
在SSH運(yùn)行如下命令:
/usr/local/lsws/phpbuild/buildphp_manual_run.sh
直到瀏覽器提示“*Complete*”就算是大功告成了~
5.配置eAccelerator
PHP雖然安裝好了,但之前我們選擇的eAccelerator還需要配置一下
創(chuàng)建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”
這時(shí),可以打開http://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
最后重啟litespeed生效~
/etc/init.d/lsws restart
環(huán)境基本配置好了,但是要使用還需要添加虛擬主機(jī)等一系列的步驟和過程,微魔會在日后的教程中和大家分享。
來源:魔都部落
-
廣告合作
-
QQ群號:4114653