vhcs (
http://www.vhcs.net) (Virtual Hosting Control System) is asoftware solution to run a webserver, mailserver, DNSserver, FTP serveron linux (the current supported OS for now)
Q.How to install it
Just follow the TUTOrial below:
First begin by instaling ubuntu (don't need to choose server option, iwill give you solutions to tweak it also).. after ubuntu is installed,Do the following:
Now you have the solution to either install it manually by followingthe silver text down there or follow the automatic method below:
wget
http://www.siemens-mobiles.org/vhcs/vhcs.shnow type
sudo sh vhcs.sh
and follow the inline instructions
NOTE: You are not authorised to modify/remove the license that isinside the script 3 times, it's 15 line and must be always the same 15line, but you can modify the script and/or redestribute it withoutchanging those licence lines, thank you
0. make sure you have all needed repository, tested with /etc/apt/sources.list
deb
http://archive.ubuntu.com/ubuntu/ hoary main restricted universe multiverse
deb
http://security.ubuntu.com/ubuntu/ hoary-security main restricted universe multiverse
deb
http://archive.ubuntu.com/ubuntu/ hoary-updates main restricted universe multiverse
1-making temp directories (you can change them to anything but we just need a folder to drop the files in it to make vhcs)
sudo mkdir /root/vhcs_tmp
sudo mkdir /root/vhcs_tmp/install
cd /root/vhcs_tmp/install
2- we update the current installed system
sudo apt-get update
sudo apt-get upgrade -y
3-removing some uneeded packages, which can also cause the system not to function properly
sudo apt-get remove -y lpr nfs-common portmap pidentd pcmcia-cs pppoe pppoeconf ppp pppconfig
4-removing some service from /etc/inetd.conf file
sudo update-inetd --remove daytime
sudo update-inetd --remove telnet
sudo update-inetd --remove time
sudo update-inetd --remove finger
sudo update-inetd --remove talk
sudo update-inetd --remove ntalk
sudo update-inetd --remove ftp
sudo update-inetd --remove discard
5-installing all needed packages
sudo apt-get install -y ssh postfix postfix-tls proftpd-mysqlcourier-authdaemon courier-base courier-imap courier-maildropcourier-pop libberkeleydb-perl libcrypt-blowfish-perl libcrypt-cbc-perllibcrypt-passwdmd5-perl libdate-calc-perl libdate-manip-perllibmime-base64-perl libdbd-mysql-perl libdbi-perl libio-stringy-perllibmail-sendmail-perl libmailtools-perl libmd5-perl libmime-perllibnet-dns-perl libnet-netmask-perl libnet-perl libnet-smtp-server-perllibperl5.8 libsnmp-session-perl libterm-readkey-perl libtimedate-perlperl perl-base perl-modules bind9 diff gzip iptables libmcrypt4mysql-client mysql-common mysql-server patch php4 php4-mcryptphp4-mysql php4-pear procmail tar original-awklibterm-readpassword-perl libsasl2-modules libsasl2 sasl2-bin apache2apache2-common apache2-mpm-prefork libapache2-mod-php4 bzip2
6-getting vhcs archive file from vhcs.net (this is for the current 2.4beta version, visit
http://www.vhcs.net for the current/latest version)
sudo wget
http://puzzle.dl.sourceforge.net/sourceforge/vhcs/vhcs2.4.tar.bz27-exctracting the archive, and entering into the vhcs sources directory
sudo bunzip2 vhcs2.4.tar.bz2
sudo tar -xvvf vhcs2.4.tar
cd ./vhcs-2.4
8-installing the vhcs
8.1-make install vhcs which will put all the file into /tmp/vhcs2 folder
sudo make install
8.2-copying all the files into their real directory
sudo cp -R /tmp/vhcs2/etc/* /etc
sudo cp -R /tmp/vhcs2/var/* /var
sudo cp -R /tmp/vhcs2/usr/* /usr
ok now vhcs files are in place, we proceed to the configuration now,
9-so first we change/create the mysql root password
mysqladmin -u root -p password "new password here"
10-after the vhcs has been installed, and the mysql root has been changed let's make sure we are in the latest packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get clean
11-ok, this is the time to make vhcs installed and fully operational,
sudo /var/www/vhcs2/engine/setup/vhcs2-setup
here you will be asked about passwords, ip etc... it's recommanded that you use private ip of the server
12-VHCS installed, now you need to include the apache configuration file and to restart apache
so open /etc/apache2/httpd.conf
sudo pico /etc/apache2/httpd.conf
and append the following instruction at the end of the file
Include /etc/apache2/sites-available/vhcs2.conf
restart apache
/etc/init.d/apache2 restart
13-finally we add the daemon to boot on ubuntu startup
sudo update-rc.d vhcs2_daemon defaults
sudo update-rc.d vhcs2_network defaults
now visit
http://whatever.the.servers.ip.is/vhcs2/ orhttp://127.0.0.1/vhcs2/ and begin by creating a reseller, then ahosting template to add a domain
F.A.Q
Q.How to make ubuntu start without X server, to have more free RAM
from a terminal remove gdm, xdm and kdm (normally only gdm is installed but just to make sure)
sudo apt-get remove gdm
sudo apt-get remove xdm
sudo apt-get remove kdm
Q.How to make it possible that the user use .htaccess file (normally can't be used, give ERROR 500)
edit /etc/vhcs2/apache/working/vhcs2.conf file
search for in the domain you need to give the rights to use .htaccess file
AllowOverride AuthConfig
replace with
AllowOverride All
replace the file /etc/apache2/sites-available/vhcs2.conf with this one
sudo cp /etc/vhcs2/apache/working/vhcs2.conf /etc/apache2/sites-available/vhcs2.conf
restart apache2
sudo /etc/init.d/apache2 restart
Q.is it possible to make it by default .htaccess can be used
Yes. Open /etc/vhcs2/apache/parts/{prefix}_entry.tpl where {prefix} is "als" and "dmn" and "sub" without quotes
search for
AllowOverride AuthConfig
replace with
AllowOverride All
edit also /etc/vhcs2/apache/working/vhcs2.conf to enable it for the current registered domains
replace all occurences of:
AllowOverride AuthConfig
with
AllowOverride All
copy this file to /etc/apache2/sites-available/
sudo cp /etc/vhcs2/apache/working/vhcs2.conf /etc/apache2/sites-available/vhcs2.conf
restart apache2
sudo /etc/init.d/apache2 restart
Q.mysql root password is stored in /etc/proftpd.conf in clear text, can i hide it?
you can only hide it from normal users, but unfortunately it will be always visibe to sudoers users
sudo chmod 0600 /etc/proftpd.conf
Q.how to change mysql password
changing the mysql root passwors is easy, just follow this four steps
1. begin by changing the mysql root password with
mysqladmin -u root -p password "new password here"
2. go to /var/www/vhcs2/engine and execute vhcs2-db-password
cd /var/www/vhcs2/engine
sudo ./vhcs2-db-password
follow the screen instructions,
3. go to /etc open proftpd.conf and change password there
sudo pico /etc/proftpd.conf
search for (Ctrl + W to search with pico)
vhcs2@localhost
you will find after it root and your old mysql password so update the password.
4. restart proftpd
/etc/init.d/proftpd restart
that's it

--== new questions will be added later also keep checking this topic ==--
Troublesshooting
Q.When i run /var/www/vhcs2/engine/setup/vhcs2-setup file, i get errors something about mysql error
this error has occured because your mysql password contains nonalpha-numeric charachters, this can be solved by editing/var/www/vhcs2/engine/setup/vhcs2-setup, so:
sudo pico /var/www/vhcs2/engine/setup/vhcs2-setup
Ctrl + w to search, type "setup_sql" without quotes
go down and find the line
my $cmd = "$main::cfg{'CMD_MYSQL'} --user=$main::db_user--pass=$main::db_pwd < /tmp/db.sql 1>/tmp/db.sql.stdout2>/tmp/db.sql.stderr";
replace in it
--pass=$main::db_pwd
with
--pass=\"$main::db_pwd\"
so it will look like this
my $cmd = "$main::cfg{'CMD_MYSQL'} --user=$main::db_user--pass=\"$main::db_pwd\" < /tmp/db.sql 1>/tmp/db.sql.stdout2>/tmp/db.sql.stderr";
run /var/www/vhcs2/engine/setup/vhcs2-setup again
Q.my ips are resolving private to the outside (dnsreport.com report private ips instead of public ones)
There's two methods to solve this problem, i will state one now, the second one will be added later
this method consist of reinstalling VHCS with public IP, and solveapache resolving problem (when public ip is used, apache will no longerresolve domains)
first you need to remove all added users (go to vhcs2 database in mysql and see the uid in admin table)
sudo userdel vu200X
where X is the user number (vhcs2 will begin with 1)
remove the added groups
sudo groupdel vu200X
where X is the group number (vhcs2 will begin with 1)
remove the working conf files
sudo rm /etc/vhcs2/apache/working/vhcs2.conf
sudo rm /etc/vhcs2/bind/working/*
sudo rm /etc/apache2/sites-available/vhcs2.conf
sudo rm /var/cache/bind/*
now you're ready to install, repeat only step 11 but use public ip this time
now proceed to edit the apache files to resolve correctly
Open /etc/vhcs2/apache/parts/{prefix}_entry.tpl where {prefix} is "als" and "dmn" and "sub" without quotes
replace
<VirtualHost {DMN_NAME}>
with
<VirtualHost *>
recreate reseller, etc... now
Q.FTP always give authetifications incorrect!!!
sudo pico /etc/proftpd.conf
search for
SQLConnectInfo vhcs2@localhost root
mysql root password must be in clear text right after root in the aboce text, if not add it and
sudo /etc/init.d/proftpd restart
Any suggestion about a step, or any question to be added to the F.A.Q/Troubleshooting is appreciated
Thanks to alexkotov, BeeEmm, Ico Dimov, Dimitri Tarassenko, NigelJones, Markus Petzsch, Tassoman, developpers of VHCS open sourceproject (
http://sourceforge.net/projects/vhcs/)
Version History