2

I have a webserver (Apache2, configured on Ubuntu Saucy Salamander 13.0x). On this server I have the following file in question: /var/www/xxxxx.com/insertToDB.php

Accessing this file using GET results with 500 Internal Server Error.

I have tried configuring the sites-available/xxxxx.com.conf to the following:

<Files *.php>
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Files>

<Files insertToDB.php>
    Order Allow,Deny
    Allow from all
</Files>

(And all other variations of Allow all for this specific file, php extensions wildcards and whats not..).

I have also done the same using .htaccess file directly on the folder where the file is hosted on (in the xxxx.com vhost) and on its parent(s). The 500 internal server error remains.

We have checked all Apache error.log and access.log. Nothing shows any specific error related to PHP5 installation (it works well on other vhosts as well, for index.php files) or version, or anything we could troubleshoot against. Perhaps we didn't search in the right place (?).

At last, I copied the sites-available/yyyy.con.conf (A vhost where index.php files are permitted and working well when accessing from the Web) to the sites-available/xxxx.com.conf file (As displayed below). Yet nothing works.

*The Apache server was reset after each single change :)

<VirtualHost *:80>

# Server name
ServerName xxxx.com

# Document root
DocumentRoot /var/www/xxxx.com

<Directory /var/www/xxxx.com>
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>

        # only allow access to insertToDB.php file
        <Files  ~ "\..*">
            Deny from all
        </Files>

        <Files insertToDB.php>
            Allow from All
        </files>


# Custom log file locations

</VirtualHost>
  • For the record - The PHP file in question (insertToDB.php) was tested to be working on a $4 a month Bluehost hosting and was working perfectly. In includes a very simple POST using CURL lib. It delivered no errors or so on the server where it was tested to be working on. Also - The filename was decapitalized also on some point to verify this is not the issue. The PHP log file is limited to 128MB (Not the issue either).

Any help would be VERY much appreciated.

13
  • You don't mention it, but have you already checked obvious permissions problems with the file?
    – dawud
    Jun 18, 2014 at 20:53
  • Yes I tried and changed the files, folders and top-folders permissions to most possible variations. Nothing..
    – Orr Yoffe
    Jun 19, 2014 at 11:27
  • I assume directly executing the script works OK? Also, do you have /var/www mounted with noexec
    – dawud
    Jun 19, 2014 at 11:29
  • Yes. It works 100% on any other properly configured server (its on Bluehost serving right now).
    – Orr Yoffe
    Jun 21, 2014 at 14:17
  • Have you tried putting any other php file in that directory (a simple phpinfo(), for example) to rule out a problem with the script itself?
    – dawud
    Jun 21, 2014 at 14:28

0

You must log in to answer this question.

Browse other questions tagged .