我已經安裝了LAMP堆棧的Ubuntu 14.04服務器。Apache配置 - 指向Ubuntu中的目錄14.04
我有一個目錄/home/alex/checkhtml
其中包括一些測試的PHP和HTML。
我要的是,當我訪問http://localhost/checkhtml的/home/alex/checkhtml
內容將被顯示(實際上/home/alex/checkhtml/index.html
)
這裏是我做過什麼:
- 轉到:在/ etc/apache2的/ conf-可創造
apache-php.conf
文件 這些行添加到
apache-php.conf
:Alias ^/php "/home/alex/php" <Directory /home/alex/php> Order allow,deny Require all granted </Directory>
進入到/ home /亞歷克斯/ checkhtml創造
.htaccess
並添加這些行:<FilesMatch "."> Allow from all </FilesMatch>
啓用
apache-php.conf
和重啓apache
然而,當我嘗試:http://localhost/checkhtml 。錯誤出現:
The requested URL /checkhtml was not found on this server.
有誰知道我在這裏做錯了嗎?
謝謝,最好的問候。
Alex
你想訪問'/家庭/亞歷克斯/ checkhtml',但你已經創建了Apache的php.conf的路徑規則'/家庭/ alex/php' – nidhi
對不起,我的複製和粘貼錯誤。 別名^/checkhtml 「/家/亞歷克斯/ checkhtml」 <目錄/ home /亞歷克斯/ checkhtml> 訂購允許,拒絕 要求所有授權 – AlexPham