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.