
Ich versuche, eine Lamp-Server-Datenbank zu erstellen. Wenn ich gehe zulokaler Hostin meinem Browser wird die Standard-Apache-Seite "Es funktioniert" angezeigt. Aber wenn ich versuche, meine Datenbank mitlocalhost/BeiträgeIch bekomme die Fehlermeldung 404. Posts ist eine Tabelle in einer Datenbank namens Cake.
Ich habe mehrmals versucht, alles zu entfernen und von vorne anzufangen. Dies ist das Tutorial, dem ich folge:Swift: Verwenden externer Datenbanken und APIs, Teil 1: Einrichten des Servers
Dies sind meine Konfigurationsdateien. 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
Und die 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>
Antwort1
Das Problem liegt an der Ordnerberechtigung. Überprüfen Sie die Ordner- und Dateiberechtigungen des Anwendungsordners. Überprüfen Sie auch den Pfad.