“通过脚本在阿里云安装FreePBX-14,支持Centos-7”的版本间的差异
(创建页面,内容为“#!/bin/bash sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config setenforce 0 yum -...”) |
|||
第1行: | 第1行: | ||
#!/bin/bash | #!/bin/bash | ||
+ | |||
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux | sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux | ||
+ | |||
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config | sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config | ||
+ | |||
setenforce 0 | setenforce 0 | ||
+ | |||
yum -y update | yum -y update | ||
+ | |||
yum -y groupinstall core base "Development Tools" | yum -y groupinstall core base "Development Tools" | ||
+ | |||
adduser asterisk -m -c "Asterisk User" | adduser asterisk -m -c "Asterisk User" | ||
+ | |||
yum -y install lynx tftp-server unixODBC mysql-connector-odbc mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git crontabs cronie cronie-anacron wget vim uuid-devel sqlite-devel net-tools gnutls-devel python-devel texinfo libuuid-devel expect | yum -y install lynx tftp-server unixODBC mysql-connector-odbc mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git crontabs cronie cronie-anacron wget vim uuid-devel sqlite-devel net-tools gnutls-devel python-devel texinfo libuuid-devel expect | ||
+ | |||
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | ||
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm | rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm |
2018年4月12日 (四) 09:42的版本
- !/bin/bash
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
setenforce 0
yum -y update
yum -y groupinstall core base "Development Tools"
adduser asterisk -m -c "Asterisk User"
yum -y install lynx tftp-server unixODBC mysql-connector-odbc mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git crontabs cronie cronie-anacron wget vim uuid-devel sqlite-devel net-tools gnutls-devel python-devel texinfo libuuid-devel expect
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum remove -y php* yum install -y php56w php56w-pdo php56w-mysql php56w-mbstring php56w-pear php56w-process php56w-xml php56w-opcache php56w-ldap php56w-intl php56w-soap curl -sL https://rpm.nodesource.com/setup_8.x | bash - yum install -y nodejs systemctl enable mariadb.service systemctl start mariadb cd /root echo '#!/usr/bin/expect set timeout 60 spawn mysql_secure_installation expect { "Enter current password for root (enter for none):" { send "\r"; exp_continue} "Set root password?" { send "n\r"; exp_continue} "Remove anonymous users?" { send "Y\r"; exp_continue} "Disallow root login remotely?" { send "Y\r"; exp_continue} "Remove test database and access to it?" { send "Y\r"; exp_continue} "Reload privilege tables now?" { send "Y\r"; exp_continue} }' > mysql_secure_installation.exp chmod +x mysql_secure_installation.exp ./mysql_secure_installation.exp rm -fr mysql_secure_installation.exp systemctl enable httpd.service systemctl start httpd.service cd /usr/src wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-14-current.tar.gz wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.10.tar.gz cd /usr/src tar vxfz jansson.tar.gz rm -f jansson.tar.gz cd jansson-* autoreconf -i ./configure --libdir=/usr/lib64 make make install cd /usr/src tar xvfz asterisk-14-current.tar.gz rm -f asterisk-14-current.tar.gz cd asterisk-* contrib/scripts/install_prereq install ./configure --libdir=/usr/lib64 --with-pjproject-bundled contrib/scripts/get_mp3_source.sh menuselect/menuselect --enable format_mp3 menuselect.makeopts make make install make config ldconfig if [ ! -f /usr/src/asterisk-*/addons/format_mp3.so ];then cd asterisk-* menuselect/menuselect --enable format_mp3 menuselect.makeopts make make install make config ldconfig fi chkconfig asterisk off chown asterisk. /var/run/asterisk chown -R asterisk. /etc/asterisk chown -R asterisk. /var/{lib,log,spool}/asterisk chown -R asterisk. /usr/lib64/asterisk chown -R asterisk. /var/www/ sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf systemctl restart httpd.service cd /usr/src wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-14.0-latest.tgz tar xfz freepbx-14.0-latest.tgz rm -f freepbx-14.0-latest.tgz cd freepbx ./start_asterisk start ./install -n echo -e "\033[40;31m======================================================================================================================================== \033[1m" echo -e "\033[40;31mYou can now start using FreePBX. Using your browser to access the IP of FreePBX server. \033[1m" echo -e "\033[40;31mIf you have any problem with freepbx, please access www.freepbx.cn for chinese support and www.freepbx.org for Eng support. \033[0m" echo -e "\033[40;31m======================================================================================================================================== \033[0m"