Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
I configured httpd.conf for use of virtual hosts: uncommented NameVirtualHost *:80 created virtual hosts: <VirtualHost *:80> DocumentRoot /var/www/html ServerName localhost </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/vhosts/vundyn ServerName vun.dynalias.com </VirtualHost> <VirtualHost *:80> ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    virtual hosts are ignored (fc6)


    I configured httpd.conf for use of virtual hosts:

    uncommented NameVirtualHost *:80

    created virtual hosts:

    <VirtualHost *:80>
    DocumentRoot /var/www/html
    ServerName localhost
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot /var/www/vhosts/vundyn
    ServerName vun.dynalias.com
    </VirtualHost>

    <VirtualHost *:80>
    DocumentRoot /var/www/vhosts/lekkah
    ServerName lekkah.com
    </VirtualHost>

    The only page ever getting displayed is the default one on localhost. This is on Fedora Core 6, Apache 2.2.

    Before, I've had the same virtual hosts running perfectly well on Apache 1.3 on my Mac, but I want it to work on Linux too.

    Of course, I've read what is written on this page: VirtualHost Examples - Apache HTTP Server.

    Could something have gone wrong with the configuration of the Apache server? Will I have less problems using SUSE?

    Any help would be welcome. Thanx in advance.

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    it seems like I have had this problem before but I can't remember exactly what the problem was.

    Maybe permissions on the other virtual host directories?

    Not sure if this would have any effect or not since it should work both ways but instead of using *:80 use the actual ip of the machine (as long as its not dhcp)

  3. #3
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    problem persists

    Quote Originally Posted by jledhead View Post
    it seems like I have had this problem before but I can't remember exactly what the problem was.

    Maybe permissions on the other virtual host directories?

    Not sure if this would have any effect or not since it should work both ways but instead of using *:80 use the actual ip of the machine (as long as its not dhcp)

    Thanks jledhead, but the permissions are set to allow others to access the files (read only), which is perfectly alright, I think. Since my IP address is dynamic I can only use *:80 with DynDns and ddclient as an IP updater. I mentioned the fact that everything is working well on the Mac not in order to promote Mac but in order to maintain that all this should be working ok on Linux too.

    I still hope somebody can help me out here. This problem shouldn't exist, I think.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    heres a dumb question, have you restarted apache since making the changes

    is anything showing up in your error logs?

  6. #5
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    restart: yes, and no errors reported

    Yes, I restart httpd after every change, and no, no errors are being reported.

    Everybody can check what's happening by visiting the following page, for example:

    lekkah.com

    If you don't get that page but the default page, you know I didn't manage to solve the virtual hosting problem yet.

    What a headache!

  7. #6
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    maybe you could post your conf file so folks can take a look? Just from what you have shown I can't tell why its not working.

  8. #7
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    conf file

    The main problem, I have figured out, is the fact that uncommenting the line

    NameVirtualHost *:80

    remains without effect. The default page for redirection should be the first virtual host in Section 3. For testing I made this the default redirection page:

    /var/www/vhosts

    Instead, visitors are sent to the default redirection page as specified as the DocumentRoot in section 2:

    DocumentRoot "/var/www/html"

    This means I cannot activate Virtual Hosts.

  9. #8
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    problem solved

    I have not been lazy and reinstalled Fedora Core 6 completely. After that, virtual hosts worked.

    If I do not follow up on this post, it means virtual hosts kept on working after hundreds of updates.

    Thanx for your attention.

  10. #9
    Just Joined!
    Join Date
    May 2007
    Location
    Germany/Netherlands
    Posts
    39

    Server Name?

    OK, now this is what happened. Everthing worked, but after the new installation there was no server name in the HTTP Server Configuration (System => Administration => Server Settings => HTTP), so I put a name there.

    The line All available addresses on port 80 had gone from the field below Available Addresses, so I added All available addresses on port 80.

    After that, I got this message when I restarted httpd:

    Starting httpd: (98 )Address already in use: make_sock: could not bind to address [::]:80
    (98 )Address already in use: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    [FAILED]

    Httpd now refuses to start.

    I thought I'd be smart and remove the name from the Server Name field, but then I get the message that field cannot be left blank.

    Then I removed the line All available addresses on port 80. Result: I can start httpd now, but again only the default page will show up.

    I am starting to believe that Linux is too difficult for ordinary people like myself.

    What to do? Please, help.

    Attention! There is more than one page for this thread!

  11. #10
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    do this command
    #ps aux | grep httpd

    and see if there are any running apache process and kill them

    then try to start apache and see what happens.

Page 1 of 2 1 2 LastLast

Posting Permissions

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