2013-02-24 36 views
0

我在Ubuntu(/opt/lampp)上安裝了xampp,並在/home/mustafa/public_html中創建了一個public_html文件夾(我認爲它是一個符號鏈接,我是新的linux)我把我的php文件和public_html文件夾中的其他資源,問題是當我想要像圖片一樣的東西時,我得到一個403錯誤(禁止訪問),但其他文件可以像PHP,CSS,JS文件一樣。問題是什麼?我該怎麼辦?403獲取圖像但不是其他資源時出現錯誤

UPDATE

ls -l /home/mustafa/public_html/templates/assets/images/在終端輸出:

total 8 
-rwxrwx--- 1 mustafa mustafa 4638 Feb 17 22:06 hbg.png 

ls -l /home/mustafa/public_html/templates/assets/style/ 

total 16 
-rw-rw-r-- 1 mustafa mustafa 1571 Feb 23 13:06 style.css 
-rw-rw-r-- 1 mustafa mustafa 1567 Feb 23 13:06 style.css~ 
-rw-rw-r-- 1 mustafa mustafa 689 Feb 23 18:07 style_I.css 
-rw-rw-r-- 1 mustafa mustafa 691 Feb 23 17:58 style_I.css~ 

我搬到圖像其他目錄,發現我不能訪問的public_html任何圖像和兒童目錄

+0

您的圖像與其他可以訪問的文件相同嗎?例如你在'/ images /'中的圖像,而你的css,js等在'/ assets /'中? – sjdaws 2013-02-24 05:27:51

+0

圖像在'〜/ public_html/assets/images /中''css文件位於'〜/ public_html/assets/style /'中,並且...我也將圖像文件夾中的圖像移動到了'css'文件夾中, t工作,我再次得到403錯誤。但我可以成功加載css文件js文件php html文件 – 2013-02-24 05:32:12

+1

你可以編輯你的答案並粘貼'ls -l〜/ public_html/assets/images /'或'ls -l〜/ public_html/assets/images /樣式'包括至少一個圖像和一個CSS文件? – sjdaws 2013-02-24 05:33:56

回答

1

在我看來,其他小組無法根據您的ls -l輸出訪問圖像。

它顯示rwxrwx---,而你的css文件是rw-rw-r--

你應該chmod 664你的圖像,以便他們匹配你的css文件,或chown apache所有的文件(假設Apache運行爲Apache),看看是否有效。

要檢查您可以使用哪些進程正在運行的Apache ps aux | grep httpd

[[email protected] ~]$ ps aux | grep httpd 
root  6407 0.0 0.3 11204 3288 ?  Ss 09:06 0:00 /usr/sbin/httpd 
apache 6409 0.0 0.2 11340 2952 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6410 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6411 0.0 0.2 11340 2940 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6412 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6413 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6414 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6415 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
apache 6416 0.0 0.2 11340 2948 ?  S 09:06 0:00 /usr/sbin/httpd 
root  6426 0.0 0.0 5500 720 pts/1 S+ 09:14 0:00 grep httpd 
0

如果你是在共享的託管計劃 - 確保在Plesk中的設置沒有啓用,並設置爲限制併發IP連接一定數量。我打開了它,並設置爲10個併發連接(只是測試這個選項),我會得到一定量的文件 - 其餘的將被禁止,因此一些腳本無法執行等。

對於Linux主機也是如此。

所以那些brothas測試和玩共享主機 - 轉到Web服務器設置 - >通過IIS動態IP限制防止DoS攻擊 - 並確保一切都被禁用。

好運

相關問題