centos pear,centos7哪个版本好
大家好,今天来为大家解答centos pear这个问题的一些问题点,包括centos7哪个版本好也一样很多人还不知道,因此呢,今天就来为大家分析分析,现在让我们一起来看看吧!如果解决了您的问题,还望您关注下本站哦,谢谢~
如何在CentOS Linux下安装ASTERISK和FreePBX
下面给出在linux上安装Asterisk,FreePBX的基本步骤。
1.首先是更新系统(可选)
在命令行中输入
sudo apt-get update
sudo apt-get upgrade
2.安装LAMP(Apache2+MySQL+PHP)
在命令行输入
sudo tasksel
选择 LAMP Server
3.添加额外的PHP软件包
sudo apt-get install php5-gd php-pear php-db sox curl
4.安装phpmyadmin(可选)
sudo apt-get install phpmyadmin
5.安装asterisk
sudo apt-get install asterisk asterisk-mysql asterisk-mp3
6.安装Freepbx准备工作
在安装Freepbx我们先要想好将Freepbx安装在哪个目录下,FreePBX为asterisk的Web管理应用,可以帮助用户配置Asterisk等。
1) Ubuntu的Web根目录为/var/www,因此我们可以把FreePBX安装到/var/www/freepbx目录下,为便于管理,创建三个子目录conf设置文件
log存放日志
public WEB应用。
sudo mkdir/var/www/freepbx/
sudo mkdir/var/www/freepbx/conf
sudo mkdir/var/www/freepbx/log
sudo mkdir/var/www/freepbx/public
2)创建设置文件/var/www/freepbx/conf/vhost.conf
sudo vim/var/www/freepbx/conf/vhost.conf
输入以下内容
<VirtualHost*:80>
ServerName freepbx
ServerAlias freepbx
ServerAdmin james.shen@guidebee.com
ErrorLog/var/www/freepbx/log/error.log
CustomLog/var/www/freepbx/log/access.log combined
DocumentRoot/var/www/freepbx/public
<Directory/var/www/freepbx/public>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
AllowOverride All
Allow from all
</Directory>
<Directory/var/www/freepbx/public/admin>
AuthType Basic
AuthName"Restricted Area"
AuthUserFile freepbx-passwd
Require user admin
</Directory>
</VirtualHost>
修改 ServerAdmin到你自己的Email地址。
3)将vhost添加到 Apache的sites-enabled目录下
sudo ln-s/var/www/freepbx/conf/vhost.conf/etc/apache2/sites-available/freepbx
cd/etc/apache2/sites-enabled/
sudo ln-s../sites-available/freepbx
4)创建用户和密码来验证合法用户可以来配置FreePBX(有权限访问该网页)
sudo htpasswd-c/etc/apache2/freepbx-passwd admin
5)重启Apache
sudo/etc/init.d/apache2 restart
有了这些准备工作后,就可以开始安装FreePBX了
7.安装FreePBX
1)下载FreePBX安装包
cd/tmp
wget
cd/usr/src
sudo tar xvzf/tmp/freepbx-2.8.1.tar.gz
cd freepbx-2.8.1/
2)创建数据库
mysqladmin create asterisk-u root-p
mysqladmin create asteriskcdrdb-u root-p
mysql-u root-p asterisk< SQL/newinstall.sql
mysql-u root-p asteriskcdrdb< SQL/cdr_mysql_table.sql
3)创建数据库用户
mysql-u root-p
在SQL命令行输入GRANT ALL PRIVILEGES ON asterisk.* TO asterisk@localhost IDENTIFIED BY‘badasspassword’;
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asterisk@localhost IDENTIFIED BY‘badasspassword’;
flush privileges;
quit;
注意将badasspassword换成你自己选择的密码。
4)备份modules.conf, FreePBX安装时会修改Apache的配置文件
sudo cp/etc/asterisk/modules.conf~/asterisk-modules.conf
5)安装FreePBX
sudo./install_amp
输入对应的参数
Enter your USERNAME to connect to the'asterisk' database:
[asteriskuser] asterisk
Enter your PASSWORD to connect to the'asterisk' database:
[amp109] badasspassword
Enter the hostname of the'asterisk' database:
[localhost]
Enter a USERNAME to connect to the Asterisk Manager interface:
[admin]
Enter a PASSWORD to connect to the Asterisk Manager interface:
[amp111]
Enter the path to use for your AMP web root:
[/var/www/html]
/var/www/freepbx/public
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
[xx.xx.xx.xx] freepbx
Enter a PASSWORD to perform call transfers with the Flash Operator Panel:
[passw0rd] password
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
[extensions]
Enter directory in which to store AMP executable scripts:
[/var/lib/asterisk/bin]
6)恢复asterisk-modules.conf
sudo cp~/asterisk-modules.conf/etc/asterisk/modules.conf
7)添加asterisk用户
sudo adduser www-data asterisk
修改权限/etc/amportal.conf中添加
AMPASTERISKUSER=www-data
AMPASTERISKGROUP=asterisk
AMPASTERISKWEBUSER=www-data
AMPASTERISKWEBGROUP=asterisk
重启amportal
sudo amportal start
8)使用amport启动Asterisk
sudo update-rc.d-f asterisk remove
sudo sed-e s/BACKGROUND=0/BACKGROUND=1/-i/usr/sbin/safe_asterisk
修改/etc/rc.local
在exit 0前添加
/usr/local/sbin/amportal start
至此,安装完毕。
centos系统编译安装nginx+php环境另加独立mysql教程
前端(nginx+php)ip:192.168.10.8
后端(独立mysql)ip:192.168.10.5
软件版本:libiconv-1.14.tar.gz mysql-5.1.63.tar.gz php-5.2.17.tar.gz php-5.2.17-fpm-0.5.14.diff.gz php-5.2.17-max-input-vars.patch
1.先在后端安装mysql
在192.168.10.5上只安装mysql.方法可以去看centos编译安装nginx+php-fpm+mysql里的mysql安装.
2.在前端安装php-fpm nginx和mysql-client
这里只说下安装mysql-client和php的编译安装.
代码如下 tar zxf mysql-5.1.63.tar.gz cd mysql-5.1.63
./configure--prefix=/usr/local/mysql--without-server
这里只需要加上--without-server就可以让mysql变成客户端了.
如果出现/bin/rm: cannot remove `libtoolt': No such file or directory,可以去看这篇文章Mysql安装:/bin/rm: cannot remove `libtoolt': No such file or directory.
没有问题后,执行命令:
代码如下 make make install
编译php的时候只需要加上--with-mysql=mysql客户端安装目录就可以了.这里我给出编译参数:
代码如下 ./configure--prefix=/usr/local/php--enable-fastcgi--enable-fpm--with-fpm-log=/var/log/php-fpm.log\
--with-fpm-conf=/etc/php-fpm.conf--with-fpm-pid=/var/run/php-fpm.pid--with-config-file-path=/etc\
--with-config-file-scan-dir=/etc/php.d--with-openssl--with-zlib--enable-bcmath--with-bz2--with-curl\
--enable-ftp--with-gd--enable-gd-native-ttf--with-jpeg-dir--with-png-dir--with-gettext--with-mhash\
--enable-mbstring--with-mcrypt--enable-soap--enable-zip--with-iconv=/usr/local/libiconv\
--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--without-pear
nginx的编译没有什么好说的了,我前面centos编译安装nginx+php-fpm+mysql这篇文章里已经有讲过了.
3.进行测试验证
当上面的一切都安装好之后,在后端的mysql里给出远程权限,如下:
代码如下 GRANT ALL PRIVILEGES ON*.* TO'root'@'%' IDENTIFIED BY'123456';
然后iptables上只允许192.168.10.8访问mysql端口,其他都拒绝.如:
代码如下 iptables-A RH-Firewall-1-INPUT-s 192.168.10.8-p tcp-m tcp--dport 3306-j ACCEPT
iptables-A RH-Firewall-1-INPUT-p tcp--dport 3306-j DROP
services iptables save
services iptables restart
然后在192.168.10.8上进行测试,是否可以远程连上mysql
mysql-h 192.168.10.5-u root-p
如果可以连上,就继续下一步的操作,不能连上的话请检查上面是否有错误的地方.
现在我们加个php页面来测试php是否可以连上mysql,脚本如下:
代码如下 ?php
$link=mysql_connect("192.168.10.5","root","123456");
if(!$link) echo"bad!";
else echo"ok!";
mysql_close();
?
成功的话是ok!的输出,失败的话是bad!的输出,我这里是成功的
mysql 5.5.x的只安装客户端.
需要的软件:libiconv-1.14.tar.gz mysql-5.5.25a.tar.gz
1.安装前的准备
安装前的准备,可以去看这篇文章centos编译安装nginx+php-fpm+mysql
2.安装libiconv
代码如下 ./configure--prefix=/usr/local/libiconv
make make install
3.只安装mysql客户端
代码如下 cmake. make mysqlclient libmysql
make install
这样就只安装了mysql客户端,然后可以输入whereis mysql来查看mysql安装位置.
whereis mysql
好了,可以看到跟yum安装的差不多.
4.安装php
以前mysql是5.1的时候,只需要加上--with-mysql=mysql客户端安装目录就可以了,但在mysql 5.5.x这个参数就要改变下了,下面是php的编译参数:
代码如下 ./configure--prefix=/usr/local/php--enable-fastcgi--enable-fpm--with-fpm-log=/var/log/php-fpm.log--with-fpm-conf=/etc/php-fpm.conf\
--with-fpm-pid=/var/run/php-fpm.pid--with-config-file-path=/etc--with-config-file-scan-dir=/etc/php.d\
--with-openssl--with-zlib--enable-bcmath--with-bz2--with-curl--enable-ftp\
--with-gd--enable-gd-native-ttf--with-jpeg-dir--with-png-dir--with-gettext--with-mhash\
--enable-mbstring--with-mcrypt--enable-soap--enable-zip--with-iconv=/usr/local/libiconv\
--with-mysql=shared,/usr--with-mysqli=shared,/usr/bin/mysql_config
大家可以看最后一行,--with-mysql=shared,/usr--with-mysqli=shared,/usr/bin/mysql_config这就是跟以前不同的行.好了,剩下的就不写了
如何在CentOS6下实现Apache+PHP+MySQL的快速安装
LAMP是一个免费、开源的解决方案,代表了Linux、Apache、MySQL、PHP,主要用作建立可行的通用的web服务器。那么如何在CentOS6下实现安装Apache+php+Mysql的快速安装?其具体安装配置步骤可以如下进行:
1.准备工作
使用yum进行安装,为了提高速度,最好先是修改为中国CentOS镜像服务器。目前国内有三个镜像可以选择,分别是:中国科学技术大学、163和Sohu的镜像,建议教育网用户选择中科大,电信用户选择163,他们的repo文件本博客作了备份如下:
下面命令是备份CentOS-Base.repo文件,并修改使用163镜像作为yum源:
mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.save
wget
mv CentOS6-Base-163.repo/etc/yum.repos.d/CentOS-Base.repo
2.更新系统内核
yum-y update
3.安装Apahce、Mysql、PHP
yum-y install httpd php mysql mysql-server
默认情况下,mysql数据目录位于/var/lib/mysql
4.安装相关组件:
yum install php-mysql php-gd php-imap php-ldap php-odbc
php-pear php-xml php-xmlrpc
5.安装MySQL管理工具phpMyAdmin
yum-y install phpMyAdmin
6.配置Apache随系统启动
chkconfig--levels 235 httpd on
/etc/init.d/httpd start
7.配置MySQL随系统启动
chkconfig--levels 235 mysqld on
/etc/init.d/mysqld start
8.设置数据库root密码
/usr/bin/mysqladmin-u root password'New+Password#www.yupengyan.com'
9.测试PHP是否安装成功
在 CentOS中 Apache的默认根目录是/var/www/html,配置文件/etc/httpd/conf/httpd.conf。其他配置存储在/etc/httpd/conf.d/目录。