centos5.2+apache+mysql+php
相关服务器包放在/usr/src********************************apache 的安装**********************************
1.apache
# tar -zxvf httpd-2.0.63.tar.gz
# cd httpd-2.0.63
# ./configure --prefix=/usr/local/apache --enable-so --enable-expires --enable-rewrite --enable-headers --enable-deflate--enable-dav --enable-maintainer-mode
(由于本系统采取最小话安装,中间可能有好多缺少的包。比如我在安装apache的时候就遇到了zlib没有安装,可以利用yum list |grep zlib*查看zlib没有安装的包,再利用yum install 进行安装包,这个包装上去之后apache就可以正常编译安装了)
# make
# make install
# cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd *此步骤只是方便apache的启动,加了这个可以用service httpd start来启动apache服务
在局域网内找一台win系统的机器,在IE 中输入http://192.168.1.243,如果能出现apache的测试页面说明apache已经安装成功
# vi /etc/rc.d/rc.local
添加
/usr/local/apache/bin/apachectl start
************************************mysql 的安装*******************************
2.mysql
# tar -zxvf mysql-5.0.26.tar.gz
# cd mysql-5.0.26
# groupadd mysql
# useradd mysql -g mysql
# ./configure --prefix=/usr/local/mysql --enable-assembler --without-debug --enable-assembler --without-isam --without-innodb --with-pthread --enable-thread-safe-client --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static--with-charset=utf8
*中间会出现以下的错误
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
# yum list |grep curses
ncurses.i386 5.5-24.20060715 installed
ncurses-devel.i386 5.5-24.20060715 base
php-ncurses.i386 5.1.6-20.el5_2.1 updates
通过yum install 把以上服务包安装上
curses安装完毕之后继续执行./configure步骤
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /usr/local/mysql
# bin/mysql_install_db --user=mysql
# chown -R root.
# chown -R mysql var
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
# cd /usr/src/mysql-5.0.26
# cp support-files/mysql.server /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# chmod 700 /etc/init.d/mysqld
# service mysqld start
# netstat -atln *查看mysql服务器是否启动成功*
# ln /usr/local/mysql/bin/mysql /usr/sbin
# ln /usr/local/mysql/bin/mysqladmin /usr/sbin
# ln /usr/local/mysql/bin/mysqldump /usr/sbin/
# mysqladmin -uroot password "123456" *设置mysql的root用户密码为“123456”
# mysql -uroot -p
# 输入你设置的密码
mysql> use mysql;
mysql> delete from user where password=""; *删除用于本机匿名连接的空密码帐号*
mysql> flush privileges;
mysql> quit;
# vi /etc/my.cnf
log-error=/var/log/mysqld.log //启动mysql错误日志功能
**********************************PHP的安 装*********************************
安装GD库(让PHP支持GIF,PNG,JPEG)
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gz
wget http://savannah.nongnu.org/download/freetype/freetype-2.1.10.tar.gz
wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.9.2.tar.gz
zlib 之前已经安装过了 ,这里就不需要再安装了
安装jpegsrc
# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# cd /usr/src
# tar -zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
# make
# make install
安装libpng
# cd /usr/src
# tar -zxvf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# cp scripts/makefile.std makefile
# make
# make install
安装 freetype
# cd /usr/src
# tar -zxvf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# ./configure --prefix=/usr/local/freetype
# make
# make install
安装最新的GD库
# cd /usr/src
# tar -zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6/ --with-png --with-zlib --with-freetype=/usr/local/freetype/
# make
# make install
安装 iconv
# cd /usr/src
# tar -zxvf libiconv-1.9.2.tar.gz
# cd libiconv-1.9.2
# ./configure --prefix=/usr/local/iconv
# make
# make install
安装 PHP
# cd /usr/src
# tar -zxvf php-5.2.6.tar.gz
# cd php-5.2.6
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-xml --with-zlib --with-gd=/usr/local/gd2 --with-jpeg=/usr/local/jpeg6 --with-png --with-iconv=/usr/local/iconv --enable-mbstring=cn --with-freetype=/usr/local/freetype --enable-sockets --with-mcrypt --with-config-file-path=/etc
# cp php.ini-dist /usr/local/lib/php.ini
安装zend
# cd /usr/src
# tar -zxvf ZendOptimizer-3.3.3
# cd ZendOptimizer-3.3.3-linux-glibc23-i386
# ./install.sh
注意:安装过程中可能会发现libxml2没有安装
yum list |grep "libxml" //查看libxml 相关包
yum install 服务包名
# vi /usr/local/apache/conf/httpd.conf中添加
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
index.php
include conf.d/*.conf
页:
[1]