我這一台主機上已經掛載 Synology RS815RP+ 的分享空間為這一台主機的/home6磁區
mount -t cifs //192.168.3.7/www -o username=xdrivex,password=adsp7er /home6/
我於httpd.conf內設定
Alias /upload "/home6/report"
<Directory "/home6/report">
Options MultiViews FollowSymLinks
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
而/home6/report目錄內已經有資料夾
[root@HP home6]# ll /home6/report/
total 0
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2003
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2004
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2005
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2006
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2007
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2008
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2009
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2010
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2011
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2012
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2013
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2014
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2015
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2016
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2017
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2018
drwxrwxrwx. 2 1027 users 0 Feb 26 2020 2019
當我於網址輸入
http://xxx.xxx.xxx.tw/upload/2019/20192.pdf
然後出現
Forbidden
You don't have permission to access /upload/2019/20192.pdf on this server.
Apache/2.2.15 (CentOS) Server at xxx.xxx.xxx.tw Port 80
請問我還需要修改哪個設定呢? 謝謝!
You don't have permission to access /upload/2019/20192.pdf on this server.
Apache/2.2.15 (CentOS) Server at xxx.xxx.xxx.tw Port 80
看起來應該是防火牆擋掉
設一條規則允許PORT80
我剛剛執行這一行
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
然後
[root@HP report]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-BadBots tcp -- anywhere anywhere multiport dports http,https
fail2ban-SSH tcp -- anywhere anywhere tcp dpt:5127
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:pop3s
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:5127
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:mysql
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain fail2ban-BadBots (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
Chain fail2ban-SSH (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
httpd 重新啟動過,問題仍然相同。
我把fail2ban關閉,然猴重新啟動apache,依然是相同問題,請問不知是否還有哪裡需要做修改呢?
謝謝
selinux關掉看看,能想到的是這個問題
比較直覺的想法是檔案的所有人不同。
無法給web server權限取用。
可先做個測試,先將其檔案直接改成777權限看看是否就可以正常了。
如果分享目錄的帳號都是各自不同的情況下。那最好還是設個群組來分配權限會比較好點。