Apache2 – 404错误 – 从Windows迁移PHP文件到Ubuntu遇到错误

我找不到任何问题。

附录00-default

AccessFileName .htaccess Alias /api "/var/www/AppServices/public" Alias /server_api "/var/www/AppServices/Server_API" Alias /client_api "/var/www/AppServices/Client_API" Alias /secure_api "/var/www/AppServices/Secure_API" Listen 8002 <VirtualHost *:8002> DocumentRoot /var/www/AppServices/public ServerName .local # This should be omitted in the production environment SetEnv APPLICATION_ENV development <Directory "/var/www/AppServices/public"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> 

的.htaccess

 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d [OR] RewriteCond %{REQUEST_FILENAME} !-s [OR] RewriteRule ^(.*)$ index.php?request=$1 [QSA,NC,L] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ index.php [NC,L] RewriteCond %{REQUEST_FILENAME} -s RewriteRule ^(.*)$ index.php [NC,L] </IfModule> 

。 index.php在该文件夹下。

 /var/www/AppServices/Server_API$ ls . .. admin.php .htaccess index.php infor.php message.php 

当我发布JSON到这个URL

xxx.xxx.xxx.xxx:8002/server_api/message

我得到了404错误:

 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /var/www/AppServices/Server_API/index.php was not found on this server.</p> <hr> <address>Apache/2.2.22 (Ubuntu) Server at xxx.xxx.xxx.xxx Port 8002</address> </body></html> 

它看起来像在相同的文件夹下的.htaccess文件正在工作。 它将URL“ http://xxx.xxx.xxx.xxx:8002/server_api/message ”翻译成“ http://xxx.xxx.xxx.xxx:8002/server_api/index.php?request=message ”。 但apache2无法find在同一文件夹中的index.php。

– 编辑 –

在Apache2 error.log中:

[Sun Apr 14 21:08:17 2013] [error] [client 127.0.0.1]文件不存在:/ var / www / AppServices / public / var

公用文件夹中没有var。 但为什么????