Quantcast
Channel: phpabc.cn » mysql5
Viewing all articles
Browse latest Browse all 2

apache2.2.2+mysql5.0.22+php5.1.4+memcache+ZendOptimizer3.0 安装

$
0
0

第一步:安装CentOS4.3
手动分区,作为服务器,特别为服务用途分了一个区,具体一个根目录“/”,一个“/server”,一个是交换分区。
不安装不需要的组件,所以在选择组件的时候,除了选择FTP SERVER外取消所有组件的选择。如果是32位机器的话应该是679M,64位机器为719M。
关闭所有不需要的服务,安装完成后登陆。输入 SETUP命令,最后只剩下启动以下几个服务(具体的请参考自己需要启动):crond,iptables,irqbalance(多处理器适用),network,sshd,syslog,vsftpd,xinetd
确定以后重启,就可以利用SSH和FTP服务进行远程管理了。当然你要知道机器的IP,如果是DHCP的话,可以输入命令ifconfig进行查看,如果是固定IP,那就直接登陆了。

第二步:安装服务前的准备:
下载httpd-2.2.2.tar.gz:
下载mysql-5.0.22.tar.gz:
下载php- 5.1.4.tar.gz:
下载zendoptimizer-3.0.tar.gz:
下载libxml2-2.6.26.tar.gz:
下载zlib-1.2.3.tar.gz:
下载jpegsrc.v6b.tar.gz:
下载libpng-1.2.10.tar.gz:
下载freetype-2.2.1.tar.gz:
下载gd- 2.0.33.tar.gz:
因为安装系统的时候是最小安装,所以编译服务的时候需要一些软件支持,具体需要以下RPM包,这些都可以在CentOS安装盘里找到:
glibc- kernheaders-2.4-9.1.98.EL.x86_64.rpm(在第二张碟)
glibc-headers- 2.3.4-2.19.x86_64.rpm(在第二张碟)
glibc-devel-2.3.4-2.19.x86_64.rpm(在第二张碟)
cpp- 3.4.5-2.x86_64.rpm(在第一张碟)
gcc-3.4.5-2.x86_64.rpm(在第二张碟)
libstdc++-devel- 3.4.5-2.x86_64.rpm(在第二张碟)
gcc-c++-3.4.5-2.x86_64.rpm(在第三张碟)
flex- 2.5.4a-33.x86_64.rpm(在第二张碟)
增加一个用户,以方便通过FTP上传文件,命令如下:
useradd biaoest(增加一个名称为biaoest的用户)
passwd biaoest(为刚刚增加的用户修改密码)
上传文件到biaoest的根目录/home/biaoest,用软件上传的时候注意不要用被动模式,要不感觉会有点慢,把上面需要的文件全部上传。
第二步:安装APACHE2.2.2+MYSQL5.0.22+PHP5.1.4+GD2.0.33+ZENDOPTIMIZER3.0
安装系统的时候特别为服务相关的软件准备了一个分区,下面为分区server的相关分布:
cd /server(服务根目录)
mkdir /server/apache2(APACHE2根目录)
mkdir /server/modlib(相关模块根目录)
mkdir /server/modlib/jpeg6(JPEG目录)
mkdir /server/modlib/png(PNG目录)
mkdir /server/modlib/gd2(GD目录)
mkdir /server/modlib/xml2(XML目录)
mkdir /server/mysql5(MYSQL5根目录)
mkdir /server/php5(PHP5根目录)
mkdir /server/php5/zend(ZENDOPTIMIZER3目录)
mkdir /server/database(MYSQL数据库目录)
mkdir /server/webroot(网页根目录)
下面的安装都是假设当前路径为刚刚上传文件路径/home/biaoest目录。

