Results 1 to 9 of 9

Thread: Vhost....Again

  1. #1

    Default Vhost....Again

    So i decided to reinstall opensuse today. I learned alot getting it setup to the point that i had it and thought i would like to see if i can do it again.

    I did everything the exact same way as before with my vhosts, and i guess it is working. They point to the correct place, but before if public_html was empty it would give an error

    Access forbidden!

    You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

    If you think this is a server error, please contact the webmaster.
    Now i just get an Index of / with an empty page..
    but if i go to a directory that does not exist i get the desired access forbidden message

    why would i be getting different results and what can i do to?


    also rather than post another topic. I tried to install OpenSUSE on my laptop with same dvd I just used to install on desktop.. Desktop installed without a hitch, Laptop fails and says cannot build repository... I searched forum and nothing seems to apply as it will install on my desktop?

  2. #2

    Default Re: Vhost....Again

    also i notice that public_html has a .directory file that was never there before so i deleted it.

    When i look in my apache error log it says

    [Mon Jul 07 23:28:44 2008] [error] [client 192.168.1.1] File does not exist: /home/xxxxx/public_html/favicon.ico


    why would it be trying to find that?

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Vhost....Again

    In the original default server in /etc/apache2/default-server.conf there is this line inside the stanza for <Directory "/srv/www/htdocs">

    Code:
    Options None
    This forbids Indexes also so people can't see what's in the directory, they have to ask for index.html either explicitly or implicitly through a DirectoryIndex directive.

    If you want to do the same for your vhosts, then use the Options directive to set it how you want in the vhost's directives.

    A non-existent directory or file is always an error, but you can trap 404 errors and provide a more meaningful page if you like, using the ErrorDocument directive.

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Vhost....Again

    Quote Originally Posted by geoffmcc View Post
    also i notice that public_html has a .directory file that was never there before so i deleted it.

    When i look in my apache error log it says

    [Mon Jul 07 23:28:44 2008] [error] [client 192.168.1.1] File does not exist: /home/xxxxx/public_html/favicon.ico


    why would it be trying to find that?
    Browsers look for that. Look at the location bar when on this forum website. See that icon next to the URL? You can put any interesting icons on your websites that you like to help visitors recognise your site. It also goes into bookmarks.

    Google for favicon for the gory details.

  5. #5

    Default Re: Vhost....Again

    Thats what i dont get. I didnt have to do any of that before. But thanks for the info

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Vhost....Again

    Because each vhost is like a new website. The settings for the default website don't carry over.

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Vhost....Again

    You probably had something in a vhost.conf that affected the global configuration. If it's outside of a <VirtualHost> scope, then it has global effect, even though you put it in a vhost configuration file.

  8. #8

    Default Re: Vhost....Again

    thanks again ken. I got it figured out and tried to delete message before you read, but looks like you allready replied.

    I just had to add

    <Directory /home/geoffmcc/public_html>
    Order Deny,Allow
    Deny from all
    </Directory>

    whereas before i had

    <Directory />
    Order Deny,Allow
    Deny from all
    </Directory>

    I wish i knew what i did differently to not make it work by default, but oh well we got it working

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Vhost....Again

    <Directory /> Deny from all </Directory> is a fallback restrictive permission that applies to the whole filesystem, just in case.

Posting Permissions

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