Jump to content

[SOLVED] Virtual Hosts problem


Recommended Posts

I'm pretty new to running a server and even more so to Linux. So what I did was to use the tutorial "Fedora 9 Perfect Server" to get it up and running. However I skipped ISPConfig since I felt that it was completely useless for me since I'm not trying to create a webhosting service but a server for a small amount of personal websites. Instead I installed webmin to configure the various parts of the server.

 

Now we're getting to my problem. While I've gotten most parts of the server to run real well (well ok e-mail's not working still either) I now have issues pointing the domain names their own paths on the server. Normally this would be done via DNS obviously, but since I'm behind a dynamic IP (can't get static either, just confirmed that) I can't configure my own nameservers.

So, with the webmin interface I add the virtual domains I want:

umz.homelinux.com with docroot /var/www/umz.homelinux.com

umz.homelinux.org with docroot /var/www/umz.homelinux.org

 

I've also got umz.homelinux.net but since I want that one to point to /var/www/html I leave it (I also tried adding this as a vhost and adding a vhost to grab all not configured and point them to /var/www/html).

 

Here's the newly added code to httpd.conf:

NameVirtualHost 213.114.169.208
[...]
<VirtualHost umz.homelinux.com>
DocumentRoot "/var/www/umz.homelinux.com"
<Directory "/var/www/umz.homelinux.com">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost umz.homelinux.org>
DocumentRoot "/var/www/umz.homelinux.org"
<Directory "/var/www/umz.homelinux.org">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

 

Apache restarted without problems.

 

The problem now: For some reason umz.homelinux.com AND umz.homelinux.net point to /var/www/umz.homelinux.com while umz.homelinux.org points to it's specified directory.

As I mentioned earlier I've also tries (a) adding a umz.homelinux.net entry that points to /var/www/html even though the default is pointed to that location. (b) adding an entry to process unhandled requests (pretty much the same as the default, if not exactly the same) and pointing it to /var/www/html.

 

Why it's adding the NameVirtualHost entry I do not know. Since this points my current IP this can't be a good thing. Thus I try removing that line to see what happens.

Upon restarting Apache I receive the following error:

Starting httpd: [Tue Jun 03 23:41:57 2008] [warn] VirtualHost umz.homelinux.com:0 overlaps with VirtualHost umz.homelinux.org:0, the first has precedence, perhaps you need a NameVirtualHost directive

 

The problem now: Exactly the same problem as before, though thanks to the Apache warning message I have some addtional information on the subject... It's "overlapping"... whatever that means. I can't see how it can be in anyway overlapping when they have their separate entries.

 

Any help with this is greatly appreciated. I've been at this for quite some time.

Link to comment
Share on other sites

IMO you'd be better off dropping the whole webmin thing and learning to configure manually. Understanding the underlying concepts is allot more important and useful than learning some simple tool.

 

NameVirtualHost *

<VirtualHost *>
  ServerName umz.homelinux.net
  DocumentRoot "/var/www/html"
  <Directory "/var/www/html">
    allow from all
    Options +Indexes
  </Directory>
</VirtualHost>

<VirtualHost *>
  ServerName umz.homelinux.com
  DocumentRoot "/var/www/umz.homelinux.com"
  <Directory "/var/www/umz.homelinux.com">
    allow from all
    Options +Indexes
  </Directory>
</VirtualHost>

<VirtualHost *>
  ServerName umz.homelinux.org
  DocumentRoot "/var/www/umz.homelinux.org"
  <Directory "/var/www/umz.homelinux.org">
    allow from all
    Options +Indexes
  </Directory>
</VirtualHost>

Link to comment
Share on other sites

THANKS!!!!!!!!  :D

 

That solved it!

 

IMO you'd be better off dropping the whole webmin thing and learning to configure manually. Understanding the underlying concepts is allot more important and useful than learning some simple tool.

 

Well, I can edit the config files from inside webmin. Since I'm new to this I feel it's easier to start with something that puts all the tools inside a graphical interface. But it's not like I'm not trying to learn to do stuff "manually". I have learned quite a few things actually. I even learned how to edit and save files in vi/vim!! OMG! ;p Sure there's alot more to learn tho.

 

Thanks again!

Now I need to see about getting postfix/dovecot/etc to run properly...

Link to comment
Share on other sites

Now I need to see about getting postfix/dovecot/etc to run properly...

 

That'll be fun for you. Ive been using and configuring Linux for 5+ years, and mail server configurations always do my head in.

 

Have fun though!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.