To set up a VPS from the default minimal Debian Etch template (you can find it in /vz/template/cache/), run:
[root@melbourne ~]# vzctl create 157 –ostemplate debian-5.0-i386-minimal –config vps.basic
The 157 must be a uniqe ID – each virtual machine must have its own unique ID.
To start vm at boot, run
[root@melbourne ~]# vzctl set 157 –onboot yes –save
To set a hostname and IP address for the vm, run:
[root@melbourne ~]# vzctl set 157 –hostname debian.server.com –save
[root@melbourne ~]# vzctl set 157 –ipadd 192.168.0.157 –save
Next we set the number of sockets to 120 and assign a few nameservers to the vm:
[root@melbourne ~]# vzctl set 157 –numothersock 120 –save
[root@melbourne ~]# vzctl set 157 –nameserver 4.2.2.2 –nameserver 4.2.2.3 –save
(Instead of using the vzctl set commands, you can as well directly edit the vm’s configuration file which is stored in the /etc/vz/conf directory. If the ID of the vm is 157, then the configuration file is /etc/vz/conf/157.conf.)
To start the vm, run
[root@melbourne ~]# vzctl start 157
To set a root password for the vm, execute
[root@melbourne ~]# vzctl exec 157 passwd
You can now either connect to the vm via SSH (e.g. with PuTTY), or you enter it as follows:
[root@melbourne ~]# vzctl enter 157
To leave the vm’s console, type
[root@melbourne ~]# exit
To stop a vm, run
[root@melbourne ~]# vzctl stop 157
To restart a vm, run
[root@melbourne ~]# vzctl restart 157
To delete a vm from the hard drive (it must be stopped before you can do this), run
[root@melbourne ~]# vzctl destroy 157
To get a list of your vms and their statuses, run
[root@melbourne ~]# vzlist -a
Installing Apache2 With PHP5 And MySQL Support On Debian Lenny
Installing PHP5
In order to install PHP5 from debian packages we need to enter following in the source list of /etc/apt/sources.list file
[root@melbourne ~]# vzctl enter 157
root@debian:~# pico /etc/apt/sources.list
deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all
Now save your file and run the following command to take new changes effect
root@debian:~# apt-get update
root@debian:~# apt-get install PHP5
This will install PHP5 in debian
If you want to install any other supported packages you need to install using the following command
root@debian:~# apt-get install libapache2-mod-php5 libapache2-mod-perl2 php5 php5-cli php5-common php5-curl php5-dev php5-domxml php5-gd php5-imap php5-ldap php5-mcal php5-mhash php5-mysql php5-odbc php5-pear php5-xslt
Also we can use aptitude command to install these packages in Debian server.
We must restart Apache afterwards:
root@debian:~# /etc/init.d/apache2 restart
Testing PHP5 / Getting Details About Your PHP5 Installation
Now create a small PHP file (info.php) in that directory and call it in a browser. The file will display the details about PHP installation, such as the installed PHP version.
root@debian:~# pico /var/www/info.php
<?php
phpinfo();
?>
Installing Mysql
This will install Mysql in Debian server
root@debian:~# aptitude install mysql-server mysql-client
New password for the MySQL “root” user: yourpassword
Repeat password for the MySQL “root” user: yourpassword
You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost , so we don’t have to specify a MySQL root password manually later on
Installation of PHPBB.
Download PHPBB
Unzip and copy it to in /var/www/phpBB3
root@debian:/var/www# wget http://sourceforge.net/projects/phpbb/files/phpBB%203/phpBB%203.0.5/phpBB-3.0.5.zip/download
root@debian:/var/www# unzip phpBB-3.0.5.zip
Open the link in browser
http://192.168.0.157/phpBB3/install/install_main.php
Proceed with the instructions provided.
In Database setting give the information which we used in creating the database as shown below.
root@debian:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 230
Server version: 5.0.51a-24+lenny2 (Debian)
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>create database vinetforum;
mysql> GRANT ALL ON *.* TO ‘vinetblogs’@’localhost’ IDENTIFIED BY ‘yourpassword’;
mysql> flush privileges;
mysql> \q
Database name : vinetforum
Database username: vinetblogs
Password : yourpassword
Give the above info in the config.php.
Once the installation is finished we can access the forum from http://192.168.0.157
If you require help, contact SupportPRO Server Admin