5.安装mysql数据库
将提供的mysql安装源代码存放在/tmp/文件夹下。
tar -zxvf mysql-5.1.55.tar.gz
cd mysql-5.1.55
./configure --prefix=/usr/local/mysql \
--localstatedir=/data/mysql/data \
--with-nuix-socket-path=/var/lib/mysql/mysql.sock \
--enable-assembler \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--with-ssl \
--with-embedded-server
make && make install
此时安装完毕后执行:
groupadd mysql
useradd mysql -g mysql -d /data/mysql -s /sbin/nologin
/usr/local/mysql/bin/mysql_install_db --user=mysql
cd /usr/local/mysql
chown -R mysql:mysql .
mkdir -p /data/mysql/data
chown -R mysql /data/mysql/data
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chmod 755 /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
6.安装Apache服务器。
首先安装apr-1.4.5.tar.gz和apr-util-1.3.12.tar.gz,进而安装httpd-2.4.3.tar.bz2。
tar -zxf apr-1.4.5.tar.gz
cd apr-1.4.5
./configure --prefix=/usr/local/apr
make && make install
cd ..
tar -zxf apr-util-1.3.12.tar.gz
cd apr-util-1.3.12
./configure --prefix=/usr/local/apr-util \
--with-apr=/usr/local/apr/bin/apr-1-config
make && make install
cd ..
tar -jxf httpd-2.4.3.tar.bz2
cd httpd-2.4.3
./configure --prefix=/usr/local/apache \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util/ \
--enable-so \
--enable-ssl \
--with-libxml2 \
--enable-rewrite
make && make install
打开配置文件
vi /usr/local/apache/conf/httpd.conf
将下边这行前的#去掉
#LoadModule rewrite_module modules/mod_rewrite.so
启动/重启/关闭Apache服务器
/usr/local/apache/bin/apachectl start/restart/stop
sed -i '$a ServerName www.example.com:80' /usr/local/apache/conf/httpd.conf