Suddenly my site won't find any documents that have been uploaded to our files directory even though the documents are there.

beckyjohnson - July 1, 2009 - 15:18

So, a day or two ago our hosting company restricted access to our site because the accounting office was way late paying the bill. It was like they somehow turned the CSS off on our site. So we paid the bill got the site back. I cleared the cache and the theme of the site came back. Everything looked fine and then today I realized that all the files we had uploaded on to the site, even though they are definitely in the sites/default/files directory, cannot be linked to from the website. If I click on a link to a document on the site, i get a page no found error. I am not sure what to do. Does any one have any advice about how / why this happened and how to fix it?

Becky

check the .htacces file in the files directory

xmacinfo - July 1, 2009 - 17:53

You should replace the .htaccess file in the file directory with a fresh one. I suspect the your hosting company did modify this file. Check also the root .htaccess file.

I was not able to link to files on one client's web site after some files have been compromised. I had to replace the .htaccess file in the files directory and all files were available again, either direct or through Drupal. After that, I had to reupload only a single file.

Thank you for the tip. I do

beckyjohnson - July 1, 2009 - 19:33

Thank you for the tip. I do think that they modified our htaccess file as when I checked the root file, custom things I had in there (page redirects) were missing. However, I uploaded fresh .htaccess files and i still get a page not found. check it out: http://www.wimaxroaming.org/documents I cleared the cache, ran cron, cleared my browser cache; it still doesn't work.
Too bad I was really really hoping you were right xmacinfo.

Becky

Did you check the other .htaccess file?

xmacinfo - July 1, 2009 - 21:02

Did you check the other .htaccess file? The one in the "files" directory?

Yeah I did. Actually I just

beckyjohnson - July 1, 2009 - 22:03

Yeah I did. Actually I just put a fresh one in. So the .htaccess file in the files folder only has this content in it now :
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

I emailed my host about this issue but I haven't heard back yet. :(

Becky

Reupload a file

xmacinfo - July 2, 2009 - 03:17

Please tell me, are your files private or public?

Did you try to re upload a file? If so, does is still give out a 404? Did you also try to download the file from a direct URL or from FTP?

If you find a solution, please let us know.

Jacques

I tried to re -upload a file

beckyjohnson - July 2, 2009 - 03:49

I tried to re -upload a file using a cck upload widget. As far as I can tell, it did not upload at all. I can't see the file via FTP. The files are public on the site as well. I tried to download the file from a direct url and have no luck. I can download via FTP though with no problem. The files open right up for me in word or Adobe Acrobat depending on the type of file.
And yes, I'm still getting page not found errors.

My host company isn't understanding the problem at all. They really aren't helpful....

Becky

They should be more responsible

xmacinfo - July 2, 2009 - 04:54

Your hosting company did break your site and don't know how to fix this... Tell them that you will publish their company name if they do not find how to fix their Apache setup.

So FTP works and the files are there; that means the issue is an Apache configuration that they did not put back as it was before. They can disable any or all .htaccess file from their side of Apache configuration. Let's hope they do not disable or override the values in the .htaccess files.

Ok. I heard back from my host

beckyjohnson - July 2, 2009 - 14:59

Ok. I heard back from my host but I can't tell if their solution is viable. I don't know what part of their wiki page to focus on.... Any ideas based on this:

this appears that your install of I believe Drupal is blocking the access
of this file. Unfortunately since we are unable to provide operational
support for third party programs since it is outside of our support scope
we are unable to pinpoint what is causing this.
We see this in wordpress, were wordpress will interfere with you getting
to your stats located at

http://www.wimaxroaming.org/stats

Wordpress gives a "page not found" error because it thinks you are trying
to get to a certain page, you see this same behavior with your sites
software. In cases like this we offer this guide that explains how to
tell wordpress to ignore the stats/ address.

http://wiki.dreamhost.com/Making_stats_accessible_with_htaccess#Editing_...

this same method should also work for your application, there may also be
a option within the admin section to stop the software from trying to
open the files for your site.
So again, not wure why turning off the site triggered this but it appears
that your sites software is interferring with the request for files and
not just the ones on the document page but even images of the site as you
can see by trying these links

http://wimaxroaming.org/sites/default/files/
http://wimaxroaming.org/sites/default/files/favicon.png
http://wimaxroaming.org/sites/default/files/interface_diagram_sm.png

this however does not appear to affect other parts of the site

