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

    Needs help - Virtual Hosting


    I just installed FC4 and followed someonline tutorials to get Apache running.

    Yes, I can see the default Apache welcome page that comes with Fedora.
    Reading more in Virtual hosts, I was able to set up a sample virtual host after editing the following:
    * httpd.conf at /etc/httpd/conf/httpd.conf,
    * hosts file at /etc/hosts

    and then the actual "virtual-host-example" DIR whose content is "index.html" - hello world. The DIR is placed at /var/www/html......from all that I read.

    It works fine, and I was able to set up another sample virtual hosts site.....with a different DIR name at /var/www/html.....I can access this second sample host via my web browser.

    I then tried a third, however the DIR(virtual-host-5) is placed at /home/toks, modified the :
    * httpd.conf at /etc/httpd/conf/httpd.conf,
    * hosts file at /etc/hosts

    accordingly. I also did a "chmod -R 755 /home" for permissions.

    Q1) when i try to access "" i Get the error
    Forbidden...You dont have permission to access / on this server....additionally, a 403 Forbidden error was encoutnered while trying to use and ErrorDocument to handle the request........Apache 2.0.54 Fedora server at Port 80
    Q2) how do I access the working virtual-host examples from another computer within my lan.

    For an index.html file on the server, by typing the IP address of my server on my browser of another PC(WinXP), i can see Fedoras default page etc....I also tried the "server-IPaddress/virtual-host-example" from my LAN PC, but it results in page cannot be displayed.

    Note i can access all the working virtual-host-examples on my FC4 browser directly.

    pls help

  2. #2
    Just Joined!
    Join Date
    Jan 2005
    A1) maybe the user which runs apache has no permission to read the /home/blabla directory.
    A2) there are two ways to do that: first in every computer you should edit the hosts file... YES in windows DOES have that file... in ~ c:\windows\system32\drivers\net\hosts maybe... the second way is to setup a DNS server which should be setup to all computers which you want to access the virtual hosts.
    A3) you can make symlinks in /var/www/html to all virtual domains.
    ex. /var/www/html/ points to /home/virtual/

  3. #3
    thanks wfw,

    1) the user which runs my apache is "apache".

    How do i give it a permission to read the /home/blabla DIR....?
    i already have chmod 777 /home on my home DIR.....will this suffice?

    2) Yeah, theres a 'hosts' file on my windows do i edit it? what do i add/delete? i hope this will not screw up my winxp....

    3) I read up about the symlinks stuff. I think ill be more comfortable with this. how do i make a symlink from /var/www/html to all virtual i have to create some file there, or ?


  4. $spacer_open
  5. #4
    Just Joined!
    Join Date
    Jan 2005
    hi again
    1) in fedora (i think) every user has a group named like the name of the user. so you can add apache user in the /etc/group in every user's group which should be read from the apache user.
    for example:
    blabla user has record in /etc/group
    you should change it to:
    now apache has a group rigths for that user. simply chmod 750 /home/blabla and user blabla will read-write in his own home dir, apache will ONLY read in that dir, and everybody else will not be allowed to read the directory... this is some kind of security improvement

    2) this file has no extension, but it is simple text file. you can edit it with your favourite text editor. there is one record inside for the localhost.. so you can see the exact syntax.

    3) check
    man ln
    links are made by this command:
    ln -s /home/blabla /var/www/html/blabla
    now you can access the domain via http://YOUR_IP_ADDRESS/blabla,
    but you should add in your httpd.conf:
    Options FollowSymLinks
    in the <Directory /> directive. this will make apache to follow the link

Posting Permissions

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