iT邦幫忙

0

關於virtualhost,LAMP

  • 分享至 

  • xImage

各位先進好!
目前架設起來,只能經由固定IP去連線,所呈現的是Apache的welcom頁面
於是我在conf.d/增加vhost.conf,把所有網域資訊填進去,如下所示,
但是不是出現找不到主機就是反應時間過長,有時候會出現403權限不足
但對應的資料夾我已經設為給apache,權限也開放到777,仍是如此,至今
仍一直爬文卻無正解之道

  1 <VirtualHost *:80>
  2     ServerName ex.domain
  3     ServerAlias ex.www.domain
  4     DocumentRoot /home/domainDir
  5     CustomLog /home/domainDir/access.log common
  6     ErrorLog /home/domainDir/error.log
  7     <Directory "/home/domainDir">
  8         Options +FollowSymLinks
  9         AllowOverride All
 10         Order allow,deny
 11         Allow from all
 12     </Directory>
 13 </VirtualHost>
 14 ....其他Domain接續

希望先進能解惑!

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

6
Ray
iT邦大神 1 級 ‧ 2016-11-08 06:51:11
最佳解答

你的 SELinux 有關掉嗎? 沒關的話, 每個 Virtualhost 的資料夾都要重新套用 SELinux Policy...(如果嫌麻煩, 可以全部集中到 /var/www 底下, 那個資料夾已經套好預設的 Policy 了):

Configuring SELinux Policies for Apache Web Servers

SELinux 基礎與實務(Security Enhanced Linux Basics)

看更多先前的回應...收起先前的回應...
outgi iT邦新手 5 級 ‧ 2016-11-09 13:50:33 檢舉

SELinux 在灌OS的時候第一個步驟就是把他關閉了^^"

Ray iT邦大神 1 級 ‧ 2016-11-09 16:38:05 檢舉

那你自訂的那些資料夾, 權限設定可以讓 apache httpd 讀取嗎?

jerry00218 iT邦好手 10 級 ‧ 2016-11-09 21:16:16 檢舉

還有…千萬不要設 777

outgi iT邦新手 5 級 ‧ 2016-11-10 01:56:07 檢舉

請問一下,因為我以為是權限不夠才設到777,之前都是設755,這樣對嗎?

outgi iT邦新手 5 級 ‧ 2016-11-10 01:57:31 檢舉

回應raytracy 目前算是已經解決了,虛擬站台都依domain順利分割開2對應的資料夾了

我要發表回答

立即登入回答