/var/.htaccess and Internal Server Error

314 views
Skip to first unread message

pa...@cancamusa.net

unread,
Apr 14, 2013, 2:51:00 AM4/14/13
to web...@googlegroups.com
Hello:

After a complex migration, I was getting errors, nono of my web2py sites was working:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

The server log pointed to the problem: A file /var/.htaccess roughly as follows:

deny from all
AllowOverride None
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory

I had to remove the file, and it all worked again. Do you know what happens? Haven found many references on the web.

Regards

LightDot

unread,
Apr 14, 2013, 7:13:14 PM4/14/13
to web...@googlegroups.com
The .htaccess is an Apache issue, doesn't have anything to do with web2py as such. Better said, it's not really an Apache issue either, as the .htaccess and Apache worked as expected, according to the instructions in the .htaccess.

You should be talking to whoever put the file there, as he/she obviously didn't want any pages to be accessible from anywhere under /var directory... What's the reason for this I can only guess.

Regards,
Ales

pa...@cancamusa.net

unread,
Apr 15, 2013, 9:23:02 AM4/15/13
to web...@googlegroups.com


El lunes, 15 de abril de 2013 01:13:14 UTC+2, LightDot escribió:
The .htaccess is an Apache issue, doesn't have anything to do with web2py as such. Better said, it's not really an Apache issue either, as the .htaccess and Apache worked as expected, according to the instructions in the .htaccess.

You should be talking to whoever put the file there, as he/she obviously didn't want any pages to be accessible from anywhere under /var directory... What's the reason for this I can only guess.

This was in a fresh ubuntu server 12.04. I didn't put it there. The literal text appears in the web, as an issue with some installs of moodle and a software called magento. So someone might have this problem later, I guess. I just wanted to warn future web2py users, and confirm it is safe to remove the file.

LightDot

unread,
Apr 15, 2013, 10:31:18 AM4/15/13
to web...@googlegroups.com
That's intriguing. Since it's a clean server and you didn't put it there, it makes me wonder where it came from.

Magento docs refer to var/.htaccess and not /var/.htaccess, so that's a relative path, inside Magento's install directory. Other posts I see just refer to /var/.htaccess as an example, when explaining how apache looks for .htaccess files recursively, all up to the top level directory. Then I went further and confirmed that there aren't any official Ubuntu 12.04 packages that install this file:

http://packages.ubuntu.com/search?searchon=contents&keywords=var%2F.htaccess&mode=&suite=precise&arch=any

Anyway, you've solved your problem. I'm doing a lot of sysadmin work in the last years, so these kind of "mysteries" probably interest me too much for my own good :)

Regards,
Ales

Pablo Angulo

unread,
Apr 15, 2013, 11:30:59 AM4/15/13
to web...@googlegroups.com
El 15/04/13 16:31, LightDot escribió:
> That's intriguing. Since it's a clean server and you didn't put it
> there, it makes me wonder where it came from.

Hmmm, most probably, I untarred a file with a moodle file folder at the
wrong place, then moved the folder but not the hidden file .htaccess!
Thanks for your patience
Reply all
Reply to author
Forward
0 new messages