RHEL54LAMP編譯安裝_第1頁
RHEL54LAMP編譯安裝_第2頁
RHEL54LAMP編譯安裝_第3頁
RHEL54LAMP編譯安裝_第4頁
RHEL54LAMP編譯安裝_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、超詳細LAMP安裝轉(zhuǎn)自:以下文獻給那些被網(wǎng)上X人發(fā)的文章給誤導的朋友1、安裝mysql (mysql-standard-5.0.27-linux-i686-glibc23.tar.gz)安裝文件放到了/usr/local/src目錄1)#tar -zxvf mysql-standard-5.0.27-linux-i686-glibc23.tar.gz -C /usr/local/mysql2)#groupadd mysql 建mysql組3)#useradd -g mysql mysql 新增mysql用戶,并添加到mysql組4)#cd /usr/local/mysql5)#scripts/

2、mysql/mysql_install_db -user=mysql 創(chuàng)建mysql授權表,如果是mysql用戶登錄可省-user=mysql6)#chown -R root .     當前目錄下的文件的所有屬性改為root用戶7)#chown -R mysql data  將data數(shù)據(jù)目錄的所有屬性改為mysql用戶8)#chgrp -R mysql .     將組屬性改為mysql組9)#bin/mysqld_safe -user=mysql &10)#bin/mysqladm

3、in -u root password '123456'  設置密碼11)#cp support-files/my-f /etc/f數(shù)據(jù)庫目錄默認(/usr/local/var)13)#vi /etc/rc.d/rc.local 添加 /usr/local/mysql/bin/mysqld_safe -user=mysql & /自動啟動mysql服務附:mysql.server和mysqld_safe腳本和Mac OS X Startup Item可以用來手動啟動服務器,或自動啟動系統(tǒng)。mysql.server和Startup Item還可以用來停

4、止服務器。mysql.server腳本可以被用來啟動或停止服務器,通過用start或stop參數(shù)調(diào)用它: shell> mysql.server startshell> mysql.server stopmysql.server stop通過向服務器發(fā)出一個信號停止它。你可手動執(zhí)行mysqladmin shutdown關閉服務器。要想在服務器上自動啟動和停止MySQL,應在“/etc/rc * 文件中適當?shù)牡胤皆黾訂?、停止命令。要想手動安裝mysql.server(/usr/local/mysql/support-files),用名稱mysql將它復制到/etc/init.d目錄

5、,然后將它變?yōu)榭蓤?zhí)行文件。只需要將位置更改為mysql.serveris所在并執(zhí)行這些命令的相應目錄:shell> cp mysql.server /etc/init.d/mysqlshell> chmod +x /etc/init.d/mysqlshell> chkconfig -level 345MySQL on也可以在一個全局“/etc/f”文件中增加mysql.server的選項。一個典型的“/etc/f”文件可能看起來像這樣:mysql.serverbasedir=/usr/local/mysql2. 安裝OpenSSL#tar -zxvf openssl-0.9.

6、8e.tar.gz -C /usr/local/src/#cd openssl-0.9.8e#./config -prefix=/usr/local/openssl shared#make#make install修改(此步驟非常重要,至少對于現(xiàn)有的軟件版本)#vi /etc/ld.so.conf 添加一行/usr/local/openssl/lib/#/sbin/ldconfig3、安裝curl庫# tar -zxf curl-7.15.0.tar.gz -C /usr/local/src/#cd curl-7.15.0 # mkdir /usr/local/curl#

7、./configure -prefix=/usr/local/curl# make; make install安裝PCRE(目的是讓所裝的軟件支持perl正則表達式)#rpm -qa | grep pcre       /查詢系統(tǒng)中有沒有安裝PCRE,一般裝系統(tǒng)是默認裝有,所以我們要刪掉系統(tǒng)自帶的#cp /lib/libpcre.so.0 /             /在刪除系統(tǒng)自帶的PCRE之前,要先備份

8、一下libpcre.so.0這個文件,因為RPM包的關聯(lián)性太強,在刪除后沒libpcre.so.0這個文件時我們裝PCRE是裝不上的#rpm -e -nodeps pcre-6.6-1.1 /刪除系統(tǒng)自帶的PCRE# tar -zxvf pcre-8.00.tar.gz -C /usr/local/src/#cd /usr/local/src/pcre-8.00#cp /libpcre.so.0 /lib/               /把我們刪

