Link to home
Start Free TrialLog in
Avatar of pneuhaus
pneuhaus

asked on

Web access to Linux directory outside public_html?

I want to have a web user open an index.html file that is in a directory outside of the root directory for the website. (which I cannot move and do not what to copy)

For example, they would go to www.mydomain.com/stats (which would take them to /home/acctname/public_html) where they would find a symbolic link 'stats' pointing to /home/acctname/tmp/somedir where they would execute the index.html file there.

I symbolic link seems to work because I can 'cd stats' from /home/acctname/public_html and I change to the /home/acctname/tmp/somedir directory.

I also did a chmod a+rwx on the tmp directory and the index.html file there.

The problem is that I get a 404 error when going to www.mydomain.com/stats

Any suggestions?

Peter
Linux Newbie
Avatar of jlevie
jlevie

If you are going to use a symlink the Options on the document root need to include FollowSymLinks, e.g.:

  <Directory />
    Options FollowSymLinks Multiviews
 ...

An alternatve to that is to specify an Alias for the site, like:

  Alias /stats "/home/acctname/tmp/somedir"
Avatar of pneuhaus

ASKER

Clarification please:

Am I to type  
  alias /stats "/home/acctname/tmp/somedir"
at the bash prompt while in the webroot of acctname?
Seems like I'm missing and equal sign.

neither worked.
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to create symbol links use command "ld":

$ cd DIR_WITH_YOUR_INDEX.HTML
$ ln -s PATH_TO_INDEX_HTML_IN_ANOTHER_DIR ./index.html

now users in their brousers will see PATH_TO_INDEX_HTML_IN_ANOTHER_DIR
sorry!
i make mistake, i doesnt well read your question.
sorry aagain :)