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頁,還剩16頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、RedHat Linux AS 4下整合安裝mysql-5.1.37、apache-2.2.13、php-5.3.0與zendoptions并支持GD庫以下所有操作請注意是在root賬號權(quán)限下執(zhí)行。一、準備工作:首先查看系統(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、果沒有安裝的話,可以按照下面的步驟手動安裝: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 #

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

4、nstall/quote1.4 安裝Jpegrootlocalhost #tar zxvf jpegsrc.v6b.tar.gzrootlocalhost #cd jpeg-6b/rootlocalhost #./configure -enable-sharedrootlocalhost #makerootlocalhost #make testrootlocalhost # make install 注意:這里configure一定要帶-enable-shared參數(shù),不然,不會生成共享庫1.5安裝GDrootlocalhost #tar zxvf gd-2.0.33.tar.gzrootl

5、ocalhost # 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創(chuàng)建MYSQL用戶和組rootlocalhost mysql-5.1.37# groupadd mysqlrootlocalhost mysql-5.1.37# useradd -g mysql

6、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數(shù)據(jù)庫初始化相關(guān)操作rootlocalhost mysql-5.1.37# cd scripts/rootlocalhost scripts# ./mysql_install_db -user=mysqlrootloc

7、alhost scripts# cp ./support-files/f /etc/f編輯/etc/f,加入下面一行內(nèi)容:user = mysql 更改部分目錄權(quán)限,增強安全性。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 scrip

8、ts# vi /etc/ld.so.conf/usr/local/mysql/lib/mysql/usr/local/lib編輯完后載入庫rootlocalhost scripts# ldconfig -v2.7啟動數(shù)據(jù)庫rootlocalhost scripts# cd /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”和newpassw

9、ord之間必須有空格。2.9測試安裝結(jié)果,可有可無的一步*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*當(dāng)你看到以上內(nèi)容的時候,恭喜你,數(shù)據(jù)庫已經(jīng)安

10、裝成功了。三、安裝apache3.1解壓縮rootlocalhost #tar -zxvf httpd-2.2.13.tar.gz rootlocalhost #cd httpd-配置安裝路徑和加載方式,在此選擇動態(tài)加載方式,以便節(jié)約系統(tǒng)資源。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測

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

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

13、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 注意:一行寫不開時,請在行尾加上 ”換行,不想一點點敲入,復(fù)制粘貼時請先粘貼到記事本中去掉格式。如果沒錯誤的話,你將會看到以下內(nèi)容。*+-+| License: | This software is subject to the PHP License, available i

14、n 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 p

15、hp-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找到Dire

16、ctoryIndex一行修改為:DirectoryIndex index.htm index.php index.html5.3找到Options Index FollowSymLinks一行修改為:Options FollowSymLinks /出于安全性考慮,一般不顯示目錄文件列表。5.4找到以下兩行,修改默認文檔存放的位置:DocumentRoot /var/www/html5.5其他設(shè)置,如:修改默認服務(wù)端口、綁定IP等請參閱apache詳細配置文檔。重啟mysql、apache在/var/www/html下建一個phpinfo.php文件輸入用瀏覽器打開http:/server ip

17、/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

18、-i386# rootlocalhost ZendOptimizer-3.3.3-linux-glibc23-i386# ./install.sh按照提示一路yes就行了,zend options 安裝界面做的很友好。到此安裝過程已基本上結(jié)束,當(dāng)然還有許多后續(xù)的優(yōu)化工作需要做,在此暫不詳述了。2009年8月11日 原創(chuàng)fc6+apache+mysql+php+gd環(huán)境安裝經(jīng)過了2天的實驗與總結(jié),fc6+apache+mysql+php+gd環(huán)境總算是告一段落了,我一共安裝了3次,第三次成功了,其中要說的是在每次安裝的過程中都會遇到一些之前沒有遇到的問題,所以發(fā)了很多時間來分析,網(wǎng)上的一些方法中

19、有一些不是很正確,所以造成了一些錯誤,下面就把自己安裝成功的方法與大家分享!希望對需要這個環(huán)境的人有所幫助! 其中如有錯誤還望指證!一.環(huán)境所用到軟件及下載地址:apache-2.2.4 HYPERLINK /dist/httpd/httpd-2.2.4.tar.gz /dist/httpd/httpd-2.2.4.tar.gzmysql-5.0.22 HYPERLINK /download_file/rpm/5.0/MySQL-devel-5.0.22-0.i386.rpm /downloa . l-5.0.22-0.i386.rpm HYPERLINK /download_file/rpm

20、/5.0/MySQL-server-5.0.22-0.i386.rpm /downloa . r-5.0.22-0.i386.rpm HYPERLINK /download_file/rpm/5.0/MySQL-client-5.0.22-0.i386.rpm /downloa . t-5.0.22-0.i386.rpmphp-5.2.1 HYPERLINK /distributions/php-5.2.1.tar.bz2 /distributions/php-5.2.1.tar.bz2ZendOptimizer-3.2.8 HYPERLINK /optimizer/3.2.8/ZendOpt

21、imizer-3.2.8-linux-glibc21-i386.tar.gz /optimi . glibc21-i386.tar.gzGD-2.0.34 HYPERLINK /releases/gd-2.0.34.tar.gz /releases/gd-2.0.34.tar.gzGD庫支持libpng-1.2.18: HYPERLINK /sourceforge/libpng/libpng-1.2.18.tar.gz /s . ibpng-1.2.18.tar.gzlibxpm-3.5.5: HYPERLINK /distfiles/libXpm-3.5.5.tar.bz2 /distfil

22、es/libXpm-3.5.5.tar.bz2freetype-2.3.4: HYPERLINK /releases/freetype/freetype-2.3.4.tar.gz . eetype-2.3.4.tar.gzjpeg6: HYPERLINK /graphics/jpeg/jpegsrc.v6b.tar.gz?sid=Xj123i /graphics/jpeg/jpegsrc.v6b.tar.gz?sid=Xj123izlib-1.2.3: HYPERLINK /distfiles/zlib-1.2.3.tar.bz2 /distfiles/zlib-1.2.3.tar.bz2li

23、bxml-2.6.29 HYPERLINK /libxml2/libxml2-2.6.29.tar.gz /libxml2/libxml2-2.6.29.tar.gz二,安裝步驟前言:為了更好的管理服務(wù)器,最好是把它裝在一個統(tǒng)一的目錄,我的是除了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

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

25、.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.t

26、ar.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 -zx

27、f 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=/u

28、sr/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 .php (需要加的)# Example:# LoadModule foo_module modules/mod_foo.soLoadModule php5_module modules/libphp5.so (需要加的)Dir

溫馨提示

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

最新文檔

評論

0/150

提交評論