【求助】FC3 下 Apache 的 Alias 問題..



贊助商連結


KYLai
2005-01-21, 10:29 AM
前陣子把我的 Linux 由 RedHat 9 換成 FC3, 在 Apache 的設定上出了問題..

我將 /home/myid/XXX/ alias 到網站的 /XXX/
原本在 RedHat 9 上都正常, 但是在 FC3 上都出現 Forbidden 的訊息:
Forbidden
You don't have permission to access /XXX/ on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


httpd.conf 的 alias 設定如下:

Alias /XXX/ /home/myid/XXX/

<Directory /home/myid/XXX>
Order allow,deny
Allow from all
</Directory>


myid 的家目錄和XXX目錄的權限都設到775了, 還是一樣的訊息...
請問各位, 我是不是有哪裡漏了...??

贊助商連結


no1adsl
2005-01-21, 10:58 AM
httpd.conf 的 alias 設定如下:
Alias /XXX/ /home/myid/XXX/
<Directory /home/myid/XXX>
Order allow,deny
Allow from all
</Directory>


Alias /XXX/ "/home/myid/XXX/"

<Directory "/home/myid/XXX">
Order allow,deny
Allow from all
</Directory>

home,myid,XXX 都加個 Execute 看看


還是不行嗎?

KYLai
2005-01-21, 11:31 AM
Alias /XXX/ "/home/myid/XXX/"

<Directory "/home/myid/XXX">
Order allow,deny
Allow from all
</Directory>

home,myid,XXX 都加個 Execute 看看


還是不行嗎?

還是不行... 權限開到777都還不行...

會和 partition 有關嗎?
我的 /home 和 apache 的 DocumentRoot 是在不同的 partition 上..
不過以前就是這樣了... 應該不是這個問題吧..?

KYLai
2005-01-25, 11:53 AM
找到解法了, 原來是 FC3 把 SELinux 預設 enable...
還不會設定 SELinux 前, 只能先把它 disable 掉了..

tonyyen
2005-04-01, 02:44 PM
vi /etc/httpd/conf/httpd.conf

#vi 行數顯示::set nu、到第?行:數字 + G

235行 ServerAdmin root@localhost

339行 UserDir disable 修改成--> #UserDir disable

375行 DirectoryIndex index.html index.html.var 修改成--> DirectoryIndex index.html index.htm index.php index.html.var

730行 AddDefaultCharset UTF-8 修改成--> AddDefaultCharset big5



/etc/rc.d/init.d/httpd start

chkconfig httpd on



注意:

web server 架設好之後,個人網頁的功能也啟動了,只要輸入「http://IP/~xxx」即可瀏覽,不過請確定 SELinux 的功能是關閉的,否則將無法正常瀏覽個人網頁。

若安裝系統的時候,在防火牆設定的地方,沒有關閉 SELinux,請依照下面方法關閉:

vi /etc/sysconfig/selinux

SELINUX=enforcing 修改成--> SELINUX=disabled



重新啟動電腦:reboot