ubuntu asterisk 安装 ubuntu镜像安装

大家好,今天给各位分享ubuntu asterisk 安装的一些知识,其中也会对ubuntu镜像安装进行解释,文章篇幅可能偏长,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在就马上开始吧!

CentOS65安装的UEFI

我自己在服务器上装了centos 6.5系统,默认用的就是UEFI,没有注意可以只用GRUB,接着问题就出现了,我在服务器内安装了另外一块带grub启动系统的硬盘,

这个硬盘启动系统后,如果去掉此块硬盘,再重新启动,总是识别不出来centos 6.5的UEFI,这个可以通过启动主板的UEFI,然后用UEFI的命令:

mount fs0

fs0:

cd EFI

cd redhat

grub.efi

文件夹名称可能不准,大概是这样就可以手动启动系统了,另外还可以通过插入系统盘,upgrade一下就可以了,不用每次手动,也不会丢失数据,但是总觉得

这样不是很好。所以我就有了将UEFI-GPT回退为MBR的想法。

谷歌总是很牛x,所以我得到的结果是用gdisk,我启动另一个系统,挂载上centos 6.5的硬盘,然后按照google上的步骤:

1

Click"Applications." Point to"Accessories," then click"Terminal." Input the following into Terminal: sudo fdisk-l

2

Press"Enter" to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename(for example,/dev/sda) assigned to the disk.

3

Input the following into Terminal: sudo apt-get install gdisk. Press"Enter" to install the partitioning tool to Ubuntu.

4

Input"sudo gdisk" into Terminal, then press"Enter" to run gdisk as a superuser. Input the name assigned to the boot device, then press"Enter" again.

5

Press"r," then hit"Enter," to switch to the recovery and transformation options. Press"g," then press"Enter," to select the option to convert GPT to MBR on Linux.

6

Press"w," then press"Enter," to convert GPT to MBR on the primary partitions. Press"y," then"Enter," to finalize and exit.

操作完成后,重启发现系统起不来,手动引导UEFI也不行了。

人类一思考,上帝就发笑,可是俺思考后发现还是能拯救的,

先提前说明,centos 6.5安装的时候,是分了三个区的,sda1-- UEFI所在区,是fat32,sda2--在fdisk-l下显示是NTFS(但实际上是ext4)的存储实际系统和数据的分区,

sda3-- swap分区。

我进入U盘启动的系统后,把sda1分区挂载到mnt目录内,发现在efi->redhat目录内,存在一个文件grub.conf,相比经常把玩系统的人都知道这个是干嘛的。就是有了这个,我才有了希望。

下面就是拯救的具体步骤:

1、mount上sda1,然后拷贝出grub.conf留作后用,切忌!然后umount

2、使用fdisk将sda1修改为83-linux,sda2也修改为83-linux,并且把sda1设置为启动分区。

大致命令流程如下: fdisk/dev/sda t 1 83 t 2 83 a 1

3、将sda1做成ext3,因为他是fat32

命令:mkfs.ext3/dev/sda1

4、mount上sda1和sda2,我这里sda1在/mnt,sda2在/sda2,给sda1安装grub,grub-install--root-directory=/mnt/dev/sda,这样grub就装好了

5、把备份的grub.conf拷贝到/mnt/boot/grub目录下,并且做一个软连接,menu.lst指向grub.conf,命令是:ln-s grub.conf menu.lst

6、将/sda2/boot/目录下在grub.conf内用到的文件,一个是kernel会用到的,一个是initrd会用到的,拷贝到/mnt/boot目录下

7、修改/mnt/boot/grub/grub.conf,把root(hd0, 1)这个改为root(hd0,0)

8、保存,sync,umount,卸载硬盘,重新启动就可以了。

CentOS6.5安装的UEFI-GPT回退为MBR引导详解

我自己在服务器上装了centos 6.5系统,默认用的就是UEFI,没有注意可以只用GRUB,接着问题就出现了,我在服务器内安装了另外一块带grub启动系统的硬盘,

这个硬盘启动系统后,如果去掉此块硬盘,再重新启动,总是识别不出来centos 6.5的UEFI,这个可以通过启动主板的UEFI,然后用UEFI的命令:

mount fs0

fs0:

cd EFI

cd redhat

grub.efi

文件夹名称可能不准,大概是这样就可以手动启动系统了,另外还可以通过插入系统盘,upgrade一下就可以了,不用每次手动,也不会丢失数据,但是总觉得

这样不是很好。所以我就有了将UEFI-GPT回退为MBR的想法。

谷歌总是很牛x,所以我得到的结果是用gdisk,我启动另一个系统,挂载上centos 6.5的硬盘,然后按照google上的步骤:

1

Click Applications. Point to Accessories, then click Terminal. Input the following into Terminal: sudo fdisk-l

2

Press Enter to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename(for example,/dev/sda) assigned to the disk.

3

Input the following into Terminal: sudo apt-get install gdisk. Press Enter to install the partitioning tool to Ubuntu.

4

Input sudo gdisk into Terminal, then press Enter to run gdisk as a superuser. Input the name assigned to the boot device, then press Enter again.

5

Press r, then hit Enter, to switch to the recovery and transformation options. Press g, then press Enter, to select the option to convert GPT to MBR on Linux.

6

Press w, then press Enter, to convert GPT to MBR on the primary partitions. Press y, then Enter, to finalize and exit.

操作完成后,重启发现系统起不来,手动引导UEFI也不行了。

人类一思考,上帝就发笑,可是俺思考后发现还是能拯救的,

先提前说明,centos 6.5安装的时候,是分了三个区的,sda1-- UEFI所在区,是fat32,sda2--在fdisk-l下显示是NTFS(但实际上是ext4)的存储实际系统和数据的分区,

sda3-- swap分区。

我进入U盘启动的系统后,把sda1分区挂载到mnt目录内,发现在efi-redhat目录内,存在一个文件grub.conf,相比经常把玩系统的人都知道这个是干嘛的。就是有了这个,我才有了希望。

下面就是拯救的具体步骤:

1、mount上sda1,然后拷贝出grub.conf留作后用,切忌!然后umount

2、使用fdisk将sda1修改为83-linux,sda2也修改为83-linux,并且把sda1设置为启动分区。

大致命令流程如下: fdisk/dev/sda t 1 83 t 2 83 a 1

3、将sda1做成ext3,因为他是fat32

命令:mkfs.ext3/dev/sda1

4、mount上sda1和sda2,我这里sda1在/mnt,sda2在/sda2,给sda1安装grub,grub-install--root-directory=/mnt/dev/sda,这样grub就装好了

5、把备份的grub.conf拷贝到/mnt/boot/grub目录下,并且做一个软连接,menu.lst指向grub.conf,命令是:ln-s grub.conf menu.lst

6、将/sda2/boot/目录下在grub.conf内用到的文件,一个是kernel会用到的,一个是initrd会用到的,拷贝到/mnt/boot目录下

7、修改/mnt/boot/grub/grub.conf,把root(hd0, 1)这个改为root(hd0,0)

8、保存,sync,umount,卸载硬盘,重新启动就可以了。

如何在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

至此,安装完毕。

阅读剩余
THE END