Debian下手動安裝LiteSpeed+PHP+MySQL教程
發(fā)布時間:2012-11-14 11:01:40 作者:佚名
我要評論

Debian系統(tǒng)一直是微魔和喜歡的Linux分枝,最小化的系統(tǒng)占用系統(tǒng)資源非常的少,而且操作起來也很簡單。之前陸陸續(xù)續(xù)的折騰了一下LiteSpeed,最近就把一些手動安裝的心得貼出來和大家分享吧
如果實在懶得動腦,可以參考之前的文章,使用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 upgrade
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
設(shè)置autoconf
export PHP_AUTOCONF=/usr/bin/autoconf
export PHP_AUTOHEADER=/usr/bin/autoheader
安裝時中途會詢問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*
sh ./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),直接回車
此時不要關(guān)閉SSH窗口,后面還要用到~
4.編譯PHP
訪問litespeed管理后臺:http://ip:7080
點擊Actions->Compile PHP
選擇PHP版本,點擊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在編譯的時候,會出現(xiàn)內(nèi)存不夠的問題”virtual memory exhausted: Cannot allocate memory”,此時在參數(shù)欄處再上如下參數(shù),重新編譯一下應(yīng)該就OK了~
--disable-fileinfo下面可選安裝組件,我只選擇了eAccelerator;
點擊Build PHP 5.x.x
LiteSpeed開始下載包,下載完成后,點擊Next
此時不要刷新頁面!
在SSH運行如下命令:
/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"
這時,可以打開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ī)等一系列的步驟和過程,微魔會在日后的教程中和大家分享~
1.清理Debian,去除不必要的軟件包
2.安裝MySQL及相關(guān)的庫文件
3.安裝LiteSpeed
4.編譯PHP
5.配置eAccelerator
6.安裝Zend Loader
1.清理Debian,去除不必要的軟件包
復(fù)制代碼
代碼如下: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)的庫文件
復(fù)制代碼
代碼如下:apt-get remove apache
apt-get update
apt-get upgrade
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
設(shè)置autoconf
復(fù)制代碼
代碼如下:export PHP_AUTOCONF=/usr/bin/autoconf
export PHP_AUTOHEADER=/usr/bin/autoheader
安裝時中途會詢問MySQL的密碼,連續(xù)輸入兩次即可
3.安裝LiteSpeed
訪問LiteSpeed官網(wǎng)獲得最新版本的下載鏈接:http://litespeedtech.com/litespeed-web-server-downloads.html
復(fù)制代碼
代碼如下:cd /tmp
wget http://litespeedtech.com/packages/4.0/lsws-4.1.13-std-i386-linux.tar.gz
tar zxvf lsws*
cd lsws*
sh ./install.sh
出現(xiàn)許可協(xié)議,只需持續(xù)按下【空格】鍵到最后,輸入Yes(注意Y大寫)
交互回答如下問題
復(fù)制代碼
代碼如下: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),直接回車
此時不要關(guān)閉SSH窗口,后面還要用到~
4.編譯PHP
訪問litespeed管理后臺:http://ip:7080
點擊Actions->Compile PHP
選擇PHP版本,點擊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在編譯的時候,會出現(xiàn)內(nèi)存不夠的問題”virtual memory exhausted: Cannot allocate memory”,此時在參數(shù)欄處再上如下參數(shù),重新編譯一下應(yīng)該就OK了~
--disable-fileinfo下面可選安裝組件,我只選擇了eAccelerator;
點擊Build PHP 5.x.x
LiteSpeed開始下載包,下載完成后,點擊Next
此時不要刷新頁面!
在SSH運行如下命令:
/usr/local/lsws/phpbuild/buildphp_manual_run.sh直到瀏覽器提示“*Complete*”就算是大功告成了~
5.配置eAccelerator
PHP雖然安裝好了,但之前我們選擇的eAccelerator還需要配置一下
創(chuàng)建eAccelerator的緩存目錄
復(fù)制代碼
代碼如下:mkdir /usr/local/eaccelerator_cache
chmod -R 777 /usr/local/eaccelerator_cache
編輯php.ini
復(fù)制代碼
代碼如下: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"
這時,可以打開http://ip/phpinfo.php看看eAccelerator安裝的如何~
6.安裝Zend Loader
復(fù)制代碼
代碼如下: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
添加如下字段
復(fù)制代碼
代碼如下:[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ī)等一系列的步驟和過程,微魔會在日后的教程中和大家分享~
相關(guān)文章
輕松玩轉(zhuǎn)虛擬機(jī)套娃! 在Hyper-V中開啟嵌套虛擬化的技巧
有辦法在虛擬機(jī)中創(chuàng)建虛擬機(jī)嗎?答案是肯定的,在虛擬機(jī)中運行虛擬機(jī)是可能的,我們將其稱為嵌套虛擬化,下面我們就來看看詳細(xì)操作方法2025-02-19龍蜥操作系統(tǒng)Anolis OS-23.x安裝配置圖解教程(保姆級)
本文主要介紹了安裝和配置AnolisOS 23.2系統(tǒng),包括分區(qū)、軟件選擇、設(shè)置root密碼、網(wǎng)絡(luò)配置、主機(jī)名設(shè)置和禁用SELinux的步驟,具有一定的參考價值,感興趣的可以了解一下2025-01-20VMware虛擬機(jī)怎么復(fù)制/克隆/導(dǎo)出VMDK文件?
在處理文件拷貝復(fù)制到VMware虛擬機(jī)中的任務(wù)時,有多種方法可以實現(xiàn)文件的高效傳輸,使用這些方法,可以在不同的操作系統(tǒng)和環(huán)境下,實現(xiàn)文件的快速、安全遷移,詳細(xì)請看下文2024-09-24統(tǒng)信 UOS V20 桌面專業(yè)版更新發(fā)布:附更新內(nèi)容匯總
統(tǒng)信 UOS V20 桌面專業(yè)版(1070u1)正式發(fā)布,支持微信掃碼登錄、應(yīng)用窗口縮略圖,海量功能修復(fù),詳細(xì)請看下文介紹2024-08-08怎么看自己IP地址? 不同的操作系統(tǒng)中查看路由器的IP地址的方法
在互聯(lián)網(wǎng)上進(jìn)行網(wǎng)絡(luò)連接,每個設(shè)備都有一個唯一的標(biāo)識,即IP地址,本文介紹了如何在不同平臺上查找路由器的IP地址,包括Windows、Mac、iPhone、iPad、Android、Chrome OS和2024-07-16- 很多人在使用虛擬機(jī)系統(tǒng)的時候,經(jīng)常對虛擬機(jī)的運行速度不甚滿意,甚至經(jīng)常很惱火,虛擬機(jī)速度慢有很多原因,每個人需要根據(jù)自己的情況具體分析,本文根據(jù)筆者的使用經(jīng)驗將2024-02-21
Vmware虛擬機(jī)如何與主機(jī)之間直接復(fù)制粘貼文件?
使用虛擬機(jī)的時候,遇到了錯誤,想要把錯誤的代碼或是運行情況復(fù)制粘貼到Windows的網(wǎng)上論壇區(qū)求助大神,該怎么操作呢?詳細(xì)請看下文介紹2024-02-21統(tǒng)信UOS V20桌面專業(yè)版(1060)11月更新發(fā)布(附更新內(nèi)容匯總)
國產(chǎn)桌面操作系統(tǒng)統(tǒng)信 UOS V20 專業(yè)版(1060)11月更新發(fā)布,這是統(tǒng)信 UOS V20 專業(yè)版(1060)2023 年度最后一次更新,下面我們就來看看詳細(xì)的更新內(nèi)容2023-12-01統(tǒng)信 UOS 將推 Rust 版 Bash 命令行工具 utshell(附下載地址)
統(tǒng)信 UOS 服務(wù)器版將于不久后推出 Rust 版 Bash,名為 utshell,旨在突破傳統(tǒng) Shell 所面臨的安全限制,詳細(xì)請看下文介紹2023-09-20UOS開機(jī)進(jìn)入busybox界面怎么辦 uos無法進(jìn)入桌面的解決辦法
UOS開機(jī)進(jìn)入busybox界面怎么辦?UOS系統(tǒng)開機(jī)黑屏進(jìn)入busybox界面了,該怎么辦呢?下面我們就來看看uos無法進(jìn)入桌面的解決辦法2023-09-06