溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

linux怎么構(gòu)建動態(tài)WEB服務(wù)器

發(fā)布時(shí)間:2021-08-13 09:32:10 來源:億速云 閱讀:153 作者:chen 欄目:系統(tǒng)運(yùn)維

本篇內(nèi)容主要講解“l(fā)inux怎么構(gòu)建動態(tài)WEB服務(wù)器”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(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”選項(xiàng)表示為特定的cpu類型編譯二進(jìn)制代碼(不能在更低級別的cpu上運(yùn)行),
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
默認(rèn)網(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指定其它我們要用到的編碼,有時(shí)象動網(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自動啟動
加入到開機(jī)腳本/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ù)器”有了更深的了解,不妨來實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI