Friday, April 24, 2009

[ubuntu] Install apache2, mysql, php

Ubuntu下安裝apache2, mysql, and php的方式
安裝apache2 with perfork mpm
sudo apt-get install apache2 apache2-mpm-prefork

安裝php5
sudo apt-get install php5 libapache2-mod-php5 php5-cli php5-dev php5-gd php5-imagick php5-mcrypt php5-xmlrpc

起動php5的mod
sudo a2enmod php5

安裝mysql
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

重起 Apache2
sudo /etc/init.d/apache2 force-reload

設定eAccelerator
下載eAccelerator
http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.zip
解壓縮eaccelerator-0.9.5.3.zip
cd eaccelerator-0.9.5.3
安裝aAccelerator
sudo /usr/bin/phpize ; sudo ./configure --enable-eaccelerator=shared --with-php-config=/usr/bin/php-config ; sudo make ; sudo make install
建立 eAccelerator 快取
sudo mkdir /var/tmp/eaccelerator ; sudo chmod 0777 /var/tmp/eaccelerator
新增 /etc/php5/conf.d/eaccelerator.ini
sudo vim /etc/php5/conf.d/eaccelerator.ini
內容如下:
extension="eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/var/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"
重起 Apache2
sudo /etc/init.d/apache2 force-reload


Reference
阿駕零零壹 © 學習筆記 | [Ubuntu] Apache 2 + MySQL + PHP ( + FastCGI ) on Ubuntu 8.04 Server

No comments:

Post a Comment