http://wimaxroaming.org/sites/all/themes/custom/wimax_lite/logo.png
http://wimaxroaming.org/sites/all/themes/custom/wimax_lite/images/header...

this indicates that it is a security feature/setting that is doing this.

Becky

Well, they did still broke

xmacinfo - July 2, 2009 - 17:31

Well, they did still broke your site.

Please do these steps ASAP.

1. Copy all files to your computer
2. Copy the complete database to a SQL file
3. Install the local copy on your computer
4. Test it
5. If tests positive, delete the complete Drupal insallation at dreamhost
6. Reinstall the working copy from your computer complete with all .htaccess files

It's always a good idea to have local copies of sites and backup often.

Jacques

Ok. I am going to do what you

beckyjohnson - July 2, 2009 - 18:21

Ok. I am going to do what you suggest.

Becky

You should comment that out

-Anti- - July 2, 2009 - 18:40

You should comment that out until you've finished troubleshooting:

# SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
# Options None
# Options +FollowSymLinks

That sethandler line will bring up a 404 error on some hosts.
In fact, if I remember correctly, this htaccess file fixes a security bug with SQL4.
If you're using SQL5, I don't think you need it at all.
Double check that though.

Also, you should find out HOW your host disables accounts.
If they used the 'disable account' feature in WHM, then that may be an avenue of exploration.
If they replaced/edited your main htaccess, then that gives you a specific clue to follow.
If they added your IP to a firewall. If they edited your zone file. If they used ssh.
There are loads of things they could have done. You need to find out which method they used.
Then you can research what might have gone wrong.
Until you know this info, you are just shooting in the dark.

However, from what I've heard, you should definitely change host anyway.
For them to mess up your account, and then say they can't help you repair it is inexcusable.
If you've just paid for a year, you've got 30 days to get your money back; I suggest you do so.

Thank you for your comments.

beckyjohnson - July 2, 2009 - 20:05

Thank you for your comments. I am going to try commenting out those lines and I am going to install my site on my local drive to see what happens... I have just emailed my host specifically asking how they disable accounts. I wonder if I will get a useful answer.

Becky

I got this from my host

beckyjohnson - July 3, 2009 - 16:27

I got this from my host today:
As your account was suspended, it was not actually "disabled", it was
simply inactive. This means that the DNS for the domains was dropped
from our Name Servers, but no other changes were made to the hosting for
your domains. Meaning, the suspension process does not modify any of
your files, it simply turns off DNS and the Apache instance that hosts
your site.

Still working on setting up the site to test on my local host.
Becky

> the domains were dropped

-Anti- - July 3, 2009 - 17:48

> the domains were dropped from our Name Servers, but no other changes were made

But you said above:

>> I do think that they modified our htaccess file as when I checked the root file,
>> custom things I had in there (page redirects) were missing

So is it is possible that this problem started sometime prior your host changed the
nameserver, and that you just didn't notice it before?

You have checked the /files directory chmod haven't you?

At first glance, I thought

beckyjohnson - July 3, 2009 - 18:25

At first glance, I thought they had modified the htaccess file. I think I was mistaken. In any case fresh access files are up on the server now. The other evening I found out that my boss took out the page redirects and used a path redirect module to do the redirects.....
I have checked the files directory chmod. It is 744. Now, I'm thinking that this is a problem I didn't notice before, but I find it hard to believe no one else noticed either. I am back to checking permissions and things and my database.

Becky

I found an error in my

beckyjohnson - July 6, 2009 - 15:55

I found an error in my settings file. the line $db_url = 'mysql://wimaxroaming:password@mysql.wimaxroaming.org/roaming'; had an error in it where it said mysqli. I have fixed it and cleared my cache and it didn't solve the problem. ugh.

any other ideas on what to look at?

Becky

Ok I think i have this

beckyjohnson - July 6, 2009 - 16:35

Ok I think i have this narrowed down to a permissions problem. I chmoded some directories and managed to get all files viewable but I cannot upload yet. I use the CCK upload widget and I am not being allowed to write to the files directory for some reason. Here is a break down of my files and permissions:
default 555
files 775
The files in this folder are 664
The folders in this folder are (some files upload into their own folder) 775

My settings file is 444

Hopefully I can get this sorted out now properly since it looks to be a permission thing.. Does any one see any errors in the above?

Becky

 
 

Drupal is a registered trademark of Dries Buytaert.