9、除系統(tǒng)自帶的PCRE之前備份的libpcre.so.0拷貝到/lib 目錄下。#./configure           /配置PCRE,因為PCRE是一個庫,而不是像pache、php、postfix等這樣的程序,所以我們安裝時選擇默認路徑即可。#make && make install4、安裝expat#tar -zxvf expat-2.0.0.tar.gz -C /usr/local/src/#cd expat-2.0.0#mkdik /usr/local/expat#./con

10、figure -prefix=/usr/local/expat#make;make install5、gzip安裝#tar -zxvf gzip-1.3.5.tar.gz -C /usr/local/src/#cd gzip-1.3.5#mkdir /usr/local/gzip#./configure -prefix=/usr/local/gzip#make;make install6、安裝ncurses(安裝gd庫會用到的)#tar zxvf ncurses-5.6.tar.gz -C /usr/local/src# cd /usr/local/src/ncurses-5.6/#./con

11、figure -prefix=/usr -with-shared -without-debug#make;make install1. zlib(默認安裝,請勿自作主張修改)# tar zxvf zlib-1.2.3.tar.gz -C /usr/local/src/# cd /usr/local/src/zlib-1.2.3/# ./configure -shared 生成zlib的共享庫文件# make ; make install 2.libpng# tar zxvf libpng-1.2.26.tar.gz -C /usr/local/src/# cd /usr/l

12、ocal/src/libpng-1.2.26/# cp scripts/makefile.linux ./makefile /注意,這里的makefile不是用./configure生成,而是直接從scripts/里拷一個# make ; make install3.freetype(ttf)# tar zxvf freetype-2.3.5.tar.gz -C /usr/local/src# cd /usr/local/src/freetype-2.3.5/# ./configure -prefix=/usr/local/freetype# make ; make install4.jpeg

13、src# tar -zxvf jpegsrc.v6b.tar.gz -C /usr/local/src/# cd /usr/local/src/jpeg-6b/# mkdir -pv /usr/local/libjpeg/,bin,lib,include,man/man1,man1上面的命令是要手動創(chuàng)建一些目錄,否則configure時候會說找不到目錄# ./configure -prefix=/usr/local/libjpeg -enable-shared -enable-static注意,這里configure一定要帶-enable-shared參數(shù),不然,不會生成共享庫# make ;

14、 make install# make install-lib  /以前因為沒有執(zhí)行這一步安裝導致在編譯php時報錯5. 安裝libxml2# tar -zxvf libxml2-2.6.31.tar.gz -C /usr/local/src/# cd /usr/local/src/libxml2-2.6.31/# ./configure -prefix=/usr/local/libxml2 (xml默認安裝就可以,不要指定路徑了,因為安裝時php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)# make ; make install# cp xml2-

15、config /usr/bin/6.libmcrypt# tar -zxvf libmcrypt-2.5.7.tar.gz -C /usr/local/src/# cd /usr/local/src/libmcrypt-2.5.7/# ./configure# make ; make install#cd libmcrypt-2.5.8/libltdl#./configure -enable-ltdl-install#make #make install注意:不安裝libltdl會導致php編譯通不過7. 安裝fontconfig# tar -zxvf fontconfig-2.4.2.tar

16、.gz -C /usr/local/src/# cd /usr/local/src/fontconfig-2.4.2/# ./configure -prefix=/usr/local/fontconfig -with-freetype-config=/usr/local/freetype/bin/freetype-config如果報錯: checking for LIBXML2. configure: error: Package requirements (libxml-2.0 >= 2.6) were not met: No package 'libxml-2.0&

17、#39; foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables LIBXML2_CFLAGSand LIBXML2_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details. 但是我們在上面其

18、實已經(jīng)安裝上 libxml2 了的,這里只是一個環(huán)境變量沒有設置好而已。解決辦法: 確定 /usr/local/libxml2/lib/pkgconfig 目錄下有 libxml-2.0.pc#export PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH然后#./configure -prefix=/usr/local/fontconfig -with-freetype-config=/usr/local/freetype/bin/freetype-config好了吧,沒有出現(xiàn)那個錯誤了。# make ; ma

19、ke install8. 安裝 xpmrootddl htdocs# rpm -qa | grep xpmlibxpm-devel-3.5.5-3libxpm-3.5.5-3安裝xpm#tar -zxf xpm-3.4k.tar.gz -C /usr/local/src/#cd /usr/local/src/ xpm-3.4k#xmkmf a如果上一句不行則執(zhí)行:                xmkmf   

