本篇內容主要講解“l(fā)inux怎么構建動(dòng)態(tài)WEB”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強。下面就讓小編來(lái)帶大家學(xué)習“l(fā)inux怎么構建動(dòng)態(tài)WEB服務(wù)器”吧!
基本配置
安裝web服務(wù)器:httpd-2.X.X
先優(yōu)化吧
根據CPU設置變量
#export CFLAGS=”-O2 -march=pentium4 -pipe” && CXXFLAGS=$CFLAGS
“-march”選項表示為特定的cpu類(lèi)型編譯二進(jìn)制代碼(不能在更低級別的cpu上運行),
Intel通常是:pentium2, pentium3, pentium3m, pentium4, pentium4m, pentium-m, prescott, nocona
說(shuō)明:pentium3m/pentium4m是筆記本用的移動(dòng)P3/P4;pentium-m是迅馳I/II代筆記本的cpu;
prescott是帶SSE3的P4(以滾燙到可以煎雞蛋而聞名);nocona則是最新的帶有EMT64(64位)的P4(同樣可以煎雞蛋)
AMD通常是:k6, k6-2, k6-3, athlon, athlon-tbird, athlon-xp, athlon-mp, opteron, athlon64, athlon-fx
用AMD的一般都是DIYer,就不必解釋了吧。
1.解壓縮
#./configure –sysconfdir=/etc/ –enable-ssl –enable-modules
#make;make install
2.啟動(dòng)服務(wù)
#/usr/local/apache2/bin/apachectl start
3. 測試
#links http://localhost
#lynx http://localhost
默認網(wǎng)站目錄/usr/local/apache2/htdocs/index.html
netstat -tul |grep 80
安裝
1.解壓縮
# ./configure –sysconfdir=/etc –with-extra-charsets=latin1,utf8,gbk,big5,gb2312
–with-extra-charsets指定其它我們要用到的編碼,有時(shí)象動(dòng)網(wǎng)之類(lèi)要用到gbk。
#.make ;make install
#cp /usr/local/share/mysql/my-large.cnf /etc/my.cnf
2.初始化
#useradd -d /usr/local/var mysql
#su - mysql
$/usr/local/bin/mysql_install_db
3.啟動(dòng)服務(wù)器
$/usr/local/bin/mysqld_safe
4.用/usr/local/bin/mysql登錄測試
安裝php
1.解壓縮后
#./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local –enable-versioning
–enable-versioning支持老的 php3.php2
#make ; make install
#cp php.ini-dist /usr/local/lib/php.ini
2.編輯apache配置文件/etc/httpd.conf,增加
AddType application/x-httpd-php .php .phtml
3.編寫(xiě)測試網(wǎng)頁(yè)/usr/local/apache2/htdocs/test.php
4.訪(fǎng)問(wèn)測試網(wǎng)頁(yè)
# links http://localhost/test.php
收尾工作
1.讓apache自動(dòng)啟動(dòng)
加入到開(kāi)機腳本/etc/rc.local
/usr/local/apache2/bin/apachectl start
2.讓mysql數據庫服務(wù)器自動(dòng)啟動(dòng)
#cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
#chkconfig mysqld on
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站