Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Making a directory viewable to the public...

    Hello, I am hosted by godaddy and use linux shared hosting plan... My question is how do I get a directory viewable to the public... like a normal /pub.

    I created a /pub directory however whenever I link to it, it seems to be looking for a html file because I get a file not found error.

    Here is an example of a working /pub directory.

    Index of /pub

    To be more clear I created a /pub in the root directory of my server, however when I link to it I get a file not found error. I have tried setting permissions and things, seems not to work. I want it to list the files I have in /pub. =)


  2. #2

    I assume you are using Apache. If that is the case, you can do one of the following:

    As root, create a "pub" directory:
    # mkdir /var/www/html/pub
    You should now be able to access it.
    OR (the more tricky option)

    As the root user, navigate to /var/www/html
    Create a soft link to your /pub directory
    # ln -s /pub
    Set permissions for your /pub directory
    # chmod 755 /pub
    Edit: I followed my own advice and ran into problems with SELinux (not sure if it applies to your distro). This is what I did to overcome that problem:
    # chcon -R system_u:object_r:httpd_user_content_t:s0 pub/
    I recommend creating /var/www/html/pub - much easier.

    If that still doesn't work, have a look at your httpd.conf file and make sure that Options Indexes FollowSymLinks is present in <Directory "/var/www/html">.

    Hope that helps.

Posting Permissions

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