![[計(jì)算機(jī)]LAMP環(huán)境配置方法forCentOS_第1頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/19/5af2954b-062a-4e3f-a0a8-ef5138897f4c/5af2954b-062a-4e3f-a0a8-ef5138897f4c1.gif)
![[計(jì)算機(jī)]LAMP環(huán)境配置方法forCentOS_第2頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/19/5af2954b-062a-4e3f-a0a8-ef5138897f4c/5af2954b-062a-4e3f-a0a8-ef5138897f4c2.gif)
![[計(jì)算機(jī)]LAMP環(huán)境配置方法forCentOS_第3頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/19/5af2954b-062a-4e3f-a0a8-ef5138897f4c/5af2954b-062a-4e3f-a0a8-ef5138897f4c3.gif)
![[計(jì)算機(jī)]LAMP環(huán)境配置方法forCentOS_第4頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/19/5af2954b-062a-4e3f-a0a8-ef5138897f4c/5af2954b-062a-4e3f-a0a8-ef5138897f4c4.gif)
![[計(jì)算機(jī)]LAMP環(huán)境配置方法forCentOS_第5頁](http://file3.renrendoc.com/fileroot_temp3/2021-12/19/5af2954b-062a-4e3f-a0a8-ef5138897f4c/5af2954b-062a-4e3f-a0a8-ef5138897f4c5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、.經(jīng)過一天的時(shí)間終于搭建完成了,中間遇到了好多問題,比如編譯mysql我用哪個(gè)方法死活編譯不了,從網(wǎng)上找了個(gè)方法編譯成功了就是這句./configure -prefix=/usr/local/mysql -localstatedir=/usr/local/mysql/data本文測(cè)試環(huán)境為CentOS 5.0,如果使用Red Hat AS3/4則不能使用yum命令管理rpm包。一系統(tǒng)約定軟件源代碼包存放位置 /usr/local/src源碼包編譯安裝位置(prefix) /usr/local/soft
2、ware_name腳本以及維護(hù)程序存放位置 /usr/local/sbinMySQL 數(shù)據(jù)庫位置 /var/lib/mysqlApache 網(wǎng)站根目錄 /home/www/wwwrootApache 虛擬主機(jī)日志根目錄 /home/www/logsApache 運(yùn)行帳戶
3、 www:www二系統(tǒng)環(huán)境部署及調(diào)整1檢查系統(tǒng)是否正常 # more /var/log/messages (檢查有無系統(tǒng)級(jí)錯(cuò)誤信息) # dmesg (檢查硬件設(shè)備是否有錯(cuò)誤信息) # ifconfig(檢查網(wǎng)卡設(shè)置是否正確) # ping &
4、#160; (檢查網(wǎng)絡(luò)是否正常)2關(guān)閉不需要的服務(wù) # ntsysv 以下僅列出需要啟動(dòng)的服務(wù),未列出的服務(wù)一律關(guān)閉: atd crond irqbalance microcode_ctl network sendmail sshd syslog3重新啟動(dòng)系統(tǒng) # init 64配置 vim # vi
5、 /root/.bashrc 在 alias mv='mv -i' 下面添加一行:alias vi='vim' 保存退出。 # echo 'syntax on' > /root/.vimrc5使用yum程序安裝所需軟件包(以下為標(biāo)準(zhǔn)的RPM包名稱) # yum install ntp vim-enhanced gcc gcc-c+ flex bison autoconf automake bzip2-devel ncurses-devel libjpeg-devel l
6、ibpng-devel libtiff-devel freetype-devel pam-devel kernel6定時(shí)校正服務(wù)器時(shí)鐘,定時(shí)與中國國家授時(shí)中心授時(shí)服務(wù)器同步# crontab -e加入一行:*/30 * * * * ntpdate 47源代碼編譯安裝所需包(1) GD2 # cd /usr/local/src # wget /releases/oldreleases/gd-2
7、.0.34.tar.gz # tar xzvf gd-2.0.34.tar.gz # cd gd-2.0.34 # ./configure -prefix=/usr/local/gd2 # make # make install(2) Li
8、bXML2 # cd /usr/local/src # wget /libxml2/libxml2-2.6.29.tar.gz # tar xzvf libxml2-2.6.29.tar.gz # cd libxml2-2.6.29
9、 # ./configure -prefix=/usr/local/libxml2 # make # make install(3) LibMcrypt # cd /usr/local/src #wget # ta
10、r xjvf libmcrypt-2.5.8.tar.bz2 # cd libmcrypt-2.5.8 # ./configure prefix=/usr/local/libmcrypt # make # make install(4) Apache 日志截?cái)喑绦?#160;
11、 # cd /usr/local/src # wget /download/cronolog-1.6.2.tar.gz # tar xzvf cronolog-1.6.2.tar.gz # cd cronolog-1.6.2 #
12、./configure prefix=/usr/local/cronolog # make # make install8升級(jí)OpenSSL和OpenSSH # cd /usr/local/src # wget /source/openssl-0.9.8e.tar.gz #
13、wget /openssh/portable/openssh-4.6p1.tar.gz # tar xzvf openssl-0.9.8e.tar.gz # cd openssl-0.9.8e # ./config -prefix=/usr/local/openssl # make # make test
14、160; # make install # cd . # tar xzvf openssh-4.6p1.tar.gz # cd openssh-4.6p1 # ./configure "-prefix=/usr" "-with-pam" "-with-zlib" "-sysconfdir=/etc/s
15、sh" "-with-ssl-dir=/usr/local/openssl" "-with-md5-passwords" # make # make install(1)禁用 SSH V1 協(xié)議找到:#Protocol 2,1改為:Protocol 2(2)禁止root直接登錄此處先建立一個(gè)普通系統(tǒng)用戶: # useradd username # passwd username找到:#
16、PermitRootLogin yes改為:PermitRootLogin no(3)禁用服務(wù)器端GSSAPI找到以下兩行,并將它們注釋:GSSAPIAuthentication yesGSSAPICleanupCredentials yes(4)禁用 DNS 名稱解析找到:#UseDNS yeas改為:UseDNS no(5)禁用客戶端 GSSAPI# vi /etc/ssh/ssh_config找到:GSSAPIAuthentication yes將這行注釋掉。最后,確認(rèn)修改正確后重新啟動(dòng) SSH 服務(wù)# service sshd restart# ssh -v確認(rèn) OpenSSH 以及
17、OpenSSL 版本正確。三、編譯安裝L.A.M.P環(huán)境1. 下載軟件 # cd /usr/local/src # wget # wget # wget #wget 2. 編譯安裝MySQL # tar xzvf mysql-5.0.27.tar.gz # cd mys
18、ql-5.0.27 # ./configure "-prefix=/usr/local/mysql" "-localstatedir=/var/lib/mysql"
19、 (注意:/var 分區(qū)是否適合?) "-with-comment=Source" "-with-server-suffix=-Comsenz" "-with-mysqld-user=mysql"
20、0; "-without-debug" "-with-big-tables" "-with-charset="
21、; (此處設(shè)置MySQL默認(rèn)字符集) "-with-collation= " (此處設(shè)置MySQL校正字符集) "-with-extra-charsets=all"
22、 "-with-pthread" "-enable-static" "-enable-thread-safe-client" "-with-client-ldflags=-all-static" &
23、#160; "-with-mysqld-ldflags=-all-static" "-enable-assembler" "-without-isam" "-without-innod
24、b" "-without-ndb-debug" # make # make install # useradd mysql # cd /usr/local/mysql # bin/mysql_install_db -user=mysql
25、0; # chown -R root:mysql . # chown -R mysql /var/lib/mysql # cp share/mysql/my-f /etc/f # cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld # chmod 755 /etc/rc.d/init.d/mysqld
26、160; # chkconfig -add mysqld # chkconfig level 3 mysqld on # /etc/rc.d/init.d/mysqld start # bin/mysqladmin -u root password 'password_for_root'3. 編譯安裝Apache # cd /usr/local/src
27、 # tar xjvf httpd-2.2.4.tar.bz2 # cd httpd-2.2.4 # ./configure "-prefix=/usr/local/apache2" "-with-included-apr"
28、160; "-enable-so" "-enable-deflate=shared" "-enable-expires=shared" "-enable-rewrite=shared"
29、 "-enable-static-support" "-disable-userdir" # make # make install # echo '/usr/local/apache2/bin/apachectl star
30、t ' >> /etc/rc.local4. 編譯安裝PHP # cd /usr/local/src # tar xjvf php-5.2.3.tar.bz2 # cd php-5.2.3 # ./configure "-prefix=/usr/local/php"
31、 "-with-apxs2=/usr/local/apache2/bin/apxs" "-with-config-file-path=/usr/local/php/etc" "-with-mysql=/usr/local/mysql"
32、60; "-with-libxml-dir=/usr/local/libxml2" "-with-gd=/usr/local/gd2" "-with-jpeg-dir" "-with-
33、png-dir" "-with-bz2" "-with-freetype-dir" "-with-iconv-dir" "-with-z
34、lib-dir " "-with-openssl=/usr/local/openssl" "-with-mcrypt=/usr/local/libmcrypt" "-enable-soap" &
35、#160; "-enable-gd-native-ttf" "-enable-memory-limit" "-enable-ftp" "-enable-mbstring" &
36、#160; "-enable-exif" "-disable-ipv6" "-disable-cgi" "-disable-cli"
37、60;# make # make install # mkdir /usr/local/php/etc # cp php.ini-dist /usr/local/php/etc/php.ini5. 安裝Zend Optimizer # cd /usr/local/src # tar xzvf ZendOptimizer-3.2.8-linux-glibc21-i386
38、.tar.gz # ./ZendOptimizer-3.2.8-linux-glibc21-i386/install.sh 安裝Zend Optimizer過程的最后不要選擇重啟Apache。6. 整合Apache與PHP # vi /usr/local/apache2/conf/httpd.conf找到:AddType application/x-gzip .gz .tgz在該行下面添加AddType application/x-httpd-php .ph
39、p找到: DirectoryIndex index.html將該行改為 DirectoryIndex index.html index.htm index.php找到:#Include conf/extra/httpd-mpm.conf#Include conf/extra/httpd-info.conf#Include conf/extra/httpd-vhosts.conf#Include conf/extra/httpd-default.conf去掉前面的“#”號(hào),取消注釋。注意:以上 4 個(gè)擴(kuò)展
40、配置文件中的設(shè)置請(qǐng)按照相關(guān)原則進(jìn)行合理配置!修改完成后保存退出。# /usr/local/apache2/bin/apachectl restart7. 查看確認(rèn)L.A.M.P環(huán)境信息、提升 PHP 安全性 在網(wǎng)站根目錄放置 phpinfo.php 腳本,檢查phpinfo中的各項(xiàng)信息是否正確。 #vi phpinfo.php phpinfo(); ?> 確認(rèn) PHP 能夠正常工作后,在 php.ini 中進(jìn)行設(shè)置提升 PHP 安全性。 # vi /etc/php.ini 找到: disable_functions =
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 真假就業(yè)協(xié)議書
- 學(xué)生配餐協(xié)議書
- 擬招聘協(xié)議書
- 簽訂合理協(xié)議書
- 小米用戶協(xié)議書
- 瑞士國籍協(xié)議書
- 機(jī)械加工件品質(zhì)控制管理辦法
- 租房反恐協(xié)議書
- 配方使用協(xié)議書
- 校園公益協(xié)議書
- 2025屆山西中考語文真題試卷【含答案】
- 語言接觸與混合語現(xiàn)象-洞察及研究
- Q-GDW11628-2016新能源消納能力計(jì)算導(dǎo)則
- 維修工崗位考試題及答案
- 2026高考地理《地理原理》復(fù)習(xí)課件
- 關(guān)于新時(shí)代遼寧省國家大學(xué)科技園建設(shè)發(fā)展思路及模式的建議
- 2025叉車?yán)碚摽荚囋囶}及答案
- 2025年廣西公需科目答案03
- 礦井托管運(yùn)營方案(3篇)
- 《聚碳酸酯合成》課件
- 2025年中國不銹鋼寬幅網(wǎng)市場(chǎng)調(diào)查研究報(bào)告
評(píng)論
0/150
提交評(píng)論