Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hello, I'm running vanilla SuSE 11.1 on a vanilla server with Webmin 1.51 and Apache 2.2. For a month now, I've been trying to get virtual hosts to work with ...
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24

    webmin virtual hosts not working

    Hello,

    I'm running vanilla SuSE 11.1 on a vanilla server with Webmin 1.51 and Apache 2.2.

    For a month now, I've been trying to get virtual hosts to work with Webmin without success. When I browse for the second site, I continually come up with the default host site.

    There have been several suggestions to just forget Webmin and modify the httpd.conf file directly. That defeats the purpose of trying to use Webmin. Please, I've heard that suggestion before.

    I'm open to any suggestions otherwise and will gladly post the httpd.conf file as well as the vhosts.d subdirectory files.

    I've posted this question over on the webmin forum without any sucess either.
    Any Ideas?

    Thanks in advance for your assistance...

    Blaine

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Posts
    4
    This is most likely an Apache configuration issue - webmin just displays and edits the Apache files. Posting the vhosts files will help find the solution

  3. #3
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    <VirtualHost patriciaspostcards.com>
    DocumentRoot /srv/www/patriciaspostcards
    <Directory "/srv/www/patriciaspostcards">
    allow from all
    Options +Indexes
    </Directory>
    </VirtualHost>

  4. #4
    Just Joined!
    Join Date
    Nov 2007
    Posts
    4
    Please post the default vhost config in addition to any other vhosts in the directory.

    You could also post the results of:

    apache2ctl -S

    For this you need to be logged on as root.

  5. #5
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    apache2ctl -S
    httpd2: apr_sockaddr_info_get() failed for gtpam
    httpd2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
    VirtualHost configuration:
    wildcard NameVirtualHosts and _default_ servers:
    *:* gtmachining.com (/etc/apache2/vhosts.d/webmin.1269726043.conf:1)
    *:* 127.0.0.1 (/etc/apache2/vhosts.d/webmin.1273368591.conf:1)

  6. #6
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    vhosts.d sub-files coming up in a sec...

    Thanks for your assistance and time...

    Blaine

  7. #7
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    vhost.template file is as follows..

    Can't post the template file... Site restriction as I haven't made 15 or mor posts yet...

    I'll try to attach it... or quote the contents of the file...

    Blaine

  8. #8
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    cat webmin.1269726043.conf
    <VirtualHost *>
    DocumentRoot /srv/www/gtmachining
    <Directory "/srv/www/gtmachining">
    allow from all
    Options +Indexes
    </Directory>
    ServerName gtmachining.com
    </VirtualHost>

  9. #9
    Just Joined!
    Join Date
    Nov 2007
    Posts
    4
    Please note following uses "dot" to qualify domain names as I am not allowed to post URLs (yet)!

    The output of apache2ctl says it all - the server name could not be determined. You can have a look at the /etc/hosts file to see the valid hosts or in webmin go to Networking->Network Configuration->Hostname and DNS. This should have the correct host name (perhaps gtmachiningdotcom if this is the main host of the server) or some other server name that has a valid DNS record. In webmin you can also add each of the virtual hosts you are hosting in apache to Networking->Network Configuration->Host Addresses. This is where you can set a valid server IP address to the domain you want to host. Note this is strictly speaking *not* required for virtual hosting in apache. Dont forget to "Apply Configuration" when finished - this writes out the changes to the /etc/hosts file.

    Now for the vhosts. The default configuration (the one that will be used for any non matched virtual host) is usually named default.conf and looks like:

    <VirtualHost _default_>
    DocumentRoot "/srv/www/htdocs"
    <Directory "/srv/www/htdocs">
    allow from all
    Options +Indexes
    </Directory>
    </VirtualHost>

    If it doesn't exist then recreate it. Change the /srv/www/htdocs to whatever you want to host as the default site. In your files it looks like this will be /srv/www/patriciaspostcards.

    Webmin does a lousy job of naming vhost files so rename webmin.1273368591.conf to something more meaningful. I usually name the vhost files to the domain name with .conf extension eg gtmachiningdotcom.conf. This allows you to easily browse the vhosts directory and know which file is which domain.

    For webmin.1273368591.conf: if this domain is now the default then you won't even need the file so delete it (or rename it to remove the .conf and apache wont try to process it)

    There will most often be a problem if you mix virtual host definitions:

    <VirtualHost *>
    <VirtualHost patriciaspostcardsdotcom>

    From past experience I recommend always using the first format and specifying the ServerName and ServerAlias within the entry:

    <VirtualHost *>
    ServerName gtmachiningdotcom
    ServerAlias wwwdotgtmachiningdotcom
    etc....

    Note the server alias to take care of the www version of the domain - otherwise it wont be matched by apache!

    Restart apache and try apache2ctl -S again. Hope this helps

  10. #10
    Just Joined!
    Join Date
    Jan 2007
    Posts
    24
    OK! It does help, but I must have taken my slow pills today, because I understood about haf of what you said. I get the part about renaming the vhosts bit and that there's something I need to change in my /etc/hosts file.

    I need to host multiple websites, gtmachining as well as patriciaspostcards and so on. I just started with those two.

    I had this all up and running on an old SuSE 10.3 site when the server crashed in hardware.

    I thought I rebuilt it the same way as it was. Apparently not, as I see that the new server is using IPv6 notation in the /etc/hosts file. Would you suggest I rebuild and stick with the old IPv4 hosts file and make whatever corrections I should make to that /etc/hosts file?

    What should it look like? Also, don't I need to make some changes to the resolv.conf file as well? Like what?

    Like I said, I'm a little slow today. I do appreciate your help very much. Any specific details I can send to you? At this point, I'd give you root, temporarily, so you could make mod.s as necessary. I'm braindead trying to get this thing to work.

    What ever works, Amigo...

    Thanks for your kind assistance..

    Blaine

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
  •  
...