20、60;            make Makefiles                make includes                make depend 接下來執(zhí)行:#ma

21、kewhich will build the XPM library and the sxpm application. Then do:                 make install                make install.manwhich will install t

22、he library and the sxpm program and man page.12、安裝 libxslt# tar -zxf libxslt-1.1.15.tar.gz# cd libxslt-1.1.15#mkdir /usr/local/libxslt# ./configure -prefix=/usr/local/libxslt -with-libxml-prefix=/usr/local/libxml2 # make; make install9.安裝GD庫,我們把這一步放在最后面# tar -zxvf gd-2.0.35.tar.gz -C /usr/local

23、/src/# cd /usr/local/src/gd-2.0.35/# ./configure -prefix=/usr/local/libgd -with-png -with-zlib -with-freetype=/usr/local/freetype -with-jpeg=/usr/local/libjpeg -with-fontconfig=/usr/local/fontconfig -enable-m4_pattern_allow 下面出現(xiàn):表示都支持了 * Configuration summary for gd 2.0.34:   Sup

24、port for PNG library:          yes   Support for JPEG library:         yes   Support for Freetype 2.x library: yes   Support for Fontconfig library:   yes   Support

25、for Xpm library:          yes   Support for pthreads:             yes#cp gd.h /usr/local/lib /編譯PHP的時候缺少這個文件會出錯#cp /usr/local/libpng/include/png.h ./#cp /usr/local/libpng/include/pngcon

26、f.h ./# make ; make install 編輯/etc/ld.so.conf,添加以下幾行到此文件中:    /usr/local/zlib/lib    /usr/local/freetype/lib    /usr/local/libjpeg/lib    /usr/local/libgd/lib    并執(zhí)行l(wèi)dconfig命令,使用動態(tài)裝入器裝載找到共享庫 

27、;14、Apache安裝1、解壓,mkdir /usr/local/apache2 2、進入解壓后的目錄(菜鳥請嚴格按下面的參考)#./configure -prefix=/usr/local/apache2 -with-mysql=/usr/local/mysql  -enable-cgi -enable-ssl -with-ssl=/usr/local/openssl (-enable-so)這個參數(shù)適應的進行添加 -enable-rewrite -enable-modules=all -enable-mods-shared=all#make #make install

28、 在/etc/rc.d/rc.local文件中加入一行 /usr/local/apache/bin/apachectl start 這樣每次重新啟動系統(tǒng)以后,apache也會隨系統(tǒng)一起啟動. (注解:./configure /配置源代碼樹-prefix=/usr/local/apache2 /Apache的安裝目錄。-enable-module=so /打開 so 模塊,so 模塊是用來提 DSO 支持的 apache 核心模塊-enable-deflate=shared /支持網(wǎng)頁壓縮-enable-expires=shared /支持 HTTP 控制-enable-rewrite=shar

29、ed /支持 URL 重寫-enable-cache /支持緩存-enable-file-cache /支持文件緩存-enable-mem-cache /支持記憶緩存-enable-disk-cache /支持磁盤緩存-enable-static-support /支持靜態(tài)連接(默認為動態(tài)連接)-enable-static-htpasswd /使用靜態(tài)連接編譯 htpasswd - 管理用于基本認證的用戶文件-enable-static-htdigest /使用靜態(tài)連接編譯 htdigest - 管理用于摘要認證的用戶文件-enable-static-rotatelogs /使用靜態(tài)連接編譯

30、rotatelogs - 滾動 Apache 日志的管道日志程序-enable-static-logresolve /使用靜態(tài)連接編譯 logresolve - 解析 Apache 日志中的IP地址為主機名-enable-static-htdbm /使用靜態(tài)連接編譯 htdbm - 操作 DBM 密碼數(shù)據(jù)庫-enable-static-ab /使用靜態(tài)連接編譯 ab - Apache HTTP 服務器性能測試工具-enable-static-checkgid /使用靜態(tài)連接編譯 checkgid-disable-cgid /禁止用一個外部 CGI 守護進程執(zhí)行CGI腳本-disable-cgi

31、 /禁止編譯 CGI 版本的 PHP-disable-userdir /禁止用戶從自己的主目錄中提供頁面-with-mpm=worker / 讓apache以worker方式運行-enable-authn-dbm=shared / 對動態(tài)數(shù)據(jù)庫進行操作。Rewrite時需要。)15、安裝php# tar -zxvf php-5.2.6.tar.gz# cd php-5.2.6#mkdir /usr/local/php5 # ./configure -prefix=/usr/local/php5    -with-apxs2=/usr/local/apache2/bin/ap