安装GCC编译器及相关辅助软件
rpm -Uvh glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm
rpm -Uvh glibc-headers-2.3.4-2.19.x86_64.rpm
rpm -Uvh glibc-devel-2.3.4-2.19.x86_64.rpm
rpm -Uvh cpp-3.4.5-2.x86_64.rpm
rpm -Uvh gcc-3.4.5-2.x86_64.rpm
rpm -Uvh libstdc++-devel-3.4.5-2.x86_64.rpm
rpm -Uvh gcc-c++-3.4.5-2.x86_64.rpm
####################################################
如果没有安装上面软件,可能出现的错误提示:
checking for gcc… no
checking for cc… no
checking for cc… no
checking for cl… no
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details.
####################################################
rpm -Uvh flex-2.5.4a-33.x86_64.rpm
####################################################
如果没有安装上面软件,可能出现的错误提示:
checking lex output file root… ./configure: line 3246: lex: command not found
configure: error: cannot find output from lex; giving up
####################################################
安装MYSQL5.0.22到指定目录/server/mysql5,数据保存在/server/database
mkdir /server/mysql5
mkdir /server/database
groupadd mysql
useradd -g mysql mysql
cd /home/biaoest
tar -zxvf mysql-5.0.22.tar.gz
cd mysql-5.0.22
./configure –prefix=/server/mysql5 –sysconfdir=/etc –localstatedir=/server/database
make
make install
cp /server/mysql5/support-files/my-medium.cnf /etc/my.cnf
在[mysqld]下加
set-variable = max_connections=1000
修改/server/database属性
chown mysql.mysql /server/database
建立数据库
/server/mysql5/bin/mysql_install_db –user=mysql
启动数据库
/server/mysql5/bin/mysqld_safe –user=mysql &
设置开机自动运行
cp /server/mysql5/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
cd /etc/rc.d/init.d
chkconfig –add mysqld
安装apache2.2.2
cd /home/biaoest
tar -zxvf httpd-2.2.2.tar.gz
cd httpd-2.2.2
修改默认连接数vi server/mpm/prefork/prefork.c,查找256,把它修改为2048
./configure –prefix=/server/apache2 –enable-module=so –enable-module=rewrite –enable-cache –enable-disk-cache –enable-mem-cache –enable-file-cache –with-mpm=prefork
make
make install
启动apache2
/server/apache2/bin/apachectl start
设置开机自动启动
从/usr/local/apache/bin/apachectl 到 /etc/rc.d/init.d/httpd 建立一个符号连接:
# ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
然后在此文件总添加以下几行(大概在文件顶部,约第二行的地方):
# chkconfig: 2345 10 90
# description: Activates/Deactivates Apache Web Server
最后,运行chkconfig把Apache添加到系统的启动服务组里面:
# /sbin/chkconfig –del httpd
# /sbin/chkconfig –add httpd

编辑/etc/rc.d/rc.local
把/server/apache2/bin/apachectl start 加入进去

安装GD-2.0.33
安装ZLIB2
cd /home/biaoest
tar -zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure
#################################################
不要用–prefix自定义安装目录,否则可能会影响后面安装,可能出现的错误:
configure: error: zlib not installed
#################################################
#################################################
如果你的机器是64位,并且在安装png时候出现下面错误:
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
修补办法(接上面步骤):
vi Makefile
找到 CFLAGS=-O3 -DUSE_MMAP
在后面加入 -fPIC,即变成CFLAGS=-O3 -DUSE_MMAP -fPIC
接下面步骤
#################################################
make
make install

