Find the answer to your Linux question:
Results 1 to 4 of 4
When I visit localhost it shows a list of directories that I can enter except a certain one that I want to. This directory that doesn't show on localhost shows ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2013
    Posts
    2

    Question Directory not showing in localhost


    When I visit localhost it shows a list of directories that I can enter except a certain one that I want to. This directory that doesn't show on localhost shows when I browse to it on "My Computer". It has the same file permissions as the other directories. I'm new to linux (been using for 3 weeks) and have no clue what to do.

    Any help is greatly appreciated. Also if you need me to post any specific details that may help in the solving process please tell me to do so.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    hello and welcome, mdahlke!

    What is the "path" to the directory? You should be able to "cd" to the directory in a Terminal. That directory is what we need to know.

    it is probably either a permissions thing, or a "DocumentRoot" thing (as in, the dir is not inside your webserver's document root, and thus is not visible).

  3. #3
    Just Joined!
    Join Date
    Sep 2013
    Posts
    2
    The path to my directory is /home/michael/Dropbox/Websites/ ...
    I had change the DocumentRoot path to this and it works (well, worked) just fine until this morning. It shows all other folders in that directory except the one that I want to work with currently.
    The directory is inside the the DocumentRoot ( I have triple checked this ) and has the same permissions as the other directories that are visible.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by mdahlke View Post
    The path to my directory is /home/michael/Dropbox/Websites/ ...
    I had change the DocumentRoot path to this and it works (well, worked) just fine until this morning. It shows all other folders in that directory except the one that I want to work with currently.
    The directory is inside the the DocumentRoot ( I have triple checked this ) and has the same permissions as the other directories that are visible.
    instead of changing your DocumentRoot, you can add additional config files that Apache will read at startup. in such a config file, you could use an alias, like this:

    Code:
    # user dir alias
    Alias /user_web/ "/home/user/web/"
    <Directory "/home/user/web">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    and then restart the Apache webserver. then browse here:

    Code:
    http://localhost/user_web/
    and you should see your files. if not, take a look at the apache error log.

    but note that by default, user home dirs do not have read/execute permissions for all. that will foil your efforts. check the home dir perms with this:

    Code:
    ls -ld /home/michael
    it is probably drwx------, so change it like this:

    Code:
    chmod a+rx /home/michael
    however, that does mean anyone has read access in your homedir. not probably what you want. so what i'd do is create a dir somewhere else, like /data/michael/web, then do my work there (and create the apache alias there). you can always put a symlink to it in your home dir, for your own convenience.
    Last edited by atreyu; 09-14-2013 at 01:09 AM. Reason: code comments

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •