
我正在嘗試創建一個燈伺服器資料庫。當我去本機在我的瀏覽器中,顯示預設的 apache「正在運行」頁面。但是當我嘗試查看我的資料庫時本地主機/貼文我收到錯誤訊息 404。
我曾多次嘗試刪除所有內容並從頭開始。這是我正在遵循的教程:Swift:使用外部資料庫和 API 第 1 部分:設定伺服器
這些是我的設定檔。 Apache2.conf
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
var/www.
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
還有 cake.conf:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/skip/cake/
<Directory /home/skip/cake/>
Options FollowSymLinks
AllowOverride All
</Directory>
CustomLog /var/log/apache2/cake-access.log combined
ErrorLog /var/log/apache2/cake-error.log
LogLevel debug
<FilesMatch \"\.(cgi|shtml|phtml|php)$\">
</FilesMatch>
BrowserMatch \"MSIE [2-6]\" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch \"MSIE [17-9]\" ssl-unclean-shutdown
</VirtualHost>
答案1
問題是資料夾權限。檢查應用程式資料夾的資料夾和檔案權限。