Apache2在開機過程中啟動不了?? - BBS

Elizabeth avatar
By Elizabeth
at 2004-04-18T09:53

Table of Contents

小弟在家是利用Hinet ADSL 2M/128Kbit撥接上網,向Hinet申請了一個固定IP(最近
開放的免費服務),並去www.adsldns.org由請了一個免費的DNS服務,來學習
用FreeBSD架站。

現正在學習ipfilter及ipnat的功能,參考了網路上眾多的相關文件,已成功地
讓區網內的WinXP透過FreeBSD上網(NAT),並在ipf.rules設定一些rules來做封包過濾。
但我發現下次開機後,Apache2就不能啟動了,apache2在開機過程中出現了如下的訊息:

Local package initialization: httpd: Could not determine the server's fully
qualified domain name, using 127.0.0.1 for ServerName

我去找httpd-error.log,發現了底下的錯誤訊息:

No address associated with hostname: mod_unique_id: unable to find IPv4 address
of "test.adsldns.org" Configuration Failed

錯誤訊息說的很清楚,就是無法辦別test.adsldns.org的IP位置(那個test是舉例用的),
可是奇怪的是我確定我的FQDN是可用的,因為開機完後ping的到,而且手動輸入
apachectl start可啟動,但就是在開機過程中啟動不了。不知原因為何? 還請各位
先進指點一二,謝謝! 我附上ppp.conf,rc.conf,ipf.rules,ipnat.rules。
---ppp.conf---
default:
set log Phase Chat LCP IPCP CCP tun command
set ifaddr 10.0.0.1/0 10.0.0.2/0

hinet:
set device PPPoE:rl0
set mru 1492
set mtu 1492
set speed sync
enable lqr
set lqrperiod 5
set authname [email protected]
set authkey YYYYYYYY
set dial
set login
add default HISADDR
enable dns

---rc.conf-----
kern_securelevel_enable="YES"
kern_securelevel="2"
nfs_reserved_port_only="NONE"
sshd_enable="YES"
usbd_enable="YES"

# Network Setup
network_interfaces="auto"
defaultrouter="10.0.0.1"
hostname="test.adsldns.org"
ifconfig_rl0="inet 10.0.0.1 netmask 255.255.255.0 -arp"
ifconfig_rl1="inet 192.168.0.254 netmask 255.255.255.0"

# Enable PPP
ppp_enable="YES"
ppp_mode="ddial"
ppp_profile="hinet"

# Enable ipfilter&ipnat&ipmon
ipfilter_enable="YES"
ipnat_enable="YES"
ipmon_enable="YES"
ipmon_flags="-Ds"
syslogd_flags="-ss"

----ipf.rules---
pass in quick on lo0 all
pass out quick on lo0 all

pass in quick on rl1 all
pass out quick on rl1 all

# Outside interface
pass out quick on tun0 from any to any keep state

# Allow some services here
pass in quick on tun0 proto tcp from any to any port = 21 keep state
pass in quick on tun0 proto udp from any to any port = 21 keep state
pass in quick on tun0 proto tcp from any to any port = 22 keep state
pass in quick on tun0 proto udp from any to any port = 22 keep state
pass in quick on tun0 proto tcp from any to any port = 25 keep state
pass in quick on tun0 proto udp from any to any port = 25 keep state
pass in quick on tun0 proto tcp from any to any port = 80 keep state
pass in quick on tun0 proto udp from any to any port = 80 keep state
pass in quick on tun0 proto tcp from any to any port = 110 keep state
pass in quick on tun0 proto udp from any to any port = 110 keep state
pass in quick on tun0 proto tcp from any to any port = 443 keep state
pass in quick on tun0 proto udp from any to any port = 443 keep state
pass in quick on tun0 proto tcp from any to any port = 4662 keep state
pass in quick on tun0 proto udp from any to any port = 3312 keep state

# allow ping, traceroute
pass in quick on tun0 proto icmp from any to any icmp-type 0
pass in quick on tun0 proto icmp from any to any icmp-type 11

# block all remaining traffic in the good old fashioned way
block return-rst in log quick on tun0 proto tcp from any to any
block return-icmp-as-dest(port-unr) in log quick on tun0 proto udp from any to
any
block in log quick on tun0 all

-----ipnat.rules------
map tun0 192.168.0.0/24 -> 220.135.214.101/32
rdr tun0 220.135.214.101/32 port 4662 -> 192.168.0.1 port 4662
rdr tun0 220.135.214.101/32 port 3312 -> 192.168.0.1 port 3312 udp

--
Tags: BBS

All Comments

freebsd怎麼設ipfw ??

Hazel avatar
By Hazel
at 2004-04-17T22:16
最近adsl常斷線 中華電信測起來電路都正常 他說有可能是病毒 導致流量過大而斷線 目前我有二台電腦 一台freebsd 4.9 一台winxp 用固定ip 在freebsd那台電腦上 我該怎麼設ipfw 才不會有不正常的封包出入??? (目前我有架www andamp; nat) - ...

Re: mrtg怎麼抓bbs的上線人數?

Anonymous avatar
By Anonymous
at 2004-04-16T21:31
sorry我是用ptt的 除了OuTian大提供的程式外 有好方法嗎??? ※ 引述《BioStar.bbsatmicro.bio.ncue.edu.tw (澎湖小雲雀)》之銘言: : ※ 引述《shane123.bbsatptt.cc (家產有八十七億)》之銘言: : andgt; 是不是應該抓目前有幾個 ...

mrtg怎麼抓bbs的上線人數?

Robert avatar
By Robert
at 2004-04-16T07:25
是不是應該抓目前有幾個mbbsd process?? 該怎麼做呢?? thanks~ - ...

vim開啟showmatch的功能

Catherine avatar
By Catherine
at 2004-04-15T23:32
※ 引述《Coffja.bbsatBBS.CHEM.nthu.edu.tw (嘖..亂七八糟)》之銘言: : 各位好,我想請問一下,在vim底下 : 根據我找到的資料, : 想讓程式碼的括弧在游標經過時可以自動讓另一個成對的括弧有反應 : 以顯示配對狀況,似乎應該是要用:set showmatch的設定? : ...

cgi可以用c++寫嗎

Ophelia avatar
By Ophelia
at 2004-04-14T20:14
我寫了一個簡單的程式 #include andlt;iostream.handgt; void main(void) {cout andlt;andlt;and#34;helloand#34;andlt;andlt;endl;} 編譯為a.cgi (chmod 777) 放在cgi-bin下的目錄 不過會出現 ...