RedHat AS4上安装配置Apache2.2.4+PHP5.2.3+MySQL5.0.45+openssl0.98e




RedHat AS4上安装配置Apache2.2.4+PHP5.2.3+MySQL5.0.45+openssl0.98e

2022-07-20 21:07:26 网络知识 官方管理员

系统环境:RedhatAS4所需软件包:mysql-5.0.41.tar.gz

zlib-1.2.3.tar.gzopenssl-0.9.8e.tar.gzhttpd-2.2.4.tar.gzlibpng-1.2.14.tar.gzfreetype-2.1.10.tar.gzjpegsrc.v6b.tar.gzlibxml2-2.6.19.tar.gzgd-2.0.33.tar.gzphp-5.2.1.tar.gz
所用软件包都上传至服务器/root/web目录下1.1.安装mysql-5.0.45
卸载系统自带的mysqlrpm-qa|grepmysqlrpm-e–nodepsmysql
groupaddmysql
useradd-gmysqlmysql
tarzxvfmysql-5.0.41.tar.gz
cdmysql-5.0.45
#./configure–prefix=/usr/local/mysql–enable-thread-safe-client–enable-local-infile–with-charset=gbk–with-extra-charset=all–with-low-memory
#make
#makeinstall
#cpsupport-files/my-medium.cnf/etc/my.cnf
#cd/usr/local/mysql
#chown-Rmysql.
#chgrp-Rmysql.
#bin/mysql_install_db–user=mysql
#chown-Rroot.
#chown-Rmysqlvar
#bin/mysqld_safe–user=mysql&
#cd/root/web/mysql-5.0.45
#cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld
#chmod700/etc/rc.d/init.d/mysqld
#chkconfig–addmysqld
#chkconfig–level345mysqldon测试
#/usr/local/mysql/bin/mysqladminping
#/usr/local/mysql/bin/mysqladminversion
#/usr/local/mysql/bin/mysql添加root密码
#/usr/local/mysql/bin/mysqladmin-uroot-p添加/usr/local/mysql/bin到环境变量PATH中
#exportPATH=$PATH:/usr/local/mysql/bin2.安装zlib-1.2.3#tarzxvfzlib-1.2.3.tar.gz
#cdzlib-1.2.3
#./configure–prefix=/usr/local/zlib
#make
#makeinstall3.安装openssl-0.9.8e#tarzxvfopenssl-0.9.8e.tar.gz
#cdopenssl-0.9.8e
#./configsharedzlib
#make
#maketest
#makeinstall
mv/usr/bin/openssl/usr/bin/openssl.OFF
mv/usr/include/openssl/usr/include/openssl.OFF
ln-s/usr/local/ssl/bin/openssl/usr/bin/openssl
ln-s/usr/local/ssl/include/openssl/usr/include/openssl配置库文件搜索路径#echo/usr/local/ssl/lib>>/etc/ld.so.conf
#ldconfig-v4.安装httpd-2.2.4#tarzxvfhttpd-2.2.4.tar.gz
#cdhttpd-2.2.4
#./configure–prefix=/usr/local/apache–sysconfdir=/etc/httpd–enable-so–enable-ssl–with-ssl=/usr/local/ssl–enable-track-vars–enable-rewrite–with-z-dir=/usr/local/zlib–enable-mods-shared=most
#make
#makeinstall#echo/usr/local/apache/bin/apachectlstart>>/etc/rc.local(系统启动时服务自动启动)5.安装libpng-1.2.14#tarzxvflibpng-1.2.14.tar.gz
#cdlibpng-1.2.14
#cpscripts/makefile.linuxmakefile
#make(若是提示找不到zlib库文件或者头文件,多半是makefile文件里zlib的默认路径有误。可编辑makefile文件,找到zlib项并重新指定路径到/usr/local/zlib/lib和/usr/local/zlib/include)。
#makeinstall6.安装freetype-2.1.10#tar-zvxffreetype-2.1.10.tar.gz
#cdfreetype-2.1.10
#mkdir-p/usr/local/freetype
#./configure–prefix=/usr/local/freetype
#make;makeinstall7.安装jpegsrc.v6bjpeg默认不会自建目录,因此需手动建立目录:
#mkdir-pv/usr/local/jpeg6/{,bin,lib,include,man/man1,man1}安装
#tarzxvfjpegsrc.v6b.tar.gz
#./configure–prefix=/usr/local/jpeg6/–enable-shared–enable-static
#make
#makeinstall
#makeinstall-lib8.安装libxml2-2.6.19#tar-zxflibxml2-2.6.19.tar.gz
#cdlibxml2-2.6.19
#mkdir-p/usr/local/libxml2
#./configure–prefix=/usr/local/libxml2
#make;makeinstall
#cpxml2-config/usr/bin9.安装GD-2.0.33库#tar-zvxfgd-2.0.33.tar.gz
#mkdir-p/usr/local/gd2
#cdgd-2.0.33
#./configure–prefix=/usr/local/gd2–with-jpeg=/usr/local/jpeg6/–with-png=/usr/local/lib/–with-zlib=/usr/local/zlib/–with-freetype=/usr/local/freetype/
#make;makeinstall10.安装php-5.2.1#tar-zvxfphp-5.2.1.tar.gz
#mkdir-p/usr/local/php
#cdphp-5.2.1
#./configure–prefix=/usr/local/php–with-apxs2=/usr/local/apache/bin/apxs–with-mysql=/usr/local/mysql–with-mysqli=/usr/local/mysql/bin/mysql_config–with-xml=/usr/local/libxml2–with-png=/usr/local/lib–with-jpeg-dir=/usr/local/jpeg6–with-zlib=/usr/local/zlib–with-freetype=/usr/local/freetype–with-gd=/usr/local/gd2–enable-track-vars–enable-mbstring=all
#make
#makeinstall
#cpphp.ini-dist/usr/local/php/lib/php.ini11.编辑apache配置文件httpd.conf

#vi/etc/httpd/httpd.conf
要改的有如下几处:
找到LoadModulephp5_modulemodules/libphp5.so
前面的#号去掉(默认已去掉注释)
#AddTypeapplication/x-gzip.gz.tgz
下加二行
AddTypeapplication/x-httpd-php.php
AddTypeapplication/x-httpd-php-source.phps
还有找到DirectoryIndexindex.html
加上index.php让它把index.php做为默认页按照使用习惯,这里将网站根目录指定到/var/www:
找到DocumentRoot/usr/local/apache/htdocs
修改为:DocumentRoot/var/www(后文中我们还会注释掉此行,以启用虚拟主机)找到<Directory/usr/local/apache/htdocs>
修改为:<Directory/var/www>12.测试PHP

#vi/var/www/index.php
添加:
<?
phpinfo();
?>

重新启动apache服务器
#/usr/local/apache/bin/apachectlrestart
浏览器里http://localhost/测试一下.

发表评论:

最近发表
网站分类
标签列表