Centos5.2配置LAMP与Centos5.3配置LAMP

2020-01-30 12:46:46丽君

rm -rf /usr/local/imap-2007b/lib/*
rm -rf /usr/sbin/imapd
cp imapd/imapd /usr/sbin/
cp c-client/*.h /usr/local/imap-2007b/include/
cp c-client/*.c /usr/local/imap-2007b/lib/
cp c-client/c-client.a /usr/local/imap-2007b/lib/libc-client.a

cd ..

#安装MYSQL


tar zxvf mysql-5.0.51b.tar.gz

cd mysql-5.0.51b

./configure
“–prefix=/usr/local/mysql”
“–localstatedir=/data/mysql/data”
“–with-comment=Source”
“–with-server-suffix=-test.com”
“–with-mysqld-user=mysql”
“–without-debug”
“–with-big-tables”
“–with-charset=gbk”
“–with-collation=gbk_chinese_ci”
“–with-extra-charsets=all”
“–with-pthread”
“–enable-static”
“–enable-thread-safe-client”
“–with-client-ldflags=-all-static”
“–with-mysqld-ldflags=-all-static”
“–enable-assembler”
“–without-isam”
“–without-innodb”
“–without-ndb-debug”
make && make install
useradd mysql -d /data/mysql -s /sbin/nologin
/usr/local/mysql/bin/mysql_install_db –user=mysql
cd /usr/local/mysql
chown -R root:mysql .
chown -R mysql /data/mysql/data
cp share/mysql/my-huge.cnf /etc/my.cnf
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig –add mysqld
/etc/rc.d/init.d/mysqld start

cd /usr/local/mysql/bin
for i in *; do ln -s /usr/local/mysql/bin/$i /usr/bin/$i; done

cd /usr/local/src

mysqladmin -u root password chenshake


#安装Apache

tar zxvf httpd-2.2.8.tar.gz
cd httpd-2.2.8
./configure
“–prefix=/usr/local/apache2″
“–with-included-apr”
“–enable-so”
“–enable-deflate=shared”
“–enable-expires=shared”
“–enable-rewrite=shared”
“–enable-static-support”
“–disable-userdir”
make
make install
cd ..

#安装PHP

tar jxvf php-5.2.6.tar.bz2
cd php-5.2.6
./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-gd=/usr/local/gd2″
“–with-libxml-dir=/usr”
“–with-jpeg-dir”
“–with-png-dir”