32、xs    -with-freetype-dir=/usr/local/freetype    -with-mysql=/usr/local/mysql    -with-zlib-dir    -with-libxml-dir=/usr/local/libxml2    -enable-shared    -with-curl=/usr/local/curl    -with-iconv    -enable-mbstring 

33、60;  -with-gd=/usr/local/libgd    -enable-gd-native-ttf    -enable-gd-jis-conv    -with-jpeg-dir=/usr/local/libjpeg    -with-png-dir    -enable-ftp    -enable-soap    -with-mcrypt=/usr/local/libmcrypt    -enable-soc

34、kets     -enable-force-cgi-redirect    -enable-inline-optimization    -disable-debug    -with-libexpat-dir=/usr/local/expat    -with-xsl=/usr/local/libxslt    -with-openssl=/usr/local/openssl    -enable-calendar   &

35、#160;-with-config-file-path=/usr/local/php5/etc #make;make install#cp php.ini-dist  /usr/local/php5/etc/php.ini #vi /usr/local/php5/etc/php.ini查找safe_mode=Off,更改為safe_mode=On (1)查找max_execution_time = 30,更改為max_execution_time = 600   (2)查找max_input_time = 60,更改為max_input_time = 6

36、00 (3)查找memory_limit = 8M ,更改為memory_limit = 20M (4)查找display_errors = On,更改為display_errors = Off (5)查找register_globals = Off,更改為register_globals = On (6)查找post_max_size = 8M,更改為post_max_size = 20M (7)查找upload_max_filesize = 2M,更改為upload_max_filesize = 20M (8)查找session.auto_start = 0,更改為session.auto

37、_start = 1 執(zhí)行:wq!命令保存后退出,從而完成了php.ini文件的配置工作。 更改apache的配制文件,目的是讓apache能解釋php程序。 查找AddType application/x-tar .tgz  行,在下面添加 AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 AddType application/x-httpd-php .phtml AddType application/x-httpd-php-source .phps 找到下面一行在后面

38、加上index.php,這表示網(wǎng)站的默認頁也能夠為index.php DirectoryIndex index.html index.html.var index.php 現(xiàn)在apache就能夠運行php了,寫個文件測試一下,在/usr/local/apache/htdocs目錄下,新建一個phpinfo.php文件,文件中只有一行代碼:<? phpinfo(); ?>保存此文件, 在你的瀏覽器中輸入http:/localhost/phpinfo.php,你應該看到PHP的系統(tǒng)信息。如果出現(xiàn)錯誤,比如提示你下載phpinfo.php,那么apache就是還無法解析php文件,那么請

39、仔細檢查以上的操作是否正確.  16、安裝ZendOptimizer   # tar zxvf ZendOptimizer*-i386.tar.gz# cd ZendOptimizer*-i386# ./install.sh安裝操作: ok -> EXIT -> YES -> /httpd/zend -> /httpd/apache/conf -> yes -> OK -> OK -> NO17、安裝phpmyadmin1、解壓2、mv phpmyadmin* /usr/local/apache2/htdo

40、cs/phpmyadmin3、進入phpmyadmin目錄,cp ./libraries/config.default.php ./config.inc.php4、# vi config.inc.php   /修改成如下:查找 $cfg'PmaAbsoluteUri' 修改為你將上傳到空間的phpMyAdmin的網(wǎng)址 如:$cfg'PmaAbsoluteUri' = '1/onlyyouknow/' 查找 $cfg'Servers'$i'auth_type' =

41、 'config' 在自己的機子里調(diào)試用config;如果在網(wǎng)絡上的空間用cookie,這里我們既然在前面已經(jīng)添加了網(wǎng)址,就修改成cookie ,這里建議使用cookie.查找 $cfg'Servers'$i'user' = 'root'將root去掉 / MySQL user(mysql用戶名,自己機里用root;) 查找 $cfg'Servers'$i'password' = '' / MySQL password (mysql用戶的密碼,自己的服務器一般都是mysql用戶roo

42、t的密碼) 查找 $cfg'Servers'$i'only_db' = '' / If set to a db-name, only(你只有一個數(shù)據(jù)就設置一下;如果你在本機或想架設服務器,那么建議留空) 查找 $cfg'DefaultLang' = 'zh' (這里是選擇語言,zh代表簡體中文的意思,這里不知道填gbk對否) 設置完畢后保存 如果出現(xiàn)“配置文件現(xiàn)在需要絕密的短語密碼(blowfish_secret)”那么請在$cfg'blowfish_secret' = ' '的等號