安装JPEG6
#################################################
先建立目录,否则可能会出现类型下面错误:
/usr/bin/install -c cjpeg /server/apache2/modlib/jpeg6/bin/cjpeg
/usr/bin/install: cannot create regular file `/server/apache2/modlib/jpeg6/bin/cjpeg’: No such file or directory
make: *** [install] Error 1
解决办法:
mkdir /server/apache2/modlib
mkdir /server/apache2/modlib/jpeg6
mkdir /server/apache2/modlib/jpeg6/bin
mkdir /server/apache2/modlib/jpeg6/lib
mkdir /server/apache2/modlib/jpeg6/include
mkdir /server/apache2/modlib/jpeg6/man
mkdir /server/apache2/modlib/jpeg6/man/man1
#################################################
cd /home/biaoest
tar -zxvf jpegsrc.v6b.tar.gz
cd jpegsrc.v6b.
./configure –prefix=/server/apache2/modlib/jpeg6
#################################################
如果你的机器是64位,并且在安装gd时候出现下面错误:
/usr/bin/ld: /server/apache2/modlib/jpeg6//lib/libjpeg.a(compress.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/server/apache2/modlib/jpeg6//lib/libjpeg.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libgd.la] Error 1
修补办法(接上面步骤):
vi Makefile
找到 CFLAGS= -O2 -I$(srcdir)
在后面加入 -fPIC,即变成CFLAGS= -O2 -I$(srcdir) -fPIC
接下面步骤
#################################################
make
make install-lib
#################################################
特别注意,要不下面会出现错误:
configure: error: libjpeg.(a|so) not found.
#################################################
make install
安装PNG
cd /home/biaoest
tar -zxvf libpng-1.2.10.tar.gz
cd libpng-1.2.10
./configure –prefix=/server/apache2/modlib/png
make
################################################
如果出现下面错误:
configure: error: zlib not installed
请回到zlib,重新安装一次,最好先 make clean
################################################
make install
安装freetype
cd /home/biaoest
tar -zxvf freetype-2.2.1.tar.gz
cd freetype-2.2.1
./configure –prefix=/server/apache2/modlib/freetype
make
make install

安装GD
cd /home/biaoest
tar -zxvf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure –prefix=/server/apache2/modlib/gd2 –with-jpeg=/server/apache2/modlib/jpeg6/ –with-png=/server/apache2/modlib/png/ –with-zlib –with-freetype=/server/apache2/modlib/freetype/
make
#################################################
如果出现下面错误:
gd_png.c:825: warning: data definition has no type or storage class
make[2]: *** [gd_png.lo] Error 1
修复方法:
找到CPPFLAGS = -I/server/apache2/modlib/freetype/include/freetype2 -I/server/apache2/modlib/freetyp
e/include -I/server/apache2/modlib/freetype//include -I/server/apache2/modlib/jpeg6//include
原来是少了png的支持了,把它改为
CPPFLAGS = -I/server/apache2/modlib/freetype/include/freetype2 -I/server/apache2/modlib/freetyp
e/include -I/server/apache2/modlib/png/include -I/server/apache2/modlib/jpeg6/include
#################################################
make install

安装LIBXML2
mkdir /server/apache2/modlib
tar -zxvf libxml2-2.6.26.tar.gz
cd libxml2-2.6.26
./configure –prefix=/server/apache2/modlib/xml2
make
make install
安装PHP5.1.4
cd /home/biaoest
tar -zxvf php-5.1.4.tar.gz
cd php-5.1.4
./configure –prefix=/server/php5 \
–with-mysql=/server/mysql5 \
–with-apxs2=/server/apache2/bin/apxs \
–with-libxml-dir=/server/apache2/modlib/xml2 \
–with-gd=/server/apache2/modlib/gd2 \
–with-jpeg-dir=/server/apache2/modlib/jpeg6 \
–with-zlib \
–with-png-dir=/server/apache2/modlib/png \
–with-freetype-dir=/server/apache2/modlib/freetype \
–enable-experimental-zts \
#################################################
如果出现错误:
checking lex output file root… ./configure: line 3246: lex: command not found
configure: error: cannot find output from lex; giving up
修补方法,安装FLEX:
rpm -Uvh flex-2.5.4a-33.x86_64.rpm
################################################
如果又出现下面错误:
configure: error: libjpeg.(a|so) not found.
修补方法:
原来在安装jpeg的时候,执行了make install,应该执行make install-lib才能生成libjpeg.a文件
################################################
make
make install
复制配置文件到相应的目录
cp php.ini-dict /server/php5/lib/php.ini
配置/server/apache2/conf/httpd.conf
找到DocumentRoot “/server/apache2/htdocs” ,修改为DocumentRoot “/server/webroot”
找到 ,修改为
找到DirectoryIndex index.html,增加index.php等等,变成DirectoryIndex index.html index.htm index.php index.phtml index.phps
加载php模块,去掉注释“#”,如没有此行,请加上。
LoadModule php5_module modules/libphp5.so
加上此两行
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
set-variable = max_connections=100

安装ZendOptimizer-3.0.0
cd /home/biaoest
tar -zxvf ZendOptimizer-3.0.0-linux-glibc23-x86_64.tar.gz
cd ZendOptimizer-3.0.0-linux-glibc23-x86_64
./install
然后就按照提示给出相应的路径即可

安装MEMCACHED
tar -xzf libevent-1.1a.tar.gz
cd libevent-1.1a
./configure –prefix=/usr
make
make install
cd ..
tar -xzf memcached-1.1.12.tar.gz
cd memcached-1.1.12
./configure –prefix=/usr
make
make install
启动MEMCHED
/usr/bin/memcached -d -m 128 -p 11211 -u nobody
########################################################################
/usr/bin/memcached: error while loading shared libraries: libevent-1.1a.so.1: cannot open shared object file: No such file or directory
cp /usr/lib/libevent* /usr/lib64/ -R
#########################################################################
安装memcache PHP模块
tar vxzf memcache-2.0.4.tgz
cd memcache-2.0.4
/server/php5/bin/phpize
./configure –enable-memcache –with-php-config=/server/php5/bin/php-config –with-zlib-dir
make
make install
安装完后会有类似这样的提示:
Installing shared extensions: /server/php5/lib/php/extensions/no-debug-non-zts-20050922/
把这个记住,然后修改php.ini,把
extension_dir = “./”
修改为
extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20050922/”
并添加一行

extension=memcache.so

安装完毕,该测试了,建立一个专门的web用户,用于上传网页吧。
useradd -d /server/webroot web
passwd web
chown web /server/webroot

参考文章:
(Linux+Apache+Mysql+PHP典型配置)http://www.5ilinux.com /blog/archives/000013.html
(Linux下安装最新Apache2.0.52+PHP5+GD2+MySQL 等)http://support.iap.ac.cn/portal/viewarticle.php?id=839
(RedHat linux AS 4+Apache2.2+MYSQL5.0.17+PHP5.1.1)http://bbs.chinaunix.net/viewthread.php?tid=694641&extra=page%3D1
(PHP & memcached )http://nio.infor96.com/php-memcached/


Viewing all articles
Browse latest Browse all 2

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes