HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   ispconfig3 Multiple Sites (Domains) in one Server (http://www.howtoforge.com/forums/showthread.php?t=32443)

dcarlos 14th March 2009 05:52

ispconfig3 Multiple Sites (Domains) in one Server
 
I'm trying to figure out how to use ispconfig3 to host two different Sites (Domains) in a single Server.

First of all I should say I'm not a server admin expert :)

I can add the two Sites, for example:
www.mydomain1.com and www.mydomain2.com

However this seams to generate two equal VirtualHosts in the httpd configuration.
mydomain1.com.vhost:
...
<VirtualHost *:80>
...

mydomain2.com.vhost:
...
<VirtualHost *:80>
...
In apache one will overlap the other, right?
Am I supposed to use Virtual IP addresses to do this?

Shouldn't ispconfig3 use domain names in the VirtualHost directive instead of ip addresses?
If so we would have:
<VirtualHost mydomain1.com:80>

Thanks in advance,
duarte

till 14th March 2009 10:55

Just click on new domain, enter the domain and click on save. You can add hundreds or thousands of domains like this to the same server.

Quote:

However this seams to generate two equal VirtualHosts in the httpd configuration.
No. They are not equal as the domain of the vhost does not has to be set in the virtualhost directive. Just try it and you see that it works.

Quote:

In apache one will overlap the other, right?
No.

Quote:

Am I supposed to use Virtual IP addresses to do this?
No.

Quote:

Shouldn't ispconfig3 use domain names in the VirtualHost directive instead of ip addresses?
No.

dcarlos 15th March 2009 02:42

Thanks
 
Correct. Thanks for the help!

OvrFlote 18th June 2009 15:12

Not exactly true
 
I came to this forum for some help and found this thread. It seemed to be right on track with the problem I am having, but his issue seems to be resolved and I'm still having the issue.

I installed ispconfig3 over opensuse 11.1 on an old box I had laying around.
I have 2 domain names from dyndns.com (one for me, and one for my wife)
I set her site up first everything works great, then I set my site up, and the problem begins.

when i run the command:

/etc/init.d/apache2 restart

this is what i get now:

[Thu Jun 18 07:55:37 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) [Thu Jun 18 07:55:38 2009] [warn] _default_ VirtualHost overlap on port 80, the first has precedence

so it seems as though, the original post about the virtualhosts overlapping is true.

so now i recieve the generic ispconfig "Welcome!" when i go to either site. I have racked my brain for months on this so i decided to post.

and if you can't tell I am a Newb. so go easy if i am doing something stupid.:D

till 18th June 2009 16:12

Quote:

so now i recieve the generic ispconfig "Welcome!" when i go to either site.
Thats fine as this message is only shown when your sites are working. So now just upload the content of your sites and delete the default index.html file created by ispconfig.

OvrFlote 18th June 2009 16:23

Nevermind
 
Ok so this is what I did to fix the issue, hope this helps some other fellow linux newbs.

cd /etc/apache2

vi listen.conf

delete the # in front of "NamedVirtualHost *:80"

==========================================
# Use name-based virtual hosting
#
# - on a specified address / port:
#
#NameVirtualHost 12.34.56.78:80
#
# - name-based virtual hosting:
#
NameVirtualHost *:80
#
# - on all addresses and ports. This is your best bet when you are on
# dynamically assigned IP addresses:
#
#NameVirtualHost *
===============================================

Then,

cd vhosts.d
cp vhost.template YourDomain1.com.conf
cp vhost.template YourDomain2.com.conf
vi YourDomain1.com.conf

Now, you need to replace all the "dummy-site.com's" with YourDomain1.com, but that is it, do not uncomment anything unless you know what you are doing.

vi YourDomain2.com.conf

Now, you need to replace all the "dummy-site.com's" with YourDomain2.com, but that is it, do not uncomment anything unless you know what you are doing.

Finally, restart apache

/etc/init.d/apache2 restart

you should see

Syntax OK
Shutting down httpd2 (waiting for all children to terminate) [my wife hates that terminology, lol]
Starting httpd2 (prefork)

there should not be anymore overlapping errors.

this is my own newb strategy and it worked for me, I now have two sites running on one server with one ip.

My setup is the perfect server opensuse 11.1 ispconfig 3 [thank you sourceforge]

my question is, why doesn't ispconfig 3 do this automatically??

Anyway, hope this helps someone. thanks again everyone.

OvrFlote 18th June 2009 16:27

Quote:

Originally Posted by till (Post 195129)
Thats fine as this message is only shown when your sites are working. So now just upload the content of your sites and delete the default index.html file created by ispconfig.

well, the problem was that my wife's site was setup and working fine (with content), but upon me adding my site VIA ispconfig 3, did both pages start showing the same default "Welcome!" html.

it was because apache2 was defaulting to serving only one site on both domains.

till 18th June 2009 16:29

ISPConfig uses the directory sites-enabled and not vhosts.d. You will find all vhosts in the sites-eanbled subdirectory. The directory vhosts.d must be empty or ispconfig will not work properly anymore.

If the vhost files are not in the directory sites-enabled then there is aerror in your configuration and you have to check the mintor why the files could not be written.

OvrFlote 18th June 2009 16:45

Right, and the .vhost files are in the sites-enabled directory, but it did not work that way for me.

in the vhosts.d directory, there are not .vhost files but they are .conf files.

and please advise how to fix the issue because i do not want to lose anything or break my ispconfig 3 setup.

simply adding the sites through ispconfig admin panel does not work on my setup. I was only able to host one site before i did what was in the other post.

is there settings i can post from my server so that you could tell me where I am going wrong?

till 18th June 2009 16:57

1) Delete all files in vhosts.d directory.
2) Did you select * or the IP address for the sites in the ispconfig settings?
3) Make sure that all domains point with a dns A-Record to your server IP. Dont use any redirects.


All times are GMT +2. The time now is 18:13.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.