Multi Server on ubuntu server 8.0.4 LTS quick guide
Posted: Sun Oct 18, 2009 11:36 am
Hello guys, due to heartwarming Yahoo Messenger requests I am posting a quick guide on a multi server setup on ubuntu server 8.0.4 LTS. This is a preview of some ebook im working on.
Variables to be used on the installation process:
Database / Webserver a.k.a Fate = 192.168.1.69
Asterisk Server a.k.a Laisa = 192.168.1.88
Now lets begin with installing the first server which is the Database / Web server since this is the simplest, here are the things to get you started:
* The notes are taken from the UBUNTU_INSTALL.txt
Open a terminal on the system
$ sudo su
$ passwd (set the root user's password)
# apt-get update (retrieves the latest repository information)
# apt-get upgrade (upgrades any out of date packages
# apt-get install linux-headers-server (Used for zaptel compil)
# reboot (reboot to use the new kernel)
* We just want to make sure everything is updated before we move forward to installing the others.
Now login back again and apt-get install this packages and be sure to answer Yes if it requires you to download and install other packages required.
apache2 (web server)
apache2-mpm-prefork (multi threaded portion to apache2)
php5 (base php files)
php5-cli (php command line interface (allows us to run php -v for eaccelerator))
php5-dev (development tools for php5 allows us to compile eaccelerator
php5-mysql (allows php5 to connect to a mysql server)
phpmyadmin (vicidial uses apache2 as its webserver please select this)
ploticus (this is what creates the graphs for the server performance screen)
ntp (time synchronization utility)
phpmyadmin (vicidial uses apache2 as its webserver please select this)
mysql-client-5.0 (command for connecting to mysql)
mysql-doc-5.0 (documentation for mysql)
mysql-server-5.0 (this will ask for a password you can just press enter a bunch of times)
mytop (utility for monitoring mysql)
ploticus (this is what creates the graphs for the server performance screen)
subversion (code versioning tool)
subversion-tools
Installing eaccelerator:
# cd /usr/src
# wget http://bart.eaccelerator.net/source/0.9 ... .9.5.3.zip
# unzip eaccelerator-0.9.5.3.zip
# cd eaccelerator-0.9.5.3
# phpize
# ./configure
# make
# make install
# cd /etc/php5/conf.d/
# vim eaccelerator.ini
> add the following to the eaccelerator.:
extension="eaccelerator.so"
eaccelerator.shm_size="48"
eaccelerator.cache_dir="/var/lib/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
# mkdir /var/lib/eaccelerator
# chmod 0777 /var/lib/eaccelerator
# php -v
NOTE: You should see a line mentioning eaccelerator. If you do not or you get an error you have done something wrong
Now that were done installing the package, the next thing were going to do on this server is create the asterisk database and populate the tables.
We will need to download the astguiclient scripts from the eflo repository through subversion, we are only going to use the sql scripts that will create the database and the tables, we will also be copying the www folders to the webservers root directory.
WE ARE STILL ON THE DB/WEB SERVER!!!!
Now we checkout the astguiclient files, you can choose between 2.0.5 or 2.2, i am currently using 2.2 for my latest deployments, very nice call transfer interface and many more.
**** for SVN 2.0.5 branch:
# mkdir /usr/src/astguiclient
# cd /usr/src/astguiclient
# svn checkout svn://svn.eflo.net:43690/agc_2-X/branches/agc_2.0.5
**** for SVN 2.2.0 trunk:
# mkdir /usr/src/astguiclient
# cd /usr/src/astguiclient
# svn checkout svn://svn.eflo.net:43690/agc_2-X/trunk
CREATING THE ASTERISK DATABASE
# mysql -p (enter the mysql root user's password you set earlier)
> CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
> use asterisk;
> \. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
> \. /usr/src/astguiclient/trunk/extras/first_server_install.sql
> \. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
> quit
* If you will be using 2.0.5 your this will be used:
> \. /usr/src/astguiclient/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql
> \. /usr/src/astguiclient/agc_2.0.5/extras/first_server_install.sql
> \. /usr/src/astguiclient/agc_2.0.5/extras/sip-iax_phones.sql
> quit
* Lets fine tune your mysql server with a new my.cnf
# cd /etc/mysql/
# wget http://download.vicidial.com/ubuntu/ubuntu-my-vici.cnf
# mv ubuntu-my-vici.cnf my.cnf
# /etc/init.d/mysql restart
LET US NOW COPY THE VICIDIAL AND AGC FOLDERS Under the astguiclient directory
If you have downloaded 2.0.5 their location is at /usr/src/astguiclient/agc_2.0.5/www you need to copy all the files under this directory to /var/www/ directory
If you have downloaded 2.2 their location is at /usr/src/astguiclient/trunk/www you need to copy all the files under this directory to /var/www/ directory
You also need to edit the dbconnect.php , it can be found under the AGC and VICIDIAL directories. The lines your going to edit will look like this:
-----------------------------
#defaults for DB connection
$VARDB_server = 'localhost';
$VARDB_user = 'cron';
$VARDB_pass = '1234';
$VARDB_database = '1234';
$WeBServeRRooT = '/usr/local/apache2/htdocs';
---------------------------------
You need to change $VARDB_server value to the IP Address of the DB/Web Server which is 192.168.1.69, the default value actually is ok because your mysql server lies in this machine.
You would also need to change $WeBServeRRooT value to '/var/www' since that is the default webroot path of ubuntu server.
You need to do this on the 2 dbconnect.php files under AGC and VICIDIAL folders.
* NOW WE ARE DONE WITH THE DATABASE SERVER!!!!!
* MAKE SURE YOUR SERVERS HAVE BOTH THE SAME TIMEZONE AND THE SAME TIME.
Variables to be used on the installation process:
Database / Webserver a.k.a Fate = 192.168.1.69
Asterisk Server a.k.a Laisa = 192.168.1.88
Now lets begin with installing the first server which is the Database / Web server since this is the simplest, here are the things to get you started:
* The notes are taken from the UBUNTU_INSTALL.txt
Open a terminal on the system
$ sudo su
$ passwd (set the root user's password)
# apt-get update (retrieves the latest repository information)
# apt-get upgrade (upgrades any out of date packages
# apt-get install linux-headers-server (Used for zaptel compil)
# reboot (reboot to use the new kernel)
* We just want to make sure everything is updated before we move forward to installing the others.
Now login back again and apt-get install this packages and be sure to answer Yes if it requires you to download and install other packages required.
apache2 (web server)
apache2-mpm-prefork (multi threaded portion to apache2)
php5 (base php files)
php5-cli (php command line interface (allows us to run php -v for eaccelerator))
php5-dev (development tools for php5 allows us to compile eaccelerator
php5-mysql (allows php5 to connect to a mysql server)
phpmyadmin (vicidial uses apache2 as its webserver please select this)
ploticus (this is what creates the graphs for the server performance screen)
ntp (time synchronization utility)
phpmyadmin (vicidial uses apache2 as its webserver please select this)
mysql-client-5.0 (command for connecting to mysql)
mysql-doc-5.0 (documentation for mysql)
mysql-server-5.0 (this will ask for a password you can just press enter a bunch of times)
mytop (utility for monitoring mysql)
ploticus (this is what creates the graphs for the server performance screen)
subversion (code versioning tool)
subversion-tools
Installing eaccelerator:
# cd /usr/src
# wget http://bart.eaccelerator.net/source/0.9 ... .9.5.3.zip
# unzip eaccelerator-0.9.5.3.zip
# cd eaccelerator-0.9.5.3
# phpize
# ./configure
# make
# make install
# cd /etc/php5/conf.d/
# vim eaccelerator.ini
> add the following to the eaccelerator.:
extension="eaccelerator.so"
eaccelerator.shm_size="48"
eaccelerator.cache_dir="/var/lib/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
# mkdir /var/lib/eaccelerator
# chmod 0777 /var/lib/eaccelerator
# php -v
NOTE: You should see a line mentioning eaccelerator. If you do not or you get an error you have done something wrong
Now that were done installing the package, the next thing were going to do on this server is create the asterisk database and populate the tables.
We will need to download the astguiclient scripts from the eflo repository through subversion, we are only going to use the sql scripts that will create the database and the tables, we will also be copying the www folders to the webservers root directory.
WE ARE STILL ON THE DB/WEB SERVER!!!!
Now we checkout the astguiclient files, you can choose between 2.0.5 or 2.2, i am currently using 2.2 for my latest deployments, very nice call transfer interface and many more.
**** for SVN 2.0.5 branch:
# mkdir /usr/src/astguiclient
# cd /usr/src/astguiclient
# svn checkout svn://svn.eflo.net:43690/agc_2-X/branches/agc_2.0.5
**** for SVN 2.2.0 trunk:
# mkdir /usr/src/astguiclient
# cd /usr/src/astguiclient
# svn checkout svn://svn.eflo.net:43690/agc_2-X/trunk
CREATING THE ASTERISK DATABASE
# mysql -p (enter the mysql root user's password you set earlier)
> CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
> GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
> use asterisk;
> \. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
> \. /usr/src/astguiclient/trunk/extras/first_server_install.sql
> \. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
> quit
* If you will be using 2.0.5 your this will be used:
> \. /usr/src/astguiclient/agc_2.0.5/extras/MySQL_AST_CREATE_tables.sql
> \. /usr/src/astguiclient/agc_2.0.5/extras/first_server_install.sql
> \. /usr/src/astguiclient/agc_2.0.5/extras/sip-iax_phones.sql
> quit
* Lets fine tune your mysql server with a new my.cnf
# cd /etc/mysql/
# wget http://download.vicidial.com/ubuntu/ubuntu-my-vici.cnf
# mv ubuntu-my-vici.cnf my.cnf
# /etc/init.d/mysql restart
LET US NOW COPY THE VICIDIAL AND AGC FOLDERS Under the astguiclient directory
If you have downloaded 2.0.5 their location is at /usr/src/astguiclient/agc_2.0.5/www you need to copy all the files under this directory to /var/www/ directory
If you have downloaded 2.2 their location is at /usr/src/astguiclient/trunk/www you need to copy all the files under this directory to /var/www/ directory
You also need to edit the dbconnect.php , it can be found under the AGC and VICIDIAL directories. The lines your going to edit will look like this:
-----------------------------
#defaults for DB connection
$VARDB_server = 'localhost';
$VARDB_user = 'cron';
$VARDB_pass = '1234';
$VARDB_database = '1234';
$WeBServeRRooT = '/usr/local/apache2/htdocs';
---------------------------------
You need to change $VARDB_server value to the IP Address of the DB/Web Server which is 192.168.1.69, the default value actually is ok because your mysql server lies in this machine.
You would also need to change $WeBServeRRooT value to '/var/www' since that is the default webroot path of ubuntu server.
You need to do this on the 2 dbconnect.php files under AGC and VICIDIAL folders.
* NOW WE ARE DONE WITH THE DATABASE SERVER!!!!!
* MAKE SURE YOUR SERVERS HAVE BOTH THE SAME TIMEZONE AND THE SAME TIME.