Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't find out anything go wrong.

appendix with 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



<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]

. the index.php is under the folder.

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

When I POST JSON to this url

I got 404 error:

<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL /var/www/AppServices/Server_API/index.php was not found on this server.</p>
<address>Apache/2.2.22 (Ubuntu) Server at Port 8002</address>

It looks like the .htaccess file under the same folder is working. It translate url "" to "". But the apache2 can't find out the index.php in the same folder.

- Edit -

in the Apache2 error.log :

[Sun Apr 14 21:08:17 2013] [error] [client] File does not exist: /var/www/AppServices/public/var

there is no var in the public folder. But why????

share|improve this question
What are the access and error log showing? It might just be a filesystem permission issue. – Krist van Besien Apr 15 '13 at 7:42
I can't understand why apache2 tried to find out "var" folder/file. I moved configuration from Windows... It was fine on Windows. – Robert Yi Jiang Apr 15 '13 at 8:12
Could you please check the case in your samples and directory structure ? One big difference between Windows and Unix file system is that unix's is case sensitive: Server_API is different from server_api. If you mix the case in your request on a windows system, it will work but it'll give you a 404 on *nix – Stephane Apr 15 '13 at 8:25
I will try it tonight. Thank you :D – Robert Yi Jiang Apr 19 '13 at 4:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.