
램프 서버 데이터베이스를 만들려고 합니다. 내가 갈 때로컬호스트내 브라우저에는 기본 아파치 "작동 중" 페이지가 표시됩니다. 하지만 내 데이터베이스를 보려고 할 때로컬호스트/게시물오류 메시지 404가 표시됩니다. Posts는 cake라는 데이터베이스의 테이블입니다.
나는 모든 것을 제거하고 처음부터 다시 시작하려고 여러 번 시도했습니다. 이것은 내가 따르는 튜토리얼입니다.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
문제는 폴더 권한입니다. 응용 프로그램 폴더의 폴더 및 파일 권한을 확인하고 경로도 확인하세요.