2014-10-10 LAMP第一部分-環境搭建

1. 安裝mysql
cd /usr/local/src/ 
wget http://syslab.comsenz.com/downlo ... -icc-glibc23.tar.gz 
tar zxvf /usr/local/src/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz 
mv mysql-5.1.40-linux-i686-icc-glibc23 /usr/local/mysql 
useradd -s /sbin/nologin -M mysql 
cd /usr/local/mysql 
mkdir -p /data/mysql 
chown -R mysql:mysql /data/mysql 
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql 
cp support-files/my-large.cnf /etc/my.cnf 
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld 
vim /etc/init.d/mysqld   #修改datadir
chkconfig --add mysqld 
chkconfig mysqld on 
service mysqld start 

2. 安裝apache
wget http://syslab.comsenz.com/downloads/linux/httpd-2.2.16.tar.gz
tar zvxf httpd-2.2.16.tar.gz  
cd httpd-2.2.16 
./configure --prefix=/usr/local/apache2 --with-included-apr  --with-pcre --enable-mods-shared=most
make && make install 

【如何指定使用worker/prefork】 http://www.lishiming.net/thread-944-1-1.html
【apache兩種工作模式】http://www.lishiming.net/thread-838-1-2.html

3.  安裝php
wget http://cn2.php.net/distributions/php-5.3.28.tar.gz 
tar zxf php-5.3.28.tar.gz 
cd php-5.3.28 
./configure   --prefix=/usr/local/php   --with-apxs2=/usr/local/apache2/bin/apxs   --with-config-file-path=/usr/local/php/etc   --with-mysql=/usr/local/mysql   --with-libxml-dir   --with-gd   --with-jpeg-dir   --with-png-dir   --with-freetype-dir   --with-iconv-dir   --with-zlib-dir   --with-bz2   --with-openssl   --with-mcrypt   --enable-soap   --enable-gd-native-ttf   --enable-mbstring   --enable-sockets   --enable-exif   --disable-ipv6 
make && make install 
4. 配置第一個虛擬主機

5. 測試解析php
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章