資源描述:
《linux網(wǎng)絡(luò)服務(wù)-命令總結(jié)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、第4章構(gòu)建LAMP網(wǎng)站服務(wù)平臺(tái)1:安裝HTTPD軟件包root@s1~]#ls/media/cdrom/Server/*httpd*/media/cdrom/Server/httpd-2.2.3-6.el5.i386.rpm/media/cdrom/Server/httpd-devel-2.2.3-6.el5.i386.rpm/media/cdrom/Server/httpd-manual-2.2.3-6.el5.i386.rpm/media/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm[root@s1~]#rpm-ivh/
2、media/cdrom/Server/httpd-2.2.3-6.el5.i386.rpm2:[root@s1mnt]#tar-zxvfhttpd-2.2.9.tar.gz-C/usr/src/3:配置編譯選項(xiàng)[root@s1mnt]#cd/usr/src/httpd-2.2.9/[root@s1httpd-2.2.9]#./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite--enable-cgi--enable-suexec--with-suexec-caller=daemon--with-suexec-docro
3、ot=/usr/local/apache2/htdocs4:編譯服務(wù)程序和安裝[root@s1httpd-2.2.9]#make&&makeinstall5:在HTTPD.CONF文件中添加:SERVERNAME“配置行,設(shè)置WEB服務(wù)的域名[root@s1~]#vi/usr/local/apache2/conf/httpd.confServerNamewww.benet.com6:啟動(dòng)、終止HTTPD服務(wù)[root@s1~]#/usr/local/apache2/bin/apachectl-tSyntaxOK[root@s1~]#/usr/local/apache2/bin/apachect
4、lrestarthttpdnotrunning,tryingtostart[root@s1~]#/usr/local/apache2/bin/apachectlstarthttpd(pid20911)alreadyrunning[root@s1~]#netstat-anpt
5、grep:80tcp00:::80:::*LISTEN20911/httpd7:構(gòu)建虛擬WEB主機(jī)(1)在HTTPD服務(wù)器的網(wǎng)頁目錄建立兩個(gè)文件夾benetcomaccpcom,并分別建立兩個(gè)測(cè)試網(wǎng)頁[root@s1~]#cd/usr/local/apache2/htdocs/[root@s1htdocs]#mkdirbe
6、netcomaccpcom[root@s1htdocs]#echo"www.benet.com">benetcom/index.html[root@s1htdocs]#echo"www.accp.com">accpcom/index.html(2)修改HTTPD.CONF文件添加虛擬主機(jī)配置[root@s1htdocs]#vi/usr/local/apache2/conf/httpd.confNameVirtualHost172.16.16.166DocumentRoot/usr/local/apache2/htdocs/benetcomSe
7、rverNamewww.benet.comErrorLoglogs/www.benet.com.error.logCustomLoglogs/www,benet.com.access.logcommonDocumentRoot/usr/local/apache2/htdocs/accpcomServerNamewww.accp.comErrorLoglogs/www.accp.com.error.logCustomLoglogs/www,accp.com.access.logcommon
8、(3)建立系統(tǒng)用戶的個(gè)人主頁[root@s1~]#vi/usr/local/apache2/conf/httpd.confUserDirpublic_htmlAllowOverridenoneOptionsnoneOrderallow,denyAllowfromall