Linux下web服務(wù)器環(huán)境搭建_第1頁
Linux下web服務(wù)器環(huán)境搭建_第2頁
Linux下web服務(wù)器環(huán)境搭建_第3頁
Linux下web服務(wù)器環(huán)境搭建_第4頁
Linux下web服務(wù)器環(huán)境搭建_第5頁
已閱讀5頁,還剩7頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、RedHat Linux AS 4下整合安裝mysql-5.1.37、apache-2.2.13、php-5.3.0與zendoptions并支持GD庫以下所有操作請(qǐng)注意是在root賬號(hào)權(quán)限下執(zhí)行。一、準(zhǔn)備工作:首先查看系統(tǒng)中是否已經(jīng)安裝了GD環(huán)境:rootlocalhost #rpm -qa | grep zlibrootlocalhost #rpm -qa | grep libpngrootlocalhost #rpm -qa | grep freetyperootlocalhost #rpm -qa | grep jpegrootlocalhost #rpm -qa | grep gd如

2、果沒有安裝的話,可以按照下面的步驟手動(dòng)安裝:1.1           安裝zlib rootlocalhost #tar zxvf zlib-1.2.2.tar.gzrootlocalhost #cd zlib-1.2.2rootlocalhost #./configurerootlocalhost #makerootlocalhost #make install 1.2 安裝libpngrootlocalhost #tar zxvf libpng-1.2.7.tar.ta

3、rrootlocalhost #cd libpng-1.2.7rootlocalhost #cd scripts/rootlocalhost #mv makefile.linux ./makefilerootlocalhost #cd .rootlocalhost #makerootlocalhost #make install注意,這里的makefile不是用./configure生成,而是直接從scripts/里復(fù)制一個(gè)。 1.3 安裝freetyperootlocalhost #tar zxvf freetype-2.1.9.tar.gzrootlocalhost #cd fr

4、eetype-2.1.9rootlocalhost #./configurerootlocalhost #makerootlocalhost #make install/quote 1.4 安裝Jpegrootlocalhost #tar zxvf jpegsrc.v6b.tar.gzrootlocalhost #cd jpeg-6b/rootlocalhost #./configure -enable-sharedrootlocalhost #makerootlocalhost #make testrootlocalhost # make install 注意:這里configur

5、e一定要帶-enable-shared參數(shù),不然,不會(huì)生成共享庫 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.37 

6、;2.2創(chuàng)建MYSQL用戶和組 rootlocalhost mysql-5.1.37# groupadd mysqlrootlocalhost mysql-5.1.37# useradd -g mysql mysql 2.3編譯前配置mysql 安裝路徑為/usr/local/mysql rootlocalhost mysql-5.1.37#./configure -prefix=/usr/local/mysql  2.4開始編譯 rootlocalhost mysql-5.1.37# make 2.5安裝 rootloca

7、lhost mysql-5.1.37# make install 2.6數(shù)據(jù)庫初始化相關(guān)操作 rootlocalhost mysql-5.1.37# cd scripts/rootlocalhost scripts# ./mysql_install_db -user=mysqlrootlocalhost scripts# cp ./support-files/my-f /etc/f編輯/etc/f,加入下面一行內(nèi)容:user = mysql 更改部分目錄權(quán)限,增強(qiáng)安全性。rootlocalhost scripts# chown -R root /usr/local/mysq

8、l/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啟動(dòng)數(shù)據(jù)庫 rootlocalhost scripts# c

9、d /usr/local/mysql/bin/ rootlocalhost bin# ./mysqld_safe -user=mysql & 2.8設(shè)置數(shù)據(jù)庫root密碼 rootlocalhost bin# mysqladmin -u root password 'new password' 注意“password”和newpassword之間必須有空格。 2.9測(cè)試安裝結(jié)果,可有可無的一步*rootlocalhost bin# mysql -uroot -pEnter password: Welcome to the MySQL mon

10、itor. Commands end with ; or g.Your MySQL connection id is 5 to server version: 5.1.37-log Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql> use mysqlDatabase changed*當(dāng)你看到以上內(nèi)容的時(shí)候,恭喜你,數(shù)據(jù)庫已經(jīng)安裝成功了。三、安裝apache3.1解壓縮 rootlocalhost #tar -zxvf httpd

11、-2.2.13.tar.gz rootlocalhost #cd httpd-2.2.13  3.2配置安裝路徑和加載方式,在此選擇動(dòng)態(tài)加載方式,以便節(jié)約系統(tǒng)資源。 rootlocalhost httpd-2.2.13#./configure -prefix=/usr/local/apache -enable-module=so 3.3編譯 rootlocalhost httpd-2.2.13# make 3.4安裝 rootlocalhost httpd-2.2.13# make install  3.5測(cè)試apache&

12、#160;rootlocalhost 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是整個(gè)過程中最簡單的,當(dāng)你看到以上內(nèi)容的時(shí)候表明你的apache已經(jīng)安裝成功了,。下面繼續(xù)安

13、裝PHP,安裝完php后再配置apache。四、安裝PHP4.1解壓縮 rootlocalhost # tar -zxvf php-5.3.0.tar.gz  4.2配置PHP安裝路徑 apache路徑和mysql路徑,其他內(nèi)容為支持GD庫的配置,如果還需要擴(kuò)展其他功能的話可以繼續(xù)添加,不是必要的功能盡量不要安裝,減少出現(xiàn)安全漏洞的機(jī)會(huì)。rootlocalhost # cd php-5.3.0rootlocalhost php-5.3.0# ./configure -prefix=/usr/local/php -with-mysql=/usr/local/mysql -wi

14、th-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 注意:一行寫不開時(shí),請(qǐng)?jiān)谛形布由?”換行,不想一點(diǎn)點(diǎn)敲入,復(fù)制粘貼時(shí)請(qǐng)先粘貼到記事本中去掉格式。如果沒錯(cuò)誤的話,你將會(huì)看到以下內(nèi)容。*+-+| License: | This software is subject to the PHP Licens

15、e, 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.*

16、4.3編譯rootlocalhost php-5.3.0# make 編譯完成后可以運(yùn)行一下make test看看是否有被忽略的錯(cuò)誤。 rootlocalhost php-5.3.0# make test 4.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-p

17、hp .php /讓apache將后綴為.php的文件交給PHP處理。 5.2找到DirectoryIndex一行修改為: DirectoryIndex index.htm index.php index.html 5.3找到Options Index FollowSymLinks一行修改為: Options FollowSymLinks /出于安全性考慮,一般不顯示目錄文件列表。 5.4找到以下兩行,修改默認(rèn)文檔存放的位置: DocumentRoot "/var/www/html"<Directory "/

18、var/www/html">5.5其他設(shè)置,如:修改默認(rèn)服務(wù)端口、綁定IP等請(qǐng)參閱apache詳細(xì)配置文檔。重啟mysql、apache在/var/www/html下建一個(gè)phpinfo.php文件輸入<? phpinfo(); ?>用瀏覽器打開http:/server ip/phpinfo.php測(cè)試是否安裝成功。六、安裝zend options注意:本次安裝使用的PHP5.3為較新版本,zendOptimizer-3.3.3并不支持,所以在安裝完后,看不到zendOptimize安裝成功信息,以下只是演示安裝過程。rootlocalhost # tar -zxv

19、f 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 安裝界面做的很友好。到此安裝過程已基本上結(jié)束,當(dāng)然還有許多后續(xù)的優(yōu)化工作需要做,在此暫不詳述了。&

20、#160;2009年8月11日 原創(chuàng)fc6+apache+mysql+php+gd環(huán)境安裝經(jīng)過了2天的實(shí)驗(yàn)與總結(jié),fc6+apache+mysql+php+gd環(huán)境總算是告一段落了,我一共安裝了3次,第三次成功了,其中要說的是在每次安裝的過程中都會(huì)遇到一些之前沒有遇到的問題,所以發(fā)了很多時(shí)間來分析,網(wǎng)上的一些方法中有一些不是很正確,所以造成了一些錯(cuò)誤,下面就把自己安裝成功的方法與大家分享!希望對(duì)需要這個(gè)環(huán)境的人有所幫助! 其中如有錯(cuò)誤還望指證!一.環(huán)境所用到軟件及下載地址:apache-2.2.4/dist/httpd/httpd-2.2.4.t

21、ar.gzmysql-5.0.22 . l-5.0.22-0.i386.rpm . r-5.0.22-0.i386.rpm . t-5.0.22-0.i386.rpmphp-5.2.1ZendOptimizer-3.2.8 . glibc21-i386.tar.gzGD-2.0.34/releases/gd-2.0.34.tar.gzGD庫支持libpng-1.2.18: . ibpng-1.2.18.tar.gzlibxpm-3.5.5:freetype-2.3.4: . eetype-2.3

22、.4.tar.gzjpeg6:ftp:/zlib-1.2.3:libxml-2.6.29/libxml2/libxml2-2.6.29.tar.gz二,安裝步驟前言:為了更好的管理服務(wù)器,最好是把它裝在一個(gè)統(tǒng)一的目錄,我的是除了mysql按默認(rèn)的目錄,其它都裝在/usr/local目錄下此時(shí)需要在local下建立以下目錄:zlib,php,apache,freetype,gd,jpeg6,libpng,libxml,libXpm1.安裝Apachetar xzvf httpd-2.2.4.tar.gzcd httpd-2.2.4./configure -pref

23、ix=/usr/local/apache -enable-somakemake install(把/usr/local/apache/bin/httpd拷到/usr/sbin目錄下,方便以后啟動(dòng)apache服務(wù)器)啟動(dòng)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 l

24、ibXpm-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 jpegsr

25、c.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安裝GD

26、tar -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/ (請(qǐng)指定及格插件的安裝路徑,否則安裝php的時(shí)候可能出錯(cuò)!)makemake install4.安裝PHPtar -jxvf php-5.2.1.tar.bz2cd php-5.2.1./configure -pr

27、efix=/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/li

28、b/php.ini5.編輯apache配置文件httpd.conf#vi /usr/local/apache2/conf/httpd.conf要改的有如下幾處:#AddType application/x-tar .tgzAddType application/x-httpd-php .php       (需要加的)# Example:# LoadModule foo_module modules/mod_foo.soLoadModule php5_module modules/libphp5.so    (需要加的)DirectoryIndex index.html index.php        (需要加的)在后面加 index.php 讓它把index.php做為默認(rèn)頁      #ServerName把#去掉,后面的IP改成你的IP.DocumentRo

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論