0

My host has hidden files on my node.js webserver (he did this may/june 2013) and can't remember how/what he did...

I need to ask at this point as I have been reading around centos stuff and looking into http.config file and not really seeing anything change when turning things off and on again.

the symptoms:

when you goto mysite.com all you see is index of (no files are shown) but the public_html is full of .js files, folders, an image .png (this is good)

when you go to mysite.com/example.png you get 404 not found (this is bad)

when you go to mysite.com/example.js you get 404 not found (this is good!)

the code in .js files can be accessed just fine by my_client_code_site.com (this is also good!)

any clues as to how this behaviour was achieved?

is this helpful?:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>

UPDATE

More info from my host:

a) only two domains running, files are visible on one domain, not on the other (so whatever rule there is, it's working not server-wide)

b) virtual host config in httpd.conf is identical for both domains (except forIP address and paths, of course)

c) I tried swapping the names of the home dirs with each other (and chown accordingly) and it still does not work (files invisible)

Where else can I look to pinpoint what it could be?

UPDATE: we think it has something to do with the referer

1
  • Possibly more appropriate on unix.se? So people can answer your question, please show appropriate config files from your httpd. Sep 21, 2013 at 19:37

3 Answers 3

1

Look at the Apache error-log, or access-log. I'd suggest this might be some mod_rewrite or other .htaccess security.

Perhaps the simplest way to proceed would be to ask the admin who made the change(s) what they did, why they did it, and how to revert.

EDIT: Is your webserver apache, or is it a node.js application? You're not 100% explcit.

6
  • there is no .htaccess file(s) Sep 22, 2013 at 16:57
  • webserver is centos6/apache i think. and it is running a node.js app Sep 22, 2013 at 16:58
  • node.js runs as a server. apache runs as a server. WHICH ONE is returning the 404s?
    – user9565
    Sep 23, 2013 at 7:24
  • apache i guess seen as i said "when you go to mysite.com/example.png you get 404 not found". (viewing a .png doesn't have anything to do with node) Sep 23, 2013 at 7:49
  • I use a node.js server to serve a website, it will happily return HTML, JSON, and PNGS. You're really not giving us enough information to go on so I'm afraid you're not likely to get an answer.
    – user9565
    Sep 23, 2013 at 8:53
1

Have you checked DNS/NS to ensure the domain is going to the correct server? Otherwise, check the vhost configurations again and ensure the document root is correct.

EDIT: have you checked permissions of the files?

3
  • the document root is correct and its not a dns issue because everything else resolving fine Sep 21, 2013 at 23:00
  • Check permissions? Incorrect permissions will create 404's
    – Jason
    Sep 21, 2013 at 23:41
  • already checked them, they are not the cause Sep 21, 2013 at 23:57
1

There may be a .htaccess file in your public_html folder that is preventing access to those files.

1
  • there are no .htaccess files on the server Sep 22, 2013 at 17:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .