【求助】在FreeBSD上面跑Squid >_<



贊助商連結


MyAngelism
2004-07-15, 06:30 PM
照著Squid-cache.org上面的FAQ裝好了之後,打算下squid -z時,
竟然跟我說Command not found >_<
這是怎樣啊..

權限這樣應該沒有問題吧?

FreeBSD# ls -la
total 5092
drwxr-xr-x 2 root wheel 512 Jul 16 01:32 .
drwxr-xr-x 9 root wheel 512 Jul 16 01:20 ..
-rwxr-xr-x 1 root wheel 5188188 Jul 16 01:32 squid

:confused:

贊助商連結


repsol
2004-07-15, 06:38 PM
路徑找不到?! 加個./吧

MyAngelism
2004-07-15, 07:50 PM
最初由 repsol 發表
路徑找不到?! 加個./吧

你好

照您的方法之後就可以了,但是為甚麼會這樣呢?我在該檔案所在的目錄下面
直接執行,找不到檔案算正常嗎?

另外現在還有個問題,下面的訊息是怎麼回事?我用google查了一下下,
是DNS有問題嗎?(我是架在虛擬ip上.. 192.168.80.100)

FreeBSD# ./RunCache
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1
Abort trap
RunCache: EXITING DUE TO REPEATED, FREQUENT FAILURES

raytracy
2004-07-15, 08:00 PM
查一下 /usr/local/squid/var/squid.out 看看裡面紀錄了些什麼?...

MyAngelism
2004-07-15, 08:34 PM
最初由 raytracy 發表
查一下 /usr/local/squid/var/squid.out 看看裡面紀錄了些什麼?...

我剛剛一生氣把/usr/local/squid/var下面的檔案跟目錄全都chmod nobody之後
就變成這樣..

FreeBSD# ./RunCache
Running: squid -sY >> /usr/local/squid/var/squid.out 2>&1

然後就停住了。.. 這樣算有成功嗎? >_<

raytracy
2004-07-15, 11:47 PM
最初由 MyAngelism 發表
我剛剛一生氣把/usr/local/squid/var下面的檔案跟目錄全都chmod nobody之後
就變成這樣..
然後就停住了。.. 這樣算有成功嗎? >_<
這?.....您想是叫 Squid 都不要寫入紀錄嗎?....那您要如何查問題呢?

還是建議您去看看 squid.out 所記錄下來的內容, 才知道哪邊出了問題? 或者是, 乾脆不要 squid.out 了, 直接跑 squid -sY 後面不要接指令, 這樣您就知道為何需要 squid.out 了....

MyAngelism
2004-07-16, 09:05 AM
最初由 raytracy 發表
這?.....您想是叫 Squid 都不要寫入紀錄嗎?....那您要如何查問題呢?

還是建議您去看看 squid.out 所記錄下來的內容, 才知道哪邊出了問題? 或者是, 乾脆不要 squid.out 了, 直接跑 squid -sY 後面不要接指令, 這樣您就知道為何需要 squid.out 了....
=============================================================
請問一下在/usr/local/squid/下的各子目錄或檔案應該設成哪樣的權限才對呢?我用google大神去伸squid的中文文件,都不多。>_<

另外我看我的squid.out最近幾次的記錄是.. (有點長請見諒)

FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1568 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:22:13 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:22:13| WARNING: Closing open FD 2
2004/07/16 03:22:13| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:22:13| Process ID 599
2004/07/16 03:22:13| With 3328 file descriptors available
2004/07/16 03:22:13| Performing DNS Tests...
2004/07/16 03:22:13| Successful DNS name lookup tests...
2004/07/16 03:22:13| DNS Socket created at 0.0.0.0, port 49175, FD 4
2004/07/16 03:22:13| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.012 seconds = 0.006 user + 0.006 sys
Maximum Resident Size: 1876 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:22:23 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:22:23| WARNING: Closing open FD 2
2004/07/16 03:22:23| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:22:23| Process ID 606
2004/07/16 03:22:23| With 3328 file descriptors available
2004/07/16 03:22:23| Performing DNS Tests...
2004/07/16 03:22:23| Successful DNS name lookup tests...
2004/07/16 03:22:23| DNS Socket created at 0.0.0.0, port 49177, FD 4
2004/07/16 03:22:23| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1444 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:22:33 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:22:33| WARNING: Closing open FD 2
2004/07/16 03:22:33| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:22:33| Process ID 613
2004/07/16 03:22:33| With 3328 file descriptors available
2004/07/16 03:22:33| Performing DNS Tests...
2004/07/16 03:22:33| Successful DNS name lookup tests...
2004/07/16 03:22:33| DNS Socket created at 0.0.0.0, port 49179, FD 4
2004/07/16 03:22:33| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.013 user + 0.000 sys
Maximum Resident Size: 1276 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:22:47 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:22:47| WARNING: Closing open FD 2
2004/07/16 03:22:47| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:22:47| Process ID 620
2004/07/16 03:22:47| With 3328 file descriptors available
2004/07/16 03:22:47| Performing DNS Tests...
2004/07/16 03:22:47| Successful DNS name lookup tests...
2004/07/16 03:22:47| DNS Socket created at 0.0.0.0, port 49181, FD 4
2004/07/16 03:22:47| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 2140 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:22:58 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:22:58| WARNING: Closing open FD 2
2004/07/16 03:22:58| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:22:58| Process ID 627
2004/07/16 03:22:58| With 3328 file descriptors available
2004/07/16 03:22:58| Performing DNS Tests...
2004/07/16 03:22:58| Successful DNS name lookup tests...
2004/07/16 03:22:58| DNS Socket created at 0.0.0.0, port 49183, FD 4
2004/07/16 03:22:58| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 2140 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:48:48 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:48:48| WARNING: Closing open FD 2
2004/07/16 03:48:48| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:48:48| Process ID 740
2004/07/16 03:48:48| With 3328 file descriptors available
2004/07/16 03:48:48| Performing DNS Tests...
2004/07/16 03:48:48| Successful DNS name lookup tests...
2004/07/16 03:48:48| DNS Socket created at 0.0.0.0, port 49194, FD 4
2004/07/16 03:48:48| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1452 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:48:58 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:48:58| WARNING: Closing open FD 2
2004/07/16 03:48:58| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:48:58| Process ID 747
2004/07/16 03:48:58| With 3328 file descriptors available
2004/07/16 03:48:58| Performing DNS Tests...
2004/07/16 03:48:58| Successful DNS name lookup tests...
2004/07/16 03:48:58| DNS Socket created at 0.0.0.0, port 49196, FD 4
2004/07/16 03:48:58| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.024 seconds = 0.012 user + 0.012 sys
Maximum Resident Size: 2136 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:49:08 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:49:08| WARNING: Closing open FD 2
2004/07/16 03:49:08| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:49:08| Process ID 754
2004/07/16 03:49:08| With 3328 file descriptors available
2004/07/16 03:49:08| Performing DNS Tests...
2004/07/16 03:49:08| Successful DNS name lookup tests...
2004/07/16 03:49:08| DNS Socket created at 0.0.0.0, port 49198, FD 4
2004/07/16 03:49:08| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1452 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:49:18 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:49:18| WARNING: Closing open FD 2
2004/07/16 03:49:18| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:49:18| Process ID 761
2004/07/16 03:49:18| With 3328 file descriptors available
2004/07/16 03:49:18| Performing DNS Tests...
2004/07/16 03:49:18| Successful DNS name lookup tests...
2004/07/16 03:49:18| DNS Socket created at 0.0.0.0, port 49200, FD 4
2004/07/16 03:49:18| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 2152 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:49:29 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:49:29| WARNING: Closing open FD 2
2004/07/16 03:49:29| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:49:29| Process ID 768
2004/07/16 03:49:29| With 3328 file descriptors available
2004/07/16 03:49:29| Performing DNS Tests...
2004/07/16 03:49:29| Successful DNS name lookup tests...
2004/07/16 03:49:29| DNS Socket created at 0.0.0.0, port 49202, FD 4
2004/07/16 03:49:29| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.006 user + 0.006 sys
Maximum Resident Size: 1588 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 03:49:39 CST 2004
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
/usr/local/squid/var/logs/cache.log: Permission denied
messages will be sent to 'stderr'.
2004/07/16 03:49:39| WARNING: Closing open FD 2
2004/07/16 03:49:39| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:49:39| Process ID 775
2004/07/16 03:49:39| With 3328 file descriptors available
2004/07/16 03:49:39| Performing DNS Tests...
2004/07/16 03:49:39| Successful DNS name lookup tests...
2004/07/16 03:49:39| DNS Socket created at 0.0.0.0, port 49204, FD 4
2004/07/16 03:49:39| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1452 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 04:33:38 CST 2004
Startup: Fri Jul 16 04:43:24 CST 2004
Startup: Fri Jul 16 05:21:12 CST 2004
2004/07/16 05:21:12| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:22 CST 2004
2004/07/16 05:21:22| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:32 CST 2004
2004/07/16 05:21:32| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:42 CST 2004
2004/07/16 05:21:42| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:52 CST 2004
2004/07/16 05:21:52| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:22:02 CST 2004
2004/07/16 05:22:02| Squid is already running! Process ID 931

repsol
2004-07-16, 02:42 PM
2004/07/16 03:49:39| Starting Squid Cache version 2.5.STABLE6 for ...
2004/07/16 03:49:39| Process ID 775
2004/07/16 03:49:39| With 3328 file descriptors available
2004/07/16 03:49:39| Performing DNS Tests...
2004/07/16 03:49:39| Successful DNS name lookup tests...
2004/07/16 03:49:39| DNS Socket created at 0.0.0.0, port 49204, FD 4
2004/07/16 03:49:39| Adding nameserver 168.95.192.1 from /etc/resolv.conf
FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.013 seconds = 0.000 user + 0.013 sys
Maximum Resident Size: 1452 KB
Page faults with physical i/o: 0
Startup: Fri Jul 16 04:33:38 CST 2004
Startup: Fri Jul 16 04:43:24 CST 2004
Startup: Fri Jul 16 05:21:12 CST 2004
2004/07/16 05:21:12| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:22 CST 2004
2004/07/16 05:21:22| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:32 CST 2004
2004/07/16 05:21:32| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:42 CST 2004
2004/07/16 05:21:42| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:21:52 CST 2004
2004/07/16 05:21:52| Squid is already running! Process ID 931
Startup: Fri Jul 16 05:22:02 CST 2004
2004/07/16 05:22:02| Squid is already running! Process ID 931


抓最後面的訊息出來看,就是這段的訊息有問題。

FATAL: Cannot open '/usr/local/squid/var/logs/access.log' for writing.
The parent directory must be writeable by the
user 'nobody', which is the cache_effective_user

請檢查你的/usr/local/squid/var/logs/access.log 的權限



你的squid.conf 其中的兩個設定
cache_effective_user
cache_effective_group

是否相輔合..

raytracy
2004-07-20, 09:25 AM
目錄權限不對....

可以先試試看: chmod 777 /usr/local/squid/var/logs

若怕安全問題, 則可以用:
chown nobody /usr/local/squid/var/logs
chmod u+w /usr/local/squid/var/logs