Linu_下web服务器环境搭建.doc_第1页
Linu_下web服务器环境搭建.doc_第2页
Linu_下web服务器环境搭建.doc_第3页
Linu_下web服务器环境搭建.doc_第4页
Linu_下web服务器环境搭建.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

RedHat Linux AS 4下整合安装mysql-5.1.37、apache-2.2.13、php-5.3.0与zendoptions并支持GD库以下所有操作请注意是在root账号权限下执行。一、准备工作:首先查看系统中是否已经安装了GD环境:rootlocalhost #rpm -qa | grep zlibrootlocalhost #rpm -qa | grep libpngrootlocalhost #rpm -qa | grep freetyperootlocalhost #rpm -qa | grep jpegrootlocalhost #rpm -qa | grep gd如果没有安装的话,可以按照下面的步骤手动安装:1.1 安装zlibrootlocalhost #tar zxvf zlib-1.2.2.tar.gzrootlocalhost #cd zlib-1.2.2rootlocalhost #./configurerootlocalhost #makerootlocalhost #make install1.2 安装libpngrootlocalhost #tar zxvf libpng-1.2.7.tar.tarrootlocalhost #cd libpng-1.2.7rootlocalhost #cd scripts/rootlocalhost #mv makefile.linux ./makefilerootlocalhost #cd .rootlocalhost #makerootlocalhost #make install注意,这里的makefile不是用./configure生成,而是直接从scripts/里复制一个。1.3 安装freetyperootlocalhost #tar zxvf freetype-2.1.9.tar.gzrootlocalhost #cd freetype-2.1.9rootlocalhost #./configurerootlocalhost #makerootlocalhost #make install/quote1.4 安装Jpegrootlocalhost #tar zxvf jpegsrc.v6b.tar.gzrootlocalhost #cd jpeg-6b/rootlocalhost #./configure -enable-sharedrootlocalhost #makerootlocalhost #make testrootlocalhost # make install 注意:这里configure一定要带-enable-shared参数,不然,不会生成共享库1.5安装GDrootlocalhost #tar zxvf gd-2.0.33.tar.gzrootlocalhost # cd gd-2.0.33rootlocalhost # ./configure -with-png -with-freetype -with-jpegrootlocalhost # make install二、安装mysql2.1解压缩rootlocalhost # unzip mysql-5.1.37.zip rootlocalhost # cd mysql-5.1.372.2创建MYSQL用户和组rootlocalhost mysql-5.1.37# groupadd mysqlrootlocalhost mysql-5.1.37# useradd -g mysql mysql2.3编译前配置mysql 安装路径为/usr/local/mysqlrootlocalhost mysql-5.1.37#./configure -prefix=/usr/local/mysql 2.4开始编译rootlocalhost mysql-5.1.37# make2.5安装rootlocalhost mysql-5.1.37# make install2.6数据库初始化相关操作rootlocalhost mysql-5.1.37# cd scripts/rootlocalhost scripts# ./mysql_install_db -user=mysqlrootlocalhost scripts# cp ./support-files/f /etc/f编辑/etc/f,加入下面一行内容:user = mysql 更改部分目录权限,增强安全性。rootlocalhost scripts# chown -R root /usr/local/mysql/rootlocalhost scripts# chown -R mysql /usr/local/mysql/varrootlocalhost scripts# chgrp -R mysql /usr/local/mysql/编辑/etc/ld.so.conf并加入以下两行:rootlocalhost scripts# vi /etc/ld.so.conf/usr/local/mysql/lib/mysql/usr/local/lib编辑完后载入库rootlocalhost scripts# ldconfig -v2.7启动数据库rootlocalhost scripts# cd /usr/local/mysql/bin/ rootlocalhost bin# ./mysqld_safe -user=mysql &2.8设置数据库root密码rootlocalhost bin# mysqladmin -u root password new password 注意“password”和newpassword之间必须有空格。2.9测试安装结果,可有可无的一步*rootlocalhost bin# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 5 to server version: 5.1.37-logType help; or h for help. Type c to clear the buffer.mysql use mysqlDatabase changed*当你看到以上内容的时候,恭喜你,数据库已经安装成功了。三、安装apache3.1解压缩rootlocalhost #tar -zxvf httpd-2.2.13.tar.gz rootlocalhost #cd httpd-2.2.13 3.2配置安装路径和加载方式,在此选择动态加载方式,以便节约系统资源。rootlocalhost httpd-2.2.13#./configure -prefix=/usr/local/apache -enable-module=so3.3编译rootlocalhost httpd-2.2.13# make3.4安装rootlocalhost httpd-2.2.13# make install 3.5测试apacherootlocalhost httpd-2.2.13#/usr/local/apache/bin/apachectl start &rootlocalhost bin# ps -A | grep httpd*17971 ? 00:00:00 httpd17972 ? 00:00:00 httpd17973 ? 00:00:00 httpd17974 ? 00:00:00 httpd17975 ? 00:00:00 httpd17976 ? 00:00:00 httpd*安装apache是整个过程中最简单的,当你看到以上内容的时候表明你的apache已经安装成功了,。下面继续安装PHP,安装完php后再配置apache。四、安装PHP4.1解压缩rootlocalhost # tar -zxvf php-5.3.0.tar.gz 4.2配置PHP安装路径 apache路径和mysql路径,其他内容为支持GD库的配置,如果还需要扩展其他功能的话可以继续添加,不是必要的功能尽量不要安装,减少出现安全漏洞的机会。rootlocalhost # cd php-5.3.0rootlocalhost php-5.3.0# ./configure -prefix=/usr/local/php -with-mysql=/usr/local/mysql -with-apxs2=/usr/local/apache/bin/apxs with -gd -enable-gd-native-ttf -enable-gd-jis-conv -with-freetype-dir -with-jpeg-dir -with-png-dir -with-zlib -enable-xml -enable-mbstring 注意:一行写不开时,请在行尾加上 ”换行,不想一点点敲入,复制粘贴时请先粘贴到记事本中去掉格式。如果没错误的话,你将会看到以下内容。*+-+| License: | This software is subject to the PHP License, available in this | distribution in the file LICENSE. By continuing this installation | process, you are bound by the terms of this license agreement. | If you do not agree with the terms of this license, you must abort | the installation process at this point. |+-+Thank you for using PHP.*4.3编译rootlocalhost php-5.3.0# make编译完成后可以运行一下make test看看是否有被忽略的错误。rootlocalhost php-5.3.0# make test4.4安装rootlocalhost php-5.3.0# make install五、安装完php后开始配置apache编辑apache的配置文件httpd.confrootlocalhost php-5.3.0vi /usr/local/apahe/conf/httpd.conf5.1加上AddType application/x-httpd-php .php /让apache将后缀为.php的文件交给PHP处理。5.2找到DirectoryIndex一行修改为:DirectoryIndex index.htm index.php index.html5.3找到Options Index FollowSymLinks一行修改为: Options FollowSymLinks /出于安全性考虑,一般不显示目录文件列表。5.4找到以下两行,修改默认文档存放的位置:DocumentRoot /var/www/html5.5其他设置,如:修改默认服务端口、绑定IP等请参阅apache详细配置文档。重启mysql、apache在/var/www/html下建一个phpinfo.php文件输入用浏览器打开http:/server ip/phpinfo.php测试是否安装成功。六、安装zend options注意:本次安装使用的PHP5.3为较新版本,zendOptimizer-3.3.3并不支持,所以在安装完后,看不到zendOptimize安装成功信息,以下只是演示安装过程。rootlocalhost # tar -zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz rootlocalhost # cd ZendOptimizer-3.3.3-linux-glibc23-i386rootlocalhost ZendOptimizer-3.3.3-linux-glibc23-i386# rootlocalhost ZendOptimizer-3.3.3-linux-glibc23-i386# ./install.sh按照提示一路yes就行了,zend options 安装界面做的很友好。到此安装过程已基本上结束,当然还有许多后续的优化工作需要做,在此暂不详述了。2009年8月11日 原创fc6+apache+mysql+php+gd环境安装经过了2天的实验与总结,fc6+apache+mysql+php+gd环境总算是告一段落了,我一共安装了3次,第三次成功了,其中要说的是在每次安装的过程中都会遇到一些之前没有遇到的问题,所以发了很多时间来分析,网上的一些方法中有一些不是很正确,所以造成了一些错误,下面就把自己安装成功的方法与大家分享!希望对需要这个环境的人有所帮助! 其中如有错误还望指证!一.环境所用到软件及下载地址:apache-2.2.4/dist/httpd/httpd-2.2.4.tar.gzmysql-5.0.22/downloa . l-5.0.22-0.i386.rpm/downloa . r-5.0.22-0.i386.rpm/downloa . t-5.0.22-0.i386.rpmphp-5.2.1/distributions/php-5.2.1.tar.bz2ZendOptimizer-3.2.8/optimi . glibc21-i386.tar.gzGD-2.0.34/releases/gd-2.0.34.tar.gzGD库支持libpng-1.2.18:/s . ibpng-1.2.18.tar.gzlibxpm-3.5.5:/distfiles/libXpm-3.5.5.tar.bz2freetype-2.3.4: . eetype-2.3.4.tar.gzjpeg6:/graphics/jpeg/jpegsrc.v6b.tar.gz?sid=Xj123izlib-1.2.3:/distfiles/zlib-1.2.3.tar.bz2libxml-2.6.29/libxml2/libxml2-2.6.29.tar.gz二,安装步骤前言:为了更好的管理服务器,最好是把它装在一个统一的目录,我的是除了mysql按默认的目录,其它都装在/usr/local目录下此时需要在local下建立以下目录:zlib,php,apache,freetype,gd,jpeg6,libpng,libxml,libXpm1.安装Apachetar xzvf httpd-2.2.4.tar.gzcd httpd-2.2.4./configure -prefix=/usr/local/apache -enable-somakemake install(把/usr/local/apache/bin/httpd拷到/usr/sbin目录下,方便以后启动apache服务器)启动service httpd start2.安装MySQLrpm -ivh MySQL-devel-5.0.22-0.i386.rpmrpm -ivh MySQL-server-5.0.22-0.i386.rpmrpm -ivh MySQL-client-5.0.22-0.i386.rpm3.安装GD安装libXpmtar -zxf libXpm-3.5.5.tar.bz2cd libXpm-3.5.5./configure -prefix=/usr/local/libxpmmake make install安装libxmltar -zxf libxml2-2.6.29.tar.gzcd libxml2-2.6.29./configure -prefix=/usr/local/libxmlmake make install安装zlibtar -jxf libxml2-2.6.29.tar.gzcd libxml2-2.6.29./configure -prefix=/usr/local/zlibmake make install安装jpegtar -zxf jpegsrc.v6b.tar.gzcd jpegsrc.v6b./configure -prefix=/usr/local/jpeg6make make install安装freetypetar -zxf freetype-2.3.4.tar.gzcd freetype-2.3.4./configure -prefix=/usr/local/freetypemake make install安装pngtar -zxf libpng-1.2.18.tar.gzcd libpng-1.2.18./configure -prefix=/usr/local/libpngmake make install安装GDtar -zxf gd-2.0.34.tar.gzcd gd-2.0.34./configure -prefix=/usr/local/gd -with-zlib=/usr/local/zlib/ -with-png=/usr/local/libpng/ -with-jpeg=/usr/local/jpeg6/ -with-freetype=/usr/local/freetype/ (请指定及格插件的安装路径,否则安装php的时候可能出错!)makemake install4.安装PHPtar -jxvf php-5.2.1.tar.bz2cd php-5.2.1./configure -prefix=/usr/local/php -with-zlib-dir=/usr/local/zlib/ -with-apxs2=/usr/local/apache/bin/apxs -with-jpeg-dir=/usr/local/jpeg6/ -with-png-dir=/usr/local/libpng/ -with-gd=/usr/local/gd/ -with-freetype-dir=/usr/local/freetype/ -with-mysql -enable-trace-varsmakemake installcp php.ini-dist /usr/local/php/lib/php.ini5.编辑apache配置文件httpd.conf#vi /usr/local/apache2/conf/httpd.conf要改的有如下几处:#AddType application/x-tar .tgzAddType application/x-httpd-php .ph

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论