apache的網頁連不上 - Linux

Steve avatar
By Steve
at 2018-11-27T20:18

Table of Contents

大家好,最近被老師要求架一個網站
因為配的虛擬主機是用linux只好用了...
版本是 Ubuntu 16.05 LTS
沒圖形介面(架網站不能用瀏覽器..QQ)
------------------------------------
我直接先把errorlog放上來,後面在來慢慢說明問題好了
瀏覽器直接連IP出現的畫面是 Forbidden Server unable to read htaccess file

errorlog在這裡------
(13)Permission denied: [client XXX.XXX.4.85:19051] AH00529:
/var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure
it is readable and that '/var/www/html/' is executable, referer:
http://XXX.XXX.XXX.232/

看起來是那個htaccess的問題吧?

然後在放上我的apache2.conf 查到說要修改的地方,麻煩幫我看一下~
我查到的大部分都說要改AllowOverride
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>

<Directory /usr/share>
AllowOverride None
 Require all granted
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

<Directory /var/www/html/>
AllowOverride All
</Directory>

#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>

請問這樣看得出是哪裡有問題嗎??
還有htaccess到底是甚麼,查了一堆還是看不懂
好像是甚麼權限問題??

還請各位幫忙一下,謝謝!

--
Tags: Linux

All Comments

Leila avatar
By Leila
at 2018-12-01T19:43
chmod 644 .htaccess
chmod 755 /var/www/html/
打這兩行就可以了,抱歉耍蠢了.... 似乎是權限問題
Enid avatar
By Enid
at 2018-12-03T05:12
其實不應該這麼解這個問題
Jake avatar
By Jake
at 2018-12-04T10:33
不要隨便把/var/www/html開755 .htaccess開644
Leila avatar
By Leila
at 2018-12-08T15:03
遇到權限問題應該先思考是什麼process 用什麼user權限
開什麼樣的檔案,需要什麼樣的權限這樣的思路去解決問題
Enid avatar
By Enid
at 2018-12-12T21:00
你用ubuntu裝apache那也許開的是以apache user的權限開
的,所以要解決可能是要把這些檔案或是資料夾設定成
Ethan avatar
By Ethan
at 2018-12-15T19:33
apache這個使用者可以讀取,另外目錄下的東西apache
user 可以變更才對,你這種改法會有安全性上面的隱憂
Odelette avatar
By Odelette
at 2018-12-19T05:30
一般來說/var/www/html下面也都是讀取,但是用到udav
Victoria avatar
By Victoria
at 2018-12-20T12:07
也要有更改的權限,因為要上傳檔案,這些基本的概念要懂
Skylar DavisLinda avatar
By Skylar DavisLinda
at 2018-12-23T16:16
樓上,你大概不知道台灣有多少Linux是錯誤的做法吧
Kyle avatar
By Kyle
at 2018-12-25T11:21
有些為了可以運作,777都給他下去
有時候我真的是對於那種Linux管理者很感冒
Leila avatar
By Leila
at 2018-12-29T20:49
改天應該要寫一個正確的Linux觀念
Puput avatar
By Puput
at 2018-12-30T10:08
但是會Linux並沒有比較高薪XD
有讀懂鳥哥的應該不可能這樣管,但是鳥哥都多久了還
Margaret avatar
By Margaret
at 2019-01-02T03:19
是有人這樣使用Linux,你覺得你再寫一篇正確觀念有用
嗎?XD
Rachel avatar
By Rachel
at 2019-01-05T17:47
會Linux本來就不是高薪的原因,而是解決問題的能力
Zora avatar
By Zora
at 2019-01-08T19:54
但會Linux的定義比較難說,跟高薪的定義一樣
Madame avatar
By Madame
at 2019-01-09T17:39
我是覺得做甚麼事情應該是走正確的方式進行
Iris avatar
By Iris
at 2019-01-14T06:41
而不是為了交差隨便應付
錯誤的解決方式只是埋下更多炸彈而已
Zenobia avatar
By Zenobia
at 2019-01-14T13:59
https://ithome.com.tw/news/127671

shell 變數在作執行指令

Hedda avatar
By Hedda
at 2018-11-26T16:38
object=$(ls /etc/sysconfig/network-scripts/ifcfg-* | grep -v [*.*] | cut -d and#34;/and#34; -f 5 | cut -d and#34;-and#34; -f 2) for tmp in $object do ...

紅帽釋出RHEL 8 Beta版本,提供原生容器開發包

Anthony avatar
By Anthony
at 2018-11-21T22:41
https://www.ithome.com.tw/news/127092 紅帽釋出RHEL 8 Beta版本,提供原生容器開發包 不久前紅帽才釋出RHEL 7.6版,除了瞄準混合雲應用外,也加強了該產品的維運機能,如 改善資管管控以及自動化維運等功能。而在近期,紅帽也釋出了RHEL 8 Beta版本。遵 ...

在Apache上啟動VirtualHost使用HTTP和HTTPS

Ula avatar
By Ula
at 2018-11-21T09:36
怎樣在Apache上啟動VirtualHost使用HTTP和HTTPS同時運作 還沒使用VirtualHost的時候 A網頁已經設定好SSL Https 也可以正常使用https://server.a.com 如今要加入ㄧ個B網頁http ( 沒有用SSL ) http://server.b.com ...

Secure Boot的疑問

Iris avatar
By Iris
at 2018-11-20T14:28
各位版上大大好, 小弟目前正在嘗試建立可以在secure boot要求下開機的開機USB碟 有蠻多關於這方面的問題想要來請教版上大大們, 以Ubuntu系統的測試結果, x86似乎是不支援uefi的secure boot, 僅x64系統有支援, 這方面不知道是否有理解錯誤? 第1步驟似乎是先要有 ...

debian使用NFSv4失敗

Brianna avatar
By Brianna
at 2018-11-19T00:19
OS: Debian GNU/Linux 9.6 (stretch) x86_64 想用win10來存取linux上的檔案 但我的win10之前不知道動了什麼,不能開samba也不能用samba 所以只能用NFS了 win10的NFS Client不能用UTF-8,會亂碼 但聽說用NFSv4能用UTF-8, ...