Debian Admin - Your way to Debian World

July 30, 2007

A SUCCESSFULL installation guide to VHCS2 on Debian Etch (4.0)

by @ 2:54 pm. Filed under General, Webserver

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I’ve read a lot of manuals, how-to’s etc. describing the process of setting a Debian webserver containing the great VHCS2 control panel system. I’ve tried them all, and all were failing for me on several critical points. So i tried to gathered all steps to this one-stop how-to.

First of all, download your debian-etch iso from http://cdimage.debian.org/debian-cd/4.0_r0/i386/iso-cd/debian-40r0-i386-netinst.iso (for i386 systems only, please visit http://cdimage.debian.org/debian-cd/4.0_r0/ for other distributions) and burn your iso to CD-ROM (you can use CDBurnerXP for free, http://www.cdburnerxp.se/).

Startup your server with the CD inserted. When the boot-manager is shown, ENTER. The setup wizard for Debian Etch will start and guide you through the installation procedure of Debian.
Important!:

when asked at software selection choose Standard system only and hit continue
when asked if the GRUB boot loader has to be installed, choose Yes
Next we go on preparing our system for VHCS.

after installation and re-boot, for your sake install the SSH server:

#apt-get install ssh
Now you can log-on from your desktop machine into your fresh debian server by using Putty (and the best of all, copying and pasting parts of this manual directly into your terminal).

Configure your network interfaces:

#vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.0.201
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

Now run

echo your.defined.hostname > /etc/hostname

Reboot the system:

#shutdown -r now

Afterwards, run:
#hostname
#hostname -f

Both should show your hostname (like server1.example.com)

Edit /etc/apt/sources.list and comment out the cd-rom entry:
#vi /etc/apt/sources.list

#
# deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main

# deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main

deb http://ftp2.de.debian.org/debian/ etch main
deb-src http://ftp2.de.debian.org/debian/ etch main

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib

save the file and exit.

Then run:
#apt-get update

And run:

#apt-get upgrade

Now, install the MySQL server (MySQL5):

#apt-get install mysql-server mysql-client libmysqlclient15-dev phpmyadmin

We want MySQL to listen on all interfaces, not just localhost, so:

#vi /etc/mysql/my.cnf

find the line “bind-address = 127.0.0.1″ and comment it out:
# bind-address = 127.0.0.1

then, we restart MySQL:
#/etc/init.d/mysql restart

now check that networking is enabled, run:
#netstat -tap

You should see a line like this:
tcp 0 0 *:mysql *:* LISTEN 3281/mysqld

Run
#mysqladmin -u root password yourpassword
#mysqladmin -h server1.example.com -u root password yourpassword

(replace yourpassword with your desired password, replace server1.example.com with the hostname you set at installation)

next we install Apache 2(.2) with PHP5

#apt-get install apache2 apache2-doc apache2-mpm-prefork apache2.2-common apache2-utils libexpat1 ssl-cert

next we install php5

#apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

you will be asked the following question:

Continue installing libc-client without Maildir support?

DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

edit /etc/apache2/ports.conf and add Listen 443:

#vi /etc/apache2/ports.conf

Listen 80
Listen 443

now we have to enable some Apache modules (SSL, rewrite, suexec, and include):
#a2enmod ssl
#a2enmod rewrite
#a2enmod suexec
#a2enmod include

and reload the apache configuration:
#/etc/init.d/apache2 force-reload

now we’re going to prepare the system for the VHCS installation:

#apt-get install postfix postfix-tls

Please at request fill in the hostname you’ve entered at the debian installation, e.g. server1.example.com

#apt-get install proftpd proftpd-mysql

Please choose for “Stand alone” at request

#apt-get install courier-authdaemon courier-base courier-imap courier-maildrop courier-pop libberkeleydb-perl libcrypt-blowfish-perl libcrypt-cbc-perl \
libcrypt-passwdmd5-perl libdate-calc-perl libdate-manip-perl libdbd-mysql-perl libdbi-perl libio-stringy-perl libmail-sendmail-perl \
libmailtools-perl libmd5-perl libmime-base64-perl libmime-perl libnet-dns-perl libnet-netmask-perl libnet-perl libnet-smtp-server-perl \
libperl5.8 libsnmp-session-perl libterm-readkey-perl libtimedate-perl perl perl-base perl-modules bind9 diff gzip iptables libmcrypt4 patch procmail tar original-awk libterm-readpassword-perl \
libsasl2-modules libsasl2 sasl2-bin bzip2 gcc make libc6-dev

then open /etc/proftpd/proftp.conf to stop some errors from ProFTPD:

#vi /etc/proftpd/proftpd.conf

UseIPv6 off

Then, add some security fixes to it:

DefaultRoot ~
IdentLookups off
ServerIdent on “FTP Server Ready”

save the file and exit.

next we’re going to download the vhcs package:
#cd /usr/src
#wget http://downloads.sourceforge.net/vhcs/vhcs2-2.4.7.1.tar.bz2

then unpack the archive:
#tar -xjf vhcs2-2.4.7.1.tar.bz2

enter the newly created directory:
#cd vhcs2-2.4.7.1

now, we’re creating the installer:
#make install

after this, go to:
#cd /tmp/vhcs2-2.4.7.1

and copy all of it’s content to the right destination:
#cp -R * /

after this, go to:
#cd /var/www/vhcs2/engine/

now, edit the file vhcs2_common_code.pl
#vi vhcs2_common_code.pl

now, turn on displaying line numbers within Vi:
:set nu

scroll down to line 1408, look for:
`key`=>$main::db_pass_key,

next, add the following line BEFORE the above quoted line:
`keysize`=>32,

