debian 6發布了,這幾天在虛擬機里裝了一個伺服器試了試,感覺比ubuntu輕便,比centos啟動快,但總有這樣那樣的小問題。
下面把我的安裝過程進行說明:
1、安裝debian,選擇中文,不安裝任何服務;
2、安裝ssh,以便在其他機器上粘貼代碼:
apt-get install openssh-server
3、添加163和dotdeb源:
deb http://mirrors.163.com/debian squeeze main non-free contrib
deb http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free
deb http://mirrors.163.com/debian-security squeeze/updates main contrib non-free
deb-src http://mirrors.163.com/debian squeeze main non-free contrib
deb-src http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free
deb-src http://mirrors.163.com/debian-security squeeze/updates main contrib non-free
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add –
更新:
apt-get update && apt-get upgrade
4、解決終端亂碼:
vi /etc/default/locale
注釋掉其他,添加一行:
LANG=C
5、安裝網站系統:
apt-get install nginx php5-common php5-dev php5-cgi spawn-fcgi php-apc php5-mysql php5-curl php5-gd php5-idn php-pear
php5-mcrypt php5-memcache php5-ming php5-recode php5-tidy php5-xmlrpc php5-xsl mysql-server make
以下為可選安裝項:
apt-get install php5-imagick php5-imap php5-recode php5-snmp php5-sqlite php5-xmlrpc php5-suhosin php5-odbc php5-ladp
6、啟動php5-fpm時出現錯誤:
Starting php5-fpm PHP Deprecated: Comments starting with # are deprecated in /etc/php5/fpm/conf.d/ming.ini on line 1 in Unknown on line 0
PHP Warning: Function registration failed – duplicate name – idn_to_ascii in Unknown on line 0
PHP Warning: Function registration failed – duplicate name – idn_to_utf8 in Unknown on line 0
PHP Warning: idn: Unable to register functions, unable to load in Unknown on line 0
Segmentation fault
failed
解決辦法:
一是
vi /etc/php5/fpm/conf.d/ming.ini
將#改為;即可。
二是
vi /etc/php5/fpm/conf.d/idn.ini
想不到其他辦法,注釋掉語句,網上也找不到相關資料。
7、安裝eaccelerator和zendguardloader
sudo mkdir /usr/zend
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
wget http://phpcj.googlecode.com/files/ZendGuardLoader.so
sudo mv ZendGuardLoader.so /usr/zend/ZendGuardLoader.so
wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
tar xvjf eaccelerator-0.9.6.1.tar.bz2
cd eaccelerator-0.9.6.1
cp control.php /var/www/control.php //複製控制程序到網站目錄,通過http://網站名/control.php訪問,默認帳號為
admin,密碼為eAccelertor,可編輯此文件修改。
phpize
sudo ./configure –enable-eaccelerator=shared
sudo make
sudo make install
sudo vi /etc/php5/fpm/php.ini
在配置文件最後加上:
代碼:
zend_extension=/usr/zend/ZendGuardLoader.so
zend_loader.enable=1
zend_loader.disable_licensing=0
zend_loader.obfuscation_level_support=3
zend_loader.license_path=
zend_extension=”/usr/lib/php5/20090626+lfs/eaccelerator.so”
eaccelerator.shm_size=”16″
eaccelerator.cache_dir=”/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.allowed_admin_path=”/var/www/control.php”