壹、WebServer(apache.docx

上传人:scccc 文档编号:13052046 上传时间:2021-12-12 格式:DOCX 页数:7 大小:15.17KB
返回 下载 相关 举报
壹、WebServer(apache.docx_第1页
第1页 / 共7页
壹、WebServer(apache.docx_第2页
第2页 / 共7页
壹、WebServer(apache.docx_第3页
第3页 / 共7页
壹、WebServer(apache.docx_第4页
第4页 / 共7页
壹、WebServer(apache.docx_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《壹、WebServer(apache.docx》由会员分享,可在线阅读,更多相关《壹、WebServer(apache.docx(7页珍藏版)》请在三一文库上搜索。

1、.日期:88/4/3壹、Web Server (apache_1.3.4) 安裝程序1.以 root 身份登入主機。(假設本主機之ip為140.123.10.211,hostname為bsd1)2.取得原始程式檔。#cd /tmp#ftp -i ftp.ccu.edu.twName (ftp.ccu.edu.tw:root):anonymousPassword:guestccunix.ccu.edu.twftp>binftp>lsftp>cd /pub2/www/apache/distftp>get apache_1.3.4.tar.gzftp>bye#pwd#l

2、s-l3.解壓縮原始程式。#tar xvfz apache_1.3.4.tar.gz#ls-l#cd apache_1.3.4#ls l4.建立及執行編譯環境組態檔。#echo >apache.config#ls -l#chmod +x apache.config#ls -l#./configure help >configure.help#ls #more configure.help#ee apache.config#!/bin/cshsetenv CFLAGS "-O2 -m486 -pipe"./configure -enable-module=so -

3、enable-module=digest -enable-module=rewrite -with-perl=/usr/bin/perl -enable-suexec -suexec-uidmin=100 #./apache.config5.編譯及安裝系統。#ls /usr/local#make all install6.修改組態設定檔 (httpd.conf)#ls /usr/local#cd /usr/local/apache/conf#ee httpd.confUserDirWWW(P.6-11)DirectoryIndexindex.htmlindex.htm(P.6-15)Serve

4、rNamebsd1.ccu.edu.tw(P.6-11)Port80(P.6-8)Usernobody(P.6-9)Groupnobody(P.6-9)#CacheNegotiatedDocs(P.6-11)Alias /icons/ "/usr/local/apache/icons/"(P.6-19)ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"(P.6-19)AddHandler cgi-script .cgi(P.6-19,P6-35)註: 可用 /usr/local/apache/bin/ap

5、achectl configtest 指令來檢查設定是否正確#cd /usr/local/apache/bin#./apachectl#./apachectl configtest./apachectl configtestSyntax OK#ps auxww|grep httpd抱歉httpd daemon沒有被啟動。7.啟動 WWW Server。#./apachectl start#ps auxww|grep httpdVery good. 有6個httpd daemon被啟動,其中只有一個的owner是root,其他5個為nobody。8. 停止 WWW Server。#./apach

6、ectl stop#ps auxww|grep httpdhttpd daemon真的都沒有了。#./apachectl start#ps auxww|grep httpdhttpd daemon又回來了。9.重新讀取WWW Server組態檔當你有更改組態檔httpd.conf時,你需要重新讀取它,你所更改的設定才會生效哦!#./apachectl restart10.如何測試 WWW Server 是否正常運作?telnet server_name 80#telnet localhost 80:Escape character is ''.GET / HTTP/1.0 (輸

7、入完按兩次 Enter 鍵):Connection closed by foreign host.(出現此訊息表示正常)Unable to connect to remote host: Connection refused(出現此訊息表示不正常)連線網址:http:/140.123.10.211/(140.123.10.211為WWW Server之ip)#rm /tmp/apache_1.3.4.tar.gz(刪除apache_1.3.4.tar.gz檔案)#rm rf /tmp/apache_1.3.4(刪除apache_1.3.4目錄)貳、Proxy Server (squid-2.1

8、.PATCH2) 安裝程序1.以 root 身份登入主機。2.取得原始程式檔。#ftp -i ftp.ccu.edu.twftp>cd /pub/www/squid/squid-2/STABLEftp>get squid-2.1.PATCH2-src.tar.gzftp>bye3.解壓縮原始程式。#tar xvfz squid-2.1.PATCH2-src.tar.gz#cd squid-2.1.PATCH24.建立及執行編譯環境組態檔。#echo >squid.config#chmod +x squid.config#ee squid.config#!/bin/csh

9、setenv CFLAGS "-O2 -m486 -pipe"./configure -enable-snmp -enable-icmp -enable-forw-via-db -enable-htcp -enable-gnuregex#./squid.config5.編譯及安裝系統。#make all ; make install install-pinger#cd /usr/local/squid/bin ; ls -l#file *#ls -l#strip *#ls -l6.修改組態設定檔 (squid.conf)#cd /usr/local/squid/etc#ee

10、 squid.confcache_peer proxy.ccu.edu.twparent3128 3130 defaultcache_peer_domain proxy.ccu.edu.tw!ccu.edu.tw !cy.edu.twhierarchy_stoplist cgi-bin ?hierarchy_stoplist /cgi bin/ /wc/hierarchy_stoplist ccu.edu.tw 140.123. 127.0.0.1hierarchy_stoplist www.ccu.edu.tw www.ccunix.ccu.edu.tw ftp.ccu.edu.tw gop

11、her.ccu.edu.tw hierarchy_stoplist .cgi .asp .idc .dllacl QUERY urlpath_regex cgi-bin ? .(cgi|idc|dll|mp3)$ .ccu.edu.tw .cy.edu.tw acl local_ip src 140.123.0.0/16acl local_dn srcdomain ccu.edu.twno_cache deny QUERY local_ip local_dncache_mem 128 MBcache_swap_low 90cache_swap_high 95cache_mem_low 75ca

12、che_mem_high 90maximum_object_size 4096 KBcache_dir /home1/cache 1000 16 256cache_store_log noneftp_user squidwww.ccu.edu.twreference_age 1 week#TAG: aclacl manager proto cache_objectacl all src 0.0.0.0/0.0.0.0acl SSL_ports port 443 563acl Dangerous_ports port 7 9 19acl CONNECT method CONNECTacl ccu

13、 src 140.123.0.0/16acl ccu-ip dst 140.123.0.0/16acl squid-url urlpath_regex squid-internalacl cc-ip src 140.123.10.0/24 140.123.19.0/24 140.123.254.0/24acl ccu-web-dn dstdomain ccu.edu.tw# TAG: http_accesshttp_access deny manager !localhost !cc-iphttp_access deny CONNECT !SSL_portshttp_access deny D

14、angerous_portshttp_access allow localhosthttp_access deny ccu-urlhttp_access allow squid-url !ccu-web-dnhttp_access allow ccuhttp_access deny all#TAG: icp_accessicp_access allow squid-url !ccu-web-dnicp_access allow all#TAG: miss_accessmiss_access allow squid-url ccu localhost !ccu-web-dnmiss_access

15、 deny !ccu !localhost allcache_mgr squidw3.ccu.edu.twcache_effective_user nobodycache_effective_group nogrouplog_icp_queries offquery_icmp on7.建立 cache 資料目錄結構。#mkdir /home1/cache#chown nobody.nogroup /home1/cache#cd /usr/local/squid/bin#./squid z(需等幾分鐘)8.啟動 Proxy Server。#chown nobody.nogroup /usr/lo

16、cal/squid/logs#./RunCache&註:kill -9 cat /usr/local/squid/logs/squid.pid停止服務。kill -HUP cat /usr/local/squid/logs/squid.pid重新讀取組態檔。如何測試 WWW Server 是否正常運作?telnet server_name 3128:Escape character is ''.GET / HTTP/1.0 (輸入完按兩次 Enter 鍵):Connection closed by foreign host.(出現此訊息表示正常)Unable to co

17、nnect to remote host: Connection refused(出現此訊息表示不正常)參、實習注意事項一、各組主機 IP Address 及 Domain Name組別IP AddressDomain Name一140.123.10.211bsd1.ccu.edu.tw二140.123.10.212bsd2.ccu.edu.tw三140.123.10.213bsd3.ccu.edu.tw四140.123.10.214bsd4.ccu.edu.tw五140.123.10.215bsd5.ccu.edu.tw六140.123.10.216bsd6.ccu.edu.tw七140.123.10.217bsd7.ccu.edu.tw二、組態檔取得方式ftp:/140.123.254.3/pub/ccu/course/httpd.confftp:/140.123.254.3/pub/ccu/course/squid.conf;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1