1829399 Members
1687 Online
109991 Solutions
New Discussion

Re: Virtual Hosting

 
SOLVED
Go to solution
Kyle D. Harris
Regular Advisor

Virtual Hosting

Has anybody ever done any Virtual Hosting? If so how did it go? And is there any tips/tricks i should know or look out for? Thanks
8 REPLIES 8
Mark Grant
Honored Contributor

Re: Virtual Hosting

What do you mean by virtual hosting?

We have nearly all our Windows "servers" as vmware sessions on Linux boxes. Is this the kind of thing you mean?
Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor

Re: Virtual Hosting

I host multiple domains, httpd, smtp dns on one Linux Server.

If you specify what you are trying to do, I can be of assistance to you.

You need to decide if you are doing named based or ip based virtual hosting in apache. Named based lets you assign more than one web site per ip address. You can't do this with ssl sites.

The sendmail side is fun, but also pretty straightfoward.

Config files:
/etc/aliases
/etc/mail/sendmail.mc
/etc/mail/virtusertable
/etc/mail/genericstable
/etc/mail/access

Like I said, if you have specific questions I can answer those. Your current question is to broad.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kyle D. Harris
Regular Advisor

Re: Virtual Hosting

Steven-
Ok, Here's the exact scenario. We have 2 older slower crappy servers that each host a fairly large website with alot of information that changes daily on them from scripts. We just got a nice new Dell server that we would like to put both of the old servers on this new one with virtual hosting.

Therefore each ethernet card would have it's own IP address. So It would be like 2 seperate servers on one big server with different IP addresses. Hope this helps or is more specific. Do you see Virtual Hosting being difficult with what I am trying to do? Thanks
Steven E. Protter
Exalted Contributor
Solution

Re: Virtual Hosting

You are best off making one httpd server.

Choose one of the websites top be the master server.

ServerName fully_qualified_name_of_master_server


For the secondary web server.
In httpd.conf


ServerAdmin webmaster@host.some_domain.com
DocumentRoot www/docs/host.some_domain.com
ServerName host.some_domain.com
ErrorLog logs/host.some_domain.com-error_log
CustomLog logs/host.some_domain.com-access_log common


You need an IP address set up for the secondary in /etc/sysconfig/network-scripts

Names based Virtual Hosting example.




ServerAdmin webmaster@host.some_domain.com
DocumentRoot www/docs/host.some_domain.com
ServerName host.some_domain.com
ErrorLog logs/host.some_domain.com-error_log
CustomLog logs/host.some_domain.com-access_log common


The DNS record to support this is slightly different than IP based virtual hosting.

Let me know if you need that, I can post it when I get back to my private office.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jerome Henry
Honored Contributor

Re: Virtual Hosting

Hi Kyle,

Steven will undoubtedly give you more precise tip.

In between, what you are doing is virtual hosts based on IP, as, if I get you clearly, each card links to one site (do you know that you can also do Virtual hosts based on names, that is to say one NIC, one IP, and 2 different sites with 2 different sites names and contents on the same machine ?).

Oh, I se Steven replies. Let you read his post.

J
You can lean only on what resists you...
Kyle D. Harris
Regular Advisor

Re: Virtual Hosting

Steven-
Thanks alot for the help. Yes can you please post that when you get back to your private office. I wasn't sure if it mattered or not about using two httpd daemons, but I guess i'll go with one. I may be out for the weekend in a few, so i'll check this board Monday. Thanks!

J-
Yes, that is correct, each card will link to a seperate website. I was aware from reading up about name based and IP based, not sure if ones better then the other or if it doesnt' matter. Thanks.
Steven E. Protter
Exalted Contributor

Re: Virtual Hosting

This is the DNS record for hpux.ws.zone

It works with a names based hosting scenario. I have altered the external ip addresses.

$TTL 86400
@ IN SOA @ dns1.investmenttool.com (
2003090401 ; serial
3600 ; refresh
3600 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS dns1.investmenttool.com.
@ IN NS dns2.investmenttool.com.
@ IN MX 10 hpux.ws. ; primary mail exchanger

@ A 62.91.163.194
www A 62.91.163.194
dns1 A 62.91.163.194
dns2 A 62.91.163.195

ftp CNAME investmenttool.com.
mail CNAME hpux.ws.


Here is the record from the DNS zone of the Master Server.

$TTL 86400
@ IN SOA @ dns1.investmenttool.com (
2003080705 ; serial
3600 ; refresh
3600 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS dns1.investmenttool.com.
@ IN NS dns2.investmenttool.com.
@ IN NS dns3.investmenttool.com.
@ IN MX 10 investmenttool.com. ; primary mail exchanger

@ A 62.91.163.194
www A 62.91.163.194
smtp A 62.91.163.194
dns1 A 62.91.163.194
dns2 A 62.91.163.195
dns3 A 62.91.163.195

jerusalem CNAME investmenttool.com.
localhost CNAME investmenttool.com.
ftp CNAME investmenttool.com.


The DNS records are extremely important to this scenario.

httpd -t I think tests your httpd.conf situation.

You will probably eventually need to handle sendmail in your situation, you probably want to post a new question. Stuart is better at that than I am.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jerome Henry
Honored Contributor

Re: Virtual Hosting

And if your use scripts, then you may need to tune your httpd server to get better performances.
Just ask on that too if required.

J
You can lean only on what resists you...