43、里面設置你網(wǎng)站的cookie,例如:$cfg'blowfish_secret' = '任意字符'這是因為你的“$cfg'Servers'$i'auth_type' = 'cookie'的原因。 18、安裝eAccelerator#tar -jxvf ./eaccelerator-0.9.5-beta2.tar.bz2#cd eaccelerator-0.9.5-beta2#export PHP_PREFIX="/usr/local" (把PHP安裝目錄導入到環(huán)境變量,F(xiàn)reeBSD默認是/usr

44、/local)#$PHP_PREFIX/bin/phpize#./configure -enable-eaccelerator=shared -with-php-config=$PHP_PREFIX/bin/php-config#make#make install在/usr/local/php5/etc/php.ini文件的Zend下添加先查找extension_dir,改路徑為"/usr/local/php5/lib/php/extensions/"extension="eaccelerator.so"eaccelerator.shm_size=&qu

45、ot;32"    解釋:eaccelerator可使用的共享內(nèi)存大小(單位為MB)。eaccelerator.cache_dir="/tmp/eaccelerator"  解釋:緩存路徑eaccelerator.enable="1"  解釋:打開或者關閉eaccelerator。"1"指打開,"0"指關閉。默認值為"1"。eaccelerator.optimizer="1"  解釋:打

46、開或者關閉代碼優(yōu)化,開啟可以加快代碼的執(zhí)行速度。"1"指打開,"0"指關閉。默認值為"1"。eaccelerator.check_mtime="1" 解釋:當打開此項時,eaccelerator會在每次請求時檢查php文件的修改時間,看其是否被修改過,這會耗費一點時間,如果php文件被修改過,eaccelerator會重新編譯緩存該php文件。當關閉此項時,如果php文件被修改,則需要手工刪eaccelerator緩存,才能顯示被修改的php文件。"1"指打開,"0"指關閉。

47、默認值為"1"。eaccelerator.debug="0"  解釋:打開或者關閉調(diào)試記錄。當打開時,eaccelerator會將對一個緩存文件的每次請求都寫進 log。打開此項只對調(diào)試eaccelerator是否有BUG時有益處。"1"指打開,"0"指關閉。默認值為"0"。eaccelerator.log_file="/usr/local/apache2/logs/eaccelerator_log"  日志文件eaccelerator

48、.filter=""     解釋:決定哪些PHP文件應該被緩存。可以指定一個范圍(比如"*.php *.phtml"),這樣被指定的文件就會被緩存。如果該范圍以!開頭,被指定的文件就不會被緩存。默認值為"",表示緩存所有的PHP文件。 eaccelerator.shm_max="0"   解釋:一個用戶使用例如eaccelerator_put之類的函數(shù)能夠往共享內(nèi)存中加載的最大數(shù)據(jù)。默認值為"0",表示不限制。(單位為字節(jié))eacce

49、lerator.shm_ttl="0"   解釋:當沒有足夠的空閑共享內(nèi)存去嘗試緩沖一個新腳本時,將刪除至少在shm_ttl秒之前沒有被訪問過的文件。默認值為"0",表示不嘗試從共享內(nèi)存中刪除任何舊的腳本。(單位為秒)eaccelerator.shm_prune_period="0"  解釋:當沒有足夠的空閑共享內(nèi)存去嘗試緩沖一個新腳本時,將刪所有舊腳本,前提是這個嘗試在超過shm_prune_period秒之前被執(zhí)行過。默認值為"0",表示不嘗試從共享內(nèi)存中刪除任何舊的腳本。(單位為秒)eaccelerator.shm_only="0"  解釋:打開或者關閉在磁盤上緩存編譯過的腳本。這個參數(shù)對會話數(shù)據(jù)和內(nèi)容緩存沒有效果。默認值為"0",表示使用磁盤和共享內(nèi)存來緩存。press="1"  解釋:打開或者關閉緩存內(nèi)容壓縮。"1"指打開,"0"

溫馨提示

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

評論

0/150

提交評論