Home » Linux OS and Software » How-To » Setting up VirtualHosts
Mon, 02 February 2009 13:28 Go to next message
Registered: February 2009
Messages: 3
Just wrapped this up on my server, figured I'd shared what I learned here.

Firstly, I took the "Debian 4.0 LAMP" option, since the last thing you want to do is run around installing server software when VPSVille can do it for you Wink

Hosting additional domains from one server requires 3 things:

1. DNS setup
The VPSVille control panel has options to add DNS records for your domains, just to get them pointed at the right IP address - this involves both adding the DNS record here, and configuring your domain at the registrar to use VPSVille's nameservers.

Now that visitors to those domains are being sent to your server, you need to serve the correct pages to them. For every domain I'm hosting on my vps, I've created a seperate folder inside /var/www, for instance:

/var/www/arcane.co.za
/var/www/futurespace.info


When you have your folders set up, you need to configure httpd.conf.

nano /etc/apache/httpd.conf


Hunt down and update the following setting. It, along with the rest of VirtualHost settings, are right near the bottom, so with nano, you could just hold down Ctrl+V to page down really fast.

NameVirtualHost *:80


Now, for every new domain you'd like to create a virtual host for, add a block like this:

<VirtualHost *:80>
    ServerName your.domain.tld
    DocumentRoot /var/www/your.domain.tld
</VirtualHost>


When you're done adding them all, do:

cd /etc/init.d
./apache restart


That will reload apache, and it should activate your vhosts.

And like the FAQ says, the sky's the limit Smile
Mon, 02 February 2009 18:19 Go to previous messageGo to next message
Registered: January 2009
Messages: 62
I'd also recommend adding,

ErrorLog /var/log/apache/domain.com/error.log
CustomLog /var/log/apache/domain.com/access.log combined

to each virtual host in case you decide to use webalizer later on to graph your statistics.

Also, if a client is going to manage thier own content you may wish to put thier files in /home/client/public_html/. And the logs in /home/client/logs/.

Makes for easier management too.

After installing the quota package with:

apt-get install quota

you can use this command to set a user quota:
(edit: found a much cooler way to do it)

edquota -u <username>

This functions like visudo, or vipw, and lets you edit a file that defines the users quota.

Space is given in 1K blocks and Inodes.

substitute -g <groupname> for a group quota.

Later,
Chris

[Updated on: Thu, 12 February 2009 08:11]

Mon, 25 May 2009 16:30 Go to previous messageGo to next message
Registered: May 2009
Messages: 21
Xenolith wrote on Tue, 03 February 2009 00:19

I'd edquota -u <username>


Hi,
is it possible to use a different editor than vi? I just hate it, I prefer nano much more.

Anyway, when trying to enable quotas I get a permission denied error. I already enabled 2nd level quotas from control panel. What do you suggest me?
Tue, 26 May 2009 10:24 Go to previous messageGo to next message
Registered: January 2009
Messages: 62
djechelon wrote on Mon, 25 May 2009 16:30


is it possible to use a different editor than vi? I just hate it, I prefer nano much more.



Try setting the various ENV vars and altering your /etc/alternatives via update-alternatives.

djechelon wrote on Mon, 25 May 2009 16:30


Anyway, when trying to enable quotas I get a permission denied error.



Are you using sudo?
Thu, 28 May 2009 10:53 Go to previous message
Registered: May 2009
Messages: 21
Xenolith wrote on Tue, 26 May 2009 16:24


Try setting the various ENV vars and altering your /etc/alternatives via update-alternatives.


Thanks. It worked. By the way, how large are blocks? I mean, what should I write to set a quota of 1GB for a certain user?
Quote:


Are you using sudo?


I log in to SSH as normal user, then run su, not sudo, to become superuser
Previous Topic:How does burst RAM work?
Next Topic:Suexec or disable php CLI
Goto Forum:
  


Current Time: Sun Dec 17 12:43:11 EST 2017
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2006 FUD Forum Bulletin Board Software