scroll down to line 1446 where you will need to repeat the above steps

now save the file and exit.

Start-up the VHCS2 installer:

#cd /var/www/vhcs2/engine/setup
#./vhcs2-setup

At setup, fill in all fields requested.

Now you’ve succesfully installed your debian etch machine containing VHCS2 for virtual hosting!

Tags: , , , , , , , , , , ,

You may also be interested in...

13 Responses to “A SUCCESSFULL installation guide to VHCS2 on Debian Etch (4.0)”

  1. Wiktor Says:

    This manual is great. But is there any possibility to have antivirus and antispam filter on this?

  2. Jim Says:

    After make install:

    after this, go to:
    #cd /tmp/vhcs2-2.4.7.1

    ***

    I get a No Such Directory error. Any idea how to resolve this?

    Thanks!

  3. sci2tech Says:

    go to:
    #cd /tmp/vhcs-2.4.7.1

  4. Fabio Says:

    Hi Ewonde and hi all, first thanks for this article, very complete, useful and thus time saving ;)
    I followed the entire instructions on a fresh Etch installation, I only had a (little) problem with proftpd installation and maybe any others in the future could have so I’m posting here how I solved it.

    Apparently, the VHCS2 installer put proftpd.conf in /etc/, but in Debian Etch it should be inside /etc/proftpd/, another thing that I needed was adding the line:

    Include /etc/proftpd/modules.conf
    inside /etc/proftpd.conf (I added it simply in the first block and it works)

    and also, inside /etc/proftpd/modules.conf add a comment to the line about postgresql module like that:
    # LoadModule mod_sql_postgres.c
    (because it seems that proftpd try to use postresql BEFORE than mysql indipendently from
    the order listed in the modules.conf files)

    With this setting, now ftp works, I just have a warning inside the web interface about the unaccessibility of the /tmp directory but I think that this should be caused by the proftpd chroot env. so I don’t worry to it that much…

    Cheers
    Fabio

  5. Vendor Says:

    Well, thanks for taking the time and help us on those modifications, great script.

  6. Chris Says:

    I followed it exactly and while running the setup script I receive this error after entering admins email:
    ERROR: External command ‘/usr/bin/mysql –user=USER –pass=PASSWORD/tmp/db.sql.stdout 2>/tmp/db.sql.stderr’ returned ‘1′ status !

    Anyone know how to resolve that?

    Before I saw this install guide, I attempted to this install and finally got everything working but when trying to access the site after setup script installed I recieved just a blank page, even when trying to access the /admin/ section. Only time I could recieve something was when I would make a up a directory in teh vhcs2 folder like /vhcs2/sdad/ it would give a page not found within vhcs.

  7. Mike Murphy Says:

    Hi all. Followed everything to the letter and after running ./vhcs2-setup and filling in the details, I get the following. I have no idea what to do beyond this point. Any help would be greatly apprciated.

    Mike Murphy

    Can’t exec “keysize”: No such file or directory at /var/www/vhcs2/engine/setup/../vhcs2_common_code.pl line 14 08, line 8.
    Odd number of elements in anonymous hash at /var/www/vhcs2/engine/setup/../vhcs2_common_code.pl line 1408, line 8.
    Please provide an encryption/decryption passphrase or key using -key at /var/www/vhcs2/engine/setup/../vhcs2_c ommon_code.pl line 1408

  8. Flo Says:

    he i have the same thing like Murphy.

    only difference in mine installation is that i use php4…

  9. Viktor Says:

    Thanks Fabio, great help :)

  10. Bjorn Says:

    Hi verry nice article!
    everything works except for one thing is the proftp.
    It starts
    Client connects to the server
    But this is what i get next:

    Response: 530 Login incorrect.
    Error: Unable to connect!

    I also took the changes from fabio but it didnt work..
    I really want to use VHCS and the ftp has to word else its useless.

    Anyone that fixed this problem?

    Greetz Bjorn
    the netherlands

  11. Bjorn Says:

    Hi
    for the one had also this problem this is the solition. It worked for me
    go to
    # cd /etc/proftpd/
    and change the file proftpd.conf to proftpd2.conf
    just for backup.

    then copy the file
    # cd /etc/proftpd.conf
    to
    # cd /etc/proftpd/proftpd.conf

    then you edit this to the proftpd.conf file

    UseIPv6 off
    DefaultRoot ~
    IdentLookups off
    ServerIdent on “FTP Server Ready”

    (see manual)

    and at last you restart proftpd with

    etc/init.d/proftpd restart

    If you get no errors then it should work.

    Good luck

  12. Fabio Says:

    Hi All,
    this maybe can help Murphy and Flo:

    when you cut and paste instructions from this howto (above) pay attention that in perl code you must use normal
    hypenation while in this “html generated page” you would cut a back-hypen (I really don’t know the english name of it ;) … I hope to be clear, anyway, look around below line 1408 inside /var/www/vhcs2/engine/vhcs2_common_code.pl and use the SAME hypenation that already is in the perl script …

    Another thing:
    if when finished the setup, all work but webmail, go inside /var/www/vhcs2/gui/tools/webmail/inc/inc.php
    and delete the “\r\n” from lines 153 and 154.

    good luck!
    Fabio

  13. Ehsan Says:

    This comment help me after some hours trying to change vftp password :
    Apparently, the VHCS2 installer put proftpd.conf in /etc/, but in Debian Etch it should be inside /etc/proftpd/, another thing that I needed was adding the line.

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

WidgetBucks - Trend Watch - WidgetBucks.com

Related Links:


WidgetBucks - Trend Watch - WidgetBucks.com

Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.