引用http://www.icanwen.cn/article.asp?id=20
安装环境:
- 所用操作系统 CENTOS 5.3
- 开发库全选
- 系统工具全选
- 安装或升级程序库
sudo -s
LANG=C yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-
devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc
glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel
curl curl-devel openssl openssl-devel
|
- 为了便于初学者系统防火墙及selinux disable
mysql的安装
- 添加用户及组:
groupadd mysql useradd -g mysql mysql
2. 编译安装:
/configure --prefix=/usr/local/mysql --enable-local-infile --with-charset=gbk
--with-extra-charsets=all --with-low-memory --with-mysqld-user=mysql
--enable-thread-safe-client
make && make install
cd /usr/local/mysql
chown –R mysql:mysql .
./bin/mysql_install_db -–user=mysql
chown –R root .
chown –R mysql var
./bin/mysqld_safe –user=mysql &
netstat –nat | grep 3306
echo “/usr/local/mysql/lib/mysql “ >>/etc/ld.so.conf
ldconfig ldconfig –v
ln –s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
cp /support /mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cp /support/my-medium.cnf /etc/my-cnf
chkconfig –add mysqld
chkconfig mysqld on
|
APACHE的安装
- 编译安装apache
./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite -- enable-ssl
--with-ssl=/usr/local/openssl --with-zlib --enable-mods- shared=all --enable-
track-vars --with-mysql=/usr/local/mysql
make && make install
echo " /usr/local/httpd/bin/apacheclt start " >> /etc/rc.local
/usr/local/httpd/bin/apacheclt start
|
- vi httpd.conf 添加: 支持php
addtype application/x-httpd-php .php
addtype application/x-httpd-php-source .phps
- 测试apache 是否安装正功
netstat –nat | grep 80
PHP的安装 :
- 编译安装php
./configure --prefix=/usr/local/php --with-config-file-path=/etc
--with-apxs2=/usr/local/httpd/bin/apxs
--enable-fastcgi --enable-safe-mode
--with-zlib --with-bz2
--with-freetype-dir
--enable-mbstring
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-gd --with-libxml-dir
--with-png-dir --with-jpeg-dir -- enable-sockets
make && make install
|