|
本帖最后由 demo 于 2010-12-2 08:03 编辑
FreePBX base installation
Now that we have a working Linux install, all the prerequisite packages, and a functioning MySQL database, we can finally install FreePBX. As FreePBX has already been downloaded, the process is simply to switch to the FreePBX directory and run the installer:
cd /usr/src/freepbx-2.5.1
./install_amp install
You will be asked a series of configuration questions that the installer uses to generate a configuration file located at /etc/amportal.conf. If a mistake is made during the question and answer part of the installation, simply remove this file using the following command, and run the install_amp install command once again:
rm -f /etc/amportal.conf
Question Suggested answer
Enter your USERNAME to connect to the 'asterisk' database This is the username you set up with permissions on the Asterisk database and is simply called asterisk. Type "asterisk" and hit the Enter key.
Enter your PASSWORD to connect to the 'asterisk' database This is the password you set up during the grant all privileges step for the Asterisk database. Type your password and hit the Enter key.
Enter the hostname of 'asterisk' database This is the location of your MySQL server. Using the setup listed in this tutorial, this will be localhost (as the MySQL server resides on the same server as the Apache server). If the MySQL server resides on a different server than Apache, the answer to this question should be the hostname or IP address of the server where MySQL resides. Type the hostname or IP address of the server running MySQL and hit the Enter key.
Enter a USERNAME to connect to the Asterisk Manager Interface Pick a username that FreePBX can use to communicate with the Asterisk Manager Interface. Leaving this as "admin" is fine. Type the desired username and press the Enter key.
Enter aPASSWORD to connect to the Asterisk Manager Interface Pick a password that FreePBX will use when communicating with the Asterisk Manager Interface. It is strongly recommended that the password be changed from the default of amp111. Type your desired password and press the Enter key.
Enter the path to use for your AMP web root This is the location of your Apache root folder. By default, CentOS 5.2 will place this in /var/www/html. Type your web root and press the Enter key.
Enter the IP ADDRESS or hostname used to acces the AMP web-admin It is the IP address or hostname that you have assigned to your Asterisk server. It is usually the IP address that you will type into your browser to view the FreePBX web interface, when you are ready to configure your Asterisk PBX. Type your IP address or hostname and press the Enter key.
Enter</code>a</codee> ASSWORD> to perform call transfers with the Flash Operode> <code> anel
The Flash Operator Panel is a visual switchboard that allows you to view activity on your PBX, as well as bridge, transfer, or disconnect calls. It is strongly recommended that you change this default password value. Type your desired password and press the Enter key.
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]
FreePBX can associate one user to one device (extensions mode) or one user to many devices (deviceanduser mode). This value can always be changed at any time, and the differences will be discussed later in this tutorial. For now, it is recommended to leave the default value of extensions and hit the Enter key.
Enter directory in which to store AMP executable scripts This is the directory in which FreePBX will store any script that executes against the system. Unless your system calls for a specific change to this location, it is recommended to leave this at the default value of /var/lib/asterisk/bin and press the Enter key.
Enter directory in which to store super-user scripts
This is the directory in which FreePBX will store any scripts that execute against the system with root privileges. As with the previous configuration question, unless your setup calls for a specific change to this value, leave it at the default of /usr/local/sbin and press the Enter key.
At this point, the FreePBX installer will run through the rest of the installation process automatically. As the final step, we need to configure FreePBX to start automatically when the system boots:
echo "/usr/local/sbin/amportal start" >> /etc/rc.local
Installing FreePBX on Ubuntu Server 8.10
Ubuntu Server is a popular and stable operating system based on Debian GNU/Linux. It is becoming increasingly popular for general-purpose server deployments, and is a good choice for an Asterisk/FreePBX server.
Ubuntu Server 8.10 should be installed with the following options:
* DNS server
* LAMP server
* Mail server
* OpenSSH server
Once you have a clean Ubuntu Server 8.10 install to work from, the prerequisite packages can be installed.
Prerequisite packages
FreePBX requires several prerequisite packages to install and function properly. Most prerequisite packages are not included in standard Linux distribution installations, but all should be available in your distributions package management system.
The first important step is to update your system, ensuring that all security updates are installed and all installed packages are at the latest version. To update all of the installed packages on Ubuntu Server 8.10, log in as the standard user that you created during the setup, and type the following into the system console:
sudo aptitude update
sudo aptitude upgrade -y
Enter your user account password when prompted.
The system will proceed to download and install any of the packages that have been updated since the release of your operating system. Depending on how many updates are required and the speed of your Internet connection, this process can take anything from a few minutes to several hours.
Once the system is fully up to date, it is a good idea to reboot so that the updated services can restart and newer kernels can be booted. To reboot, type the following into the console:
sudo reboot
Now that the system is up to date, the required prerequisite libraries and packages can be installed. To install the required prerequisite packages on Ubuntu Server 8.10, log in as a standard user and type the following:
sudo aptitude install build-essential autoconf automake libtool flex bison libssl-dev libnewt-dev libncurses5-dev linux-headers-$(uname -r) sox curl mysql-client libmysqlclient-dev php5 php5-cli php5-gd php5-curl php5-mcrypt php5-xmlrpc php5-mhash php5-suhosin php5-common php5-xsl libapache2-mod-php5 php-pear lame subversion -y
Note that all of the above is a single aptitude command, and should be typed as if it was written on a single line.
Now that all prerequisite packages are installed, we can install Asterisk.
First, switch to the /usr/src directory by typing the following into the console:
cd /usr/src
Install Asterisk from source Many Linux distributions provide Asterisk and its dependent libraries in their package management systems. It is recommended that Asterisk, Asterisk-Addons, LibPRI, and Zaptel always be compiled and installed from source. This avoids improperly built or outdated installations.
A core Asterisk installation consists of four components Asterisk, Asterisk-Addons, DAHDI, and LibPRI:
* "Asterisk" is the main Asterisk routing engine
* Asterisk-Addons component contains commonly used Asterisk applications (such as the application that writes CDR records to a MySQL database, which FreePBX uses)
* DAHDI is the Digium Asterisk Hardware Device Interface package, which allows Asterisk to communicate with additional telephony hardware devices (such as analog trunk cards)
* The LibPRI package enables Asterisk to interface with PRI, BRI, and QSIG trunks
Type the following into the console to download the source code for Asterisk, Asterisk-Addons, DAHDI, and LibPRI:
sudo wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
sudo wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz
sudo wget http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete- current.tar.gz
sudo wget http://downloads.digium.com/pub/libpri/libpri-1.4-current. tar.gz
Extract the source code:
sudo tar zxf asterisk-1.4-current.tar.gz
sudo tar zxf asterisk-addons-1.4-current.tar.gz
sudo tar zxf zaptel-1.4-current.tar.gz
sudo tar zxf libpri-1.4-current.tar.gz
Compile and install the DAHDI telephony hardware interface modules:
cd dahdi-linux-complete-2.* sudo make all sudo make install make config
Compile and install Asterisk:
cd ../asterisk-1.4.* ./configure sudo make install make samples
Compile and install the Asterisk-Addons modules:
cd ../asterisk-addons-1.4.* ./configure sudo make install
Compile and install the LibPRI modules:
cd ../libpri-1.4.* make sudo make install
The PEAR DB module is installed through PEAR software by typing the following into the console:
pear install db
Finally, we start Asterisk as a background process by typing:
asterisk &
Note that this method of starting Asterisk is only temporary. Once installed, the FreePBX startup script will be configured to run at boot.
|
|