本篇內(nèi)容主要講解“l(fā)inux怎么構(gòu)建動態(tài)WEB服務(wù)器”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學(xué)習(xí)“l(fā)inux怎么構(gòu)建動態(tài)WEB服務(wù)器”吧!
基本配置
安裝web服務(wù)器:httpd-2.X.X
先優(yōu)化吧
根據(jù)CPU設(shè)置變量
#export CFLAGS=”-O2 -march=pentium4 -pipe” && CXXFLAGS=$CFLAGS
“-march”選項表示為特定的cpu類型編譯二進制代碼(不能在更低級別的cpu上運行),
Intel通常是:pentium2, pentium3, pentium3m, pentium4, pentium4m, pentium-m, prescott, nocona
說明:pentium3m/pentium4m是筆記本用的移動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.啟動服務(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
安裝Mysql
1.解壓縮
# ./configure –sysconfdir=/etc –with-extra-charsets=latin1,utf8,gbk,big5,gb2312
–with-extra-charsets指定其它我們要用到的編碼,有時象動網(wǎng)之類要用到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.啟動服務(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.編寫測試網(wǎng)頁/usr/local/apache2/htdocs/test.php
4.訪問測試網(wǎng)頁
# links http://localhost/test.php
收尾工作
1.讓apache自動啟動
加入到開機腳本/etc/rc.local
/usr/local/apache2/bin/apachectl start
2.讓mysql數(shù)據(jù)庫服務(wù)器自動啟動
#cp /usr/local/share/mysql/mysql.server /etc/init.d/mysqld
#chkconfig mysqld on
到此,相信大家對“l(fā)inux怎么構(gòu)建動態(tài)WEB服務(wù)器”有了更深的了解,不妨來實際操作一番吧!這里是創(chuàng)新互聯(lián)建站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
文章題目:linux怎么構(gòu)建動態(tài)WEB服務(wù)器-創(chuàng)新互聯(lián)
文章位置:http://chinadenli.net/article42/jgcec.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、網(wǎng)站制作、品牌網(wǎng)站設(shè)計、手機網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容