opensuse Virtual host Suggessions?

Hi, I need some advice about virtual hosting on opensuse 11.1. I have about 6 domains running on the server. I use Webmin and Virtualmin on my server. Everything is working ok but I feel that I do something wrong :slight_smile:

  1. Lets say I have domainname.com web and mail server running. When I write domainname.com on my browser, the site is coming up but when I also write mail.domainname.com and I see the same page. There is no record on apache for mail.domainname.com, there is only DNS record for the mail server. What do I do wrong?

  2. Apache conf. is as below; do you think is it better to write “any” on address section instead of ip? What is the difference?

Address 88.11.11.111 (ip isn’t true)
Port 80 Server Name domainname.com
Document Root /srv/www/domainname.com/public_html

  1. IP Address is the same for all domains. How I can configure that; when I write the ip address on my browser, only the specific site which I choose will be opened? Whichever I created last, that site is opening right now.

Thanks in advance.

Use apache name based virtual hosts.

Apache Virtual Host documentation - Apache HTTP Server

You have to create a configuration file for each domain. These files live in /etc/apache2/vhosts.d

All domain names point to the same ip address. When you access the server under a certain domain name the respective website is displayed.

Thanks for you reply vodoo… But I am already using name based virtual host. Here is the example;

Handles the name-based server domainname.com on address 88.88.88.88.
Address 88.88.88.88
Port 80 Server Name domainname.com
Document Root /srv/www/domainname.com/public_html

All the web site has the same configuration (only the domainname section changes). And all the web sites are working good. What I want to do is that for example when write the ip 88.88.88.88 on the browser, I want to see domainname3.com instead of domainname.com. How can I configure that? As I wrote before, I also don’t want to give any access on mail.domainname.com. That address is not even on apache virtual host list. I am really confused here :disapointed:

List the virtual host configuration for domainname3.com first in the configuration file to make it the default host. It will be displayed when you access the server with an IP number.

I also don’t want to give any access on mail.domainname.com.

You could use mod_rewrite to block any access to mail.domainname.com.