# Need advice on setting up VPS for hosting multiple domains



## pentago (Aug 1, 2014)

Hi guys,

I'd need to set up a VPS (_4 cores, 8GB RAM, 80GB SSD_) for about 20-ish really small scale Wordpress websites for a friend. (Are these resources sufficient to support it?)
Now, I'm not asking for specific instructions, rather advice on best practices to make it productive and secure enough.


How would I manage 20-ish unique IP's I'll get from provider? Would I need to set up 20 PF aliases or create separate interfaces for each IP somehow?
My dilemma is whether each of those domains would be best to be run from jail or as an Apache vhost? Sure, Apache vhost might be easier to set up but there are security implications which I'd like to evade. Also, sysutils/ezjail looks really simple to set up.
What would be resource usage for those 20-ish jails? 
Do *I* limit jails in terms of resource usage somehow?
Is each jail exact copy of base jail, meaning that each jail will be like ~1GB in size?

How would each user SFTP/SSH into his jailed domain document root? Would *I* need to sort that out with PF?
Thanks.


----------



## SirDice (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*



			
				pentago said:
			
		

> *1.* How would I manage 20-ish unique IP's I'll get from provider?
> Would I need to set up 20 `PF` aliases or create separate interfaces for each IP somehow?


You're probably not getting 20 IP addresses. You probably will only get just 1. This is not an issue though, using virtual hosts you can have as many sites as you want on that one IP address.

What I would do (and have done for my own sites), is run net/haproxy on the host and create one or more jails to run the sites on. Using haproxy you can divert each site to its own jail, or some sites to jail1 and others to jail2, or any other combination thereof. It will even allow you to run some sites on Apache and some other sites on nginx. The combinations that are possible are end-less. Using this will allow you to separate for example production sites from test sites.


----------



## pentago (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*

No, there will be 20 unique IP's bought for this purpose. Each site will have its own IP hence the question about how would I manage those.
Thanks for the tip on haproxy, will look into it.


----------



## SirDice (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*

If you do get 20 IP addresses you could bind each jail to its own IP address. But to be honest I think it's a waste of money.


----------



## pentago (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*

SEO-wise, it isn't. I'll look into jail IP binding. Would I have to set up pf in each of those jails or just on the host?


----------



## SirDice (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*



			
				pentago said:
			
		

> Would I have to set up pf in each of those jails or just on the host?


This can only be done on the host. Unless you use VIMAGE (experimental!) you cannot change, modify or firewall the network from within a jail.


----------



## drhowarddrfine (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*



			
				pentago said:
			
		

> SEO-wise, it isn't.



Having a unique IP for each site will not affect SEO. Why do you think it would?


----------



## pentago (Aug 1, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*

Depends on your angle. Google rankings won't be affected by shared IP in any way but having those 20 domains interlinked somehow might be seen as a tampering attempt (e.g. link wheel ) thus posing the treat of penalties for entire group of domains.


----------



## pentago (Aug 18, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*

Answers I found and settle with:

1. Create lo0 device clone (lo1) and let sysutils/qjail handle the aliases for each new jail it creates.
2. Jailed each domain with httpd/php. Connect them all to one, master mysql jail.
4. Each jail domain user connect to his own IP/domain name and gets redirected by `PF` rules for each domain IP.


----------



## drhowarddrfine (Aug 18, 2014)

*Re: Need advice on setting up VPS for hosting multiple domai*



			
				pentago said:
			
		

> Google rankings won't be affected by shared IP in any way but having those 20 domains interlinked somehow might be seen as a tampering attempt


Having separate IP addresses doesn't change that. Their algorithms look at content. They still figure it out.


----------

