Skip to content

Commit

Permalink
Install Fixes & More support
Browse files Browse the repository at this point in the history
Changed Install to make Elastix install correctly. Does not install
Hardware support by default, as VPS’s don’t usually have any.

Install script no longer disables firewall by default. May need to
disable it manually, of add incoming ports for web interface. Better to
only open up to your IP address for Security.
  • Loading branch information
jaminmc committed Mar 27, 2016
1 parent 7607b13 commit d6e8a62
Show file tree
Hide file tree
Showing 7 changed files with 629 additions and 51 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Elastix4onCentos7vz
###Install Elastix 4 on Centos 7 OpenVZ
###Install Elastix 4 on Centos 7 OpenVZ & Other VPS's

Ok, So I wanted to setup Elastix in a cloud. There are some VPS's that are built for VOIP, but if you want it even cheaper than $30 per month, then there are other options out there. If only you could just install it on a VPS with centos 7... I use [Hostmada's OVZ-3](https://hostmada.com/openvz-vps) plan for $5.99 per month. It may not be the fastest, but it works pretty well for me.

Expand All @@ -9,13 +9,23 @@ I expounded on their instructions, and made scripts that extract the source ISO

These scripts also work well if you have a linux server that you want to run Elastix in a openVZ container.

I wrote a couple scripts that do everything for you. It installs everything except for NetworkManager, which breaks the virtual network interfaces and makes it unreachable. If you want to do this on a CentOS 7 that uses other Virtualazation, you can install it by `yum install NetworkManager NetworkManager-glib NetworkManager-tui` when you are finished and have it be the Full Elastix setup. (Not Tested)
I wrote a couple scripts that do everything for you. It installs everything except for NetworkManager, which breaks the virtual network interfaces and makes it unreachable. If you want to do this on a CentOS 7 that uses other Virtualazation, you can install it by `yum install NetworkManager NetworkManager-glib NetworkManager-tui` when you are finished and have it be the Full Elastix setup. --Doesn't seem needed.

I also setup Elastix on [digitalocean.com](www.digitalocean.com/?refcode=997a8188969b), and it seems to work even better. sign up through me, and you get $10 credit to start and play with. The $5 plan + $1 for backups is an awesome option!

## Instalation
To start out, ssh into your host. Then at the command, download the install scripts. If you do not have wget, install it by `yum -y install wget`, then you will just need to run this:

wget -O Elastix4onCentos7vz.tar.gz --no-check-certificate https://github.com/thpryrchn/Elastix4onCentos7vz/tarball/master
tar zxvf Elastix4onCentos7vz.tar.gz --strip-components=1

If you are using the Digital Ocean 512 MB Memory / 20 GB Disk / NYC3 - CentOS 7.2 x64 setup, you will want to create a Swapfile, or else your memory will run out, and the database will crash. to do this, run `./create-swapfile.sh`

If you are not installing on a VPS, and have hardware you want Elastix to support, then swap *inst2-hardware.txt* with *inst2.txt*

Then proceed to run the first install script:


./elastix-install-p1.sh

This will download the Elastix Install DVD, unpack it to /mnt/iso, add it as a source to yum, then install all the files. It also adds Elastix's repo, so that it starts with the latest version. If you already have Elastix-4.0.74-Stable-x86_64-bin-10Feb2016.iso downloaded and in the same place as the install files, It will use it instead. Usefull if you find it on a faster Mirror.
Expand All @@ -30,4 +40,6 @@ It will also clean off the install files so they won't take up space anymore.

After it finishes, it will have you reboot once more. Then you can configure through the Web interface, and however else you work with Elastix.

If you can't access the web interface after the reboot, it is because you may have a firewall that is preventing it. To access it, you can temporarrly disable the firewall by running `systemctl stop iptables` and `systemctl stop firewalld`

###Be sure to configure the Firewall through Elastix, or however else you choose too, as the install disables it.
12 changes: 12 additions & 0 deletions create-swapfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

dd if=/dev/zero of=/swapfile bs=1024 count=1024k
chown root:root /swapfile
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
sysctl vm.swappiness=10
echo vm.swappiness=10 >> /etc/sysctl.conf
free -h
cat /proc/sys/vm/swappiness
17 changes: 10 additions & 7 deletions elastix-install-p1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,24 @@ yum -y update
sleep 3
yum -y --nogpg install $(cat inst1.txt)
sleep 3
yum -y install asterisk
yum -y install elastix
#Run a 2nd time in case it missed something
yum -y --nogpg install $(cat inst2.txt)
yum -clean all
yum -y update

#Shut off SElinux and Firewall. Be sure to configure it in Elastix!
setenforce 0
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
cp -a /etc/sysconfig/iptables /etc/sysconfig/iptables.org-elastix-"$(/bin/date "+%Y-%m-%d-%H-%M-%S")"
systemctl stop chronyd
systemctl stop firewalld
systemctl stop iptables
systemctl disable chronyd
systemctl disable firewalld
systemctl disable iptables
systemctl disable elastix-firstboot
# systemctl stop chronyd
# systemctl stop firewalld
# systemctl stop iptables
# systemctl disable chronyd
# systemctl disable firewalld
# systemctl disable iptables
# systemctl disable elastix-firstboot
#Fix for "/bin/df: '/etc/fstab': No such file or directory"
touch /etc/fstab

Expand Down
5 changes: 0 additions & 5 deletions elastix-install-p2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ echo "Now we are running some cleanup, and making sure everything is up to date"
rm -rf /etc/yum.repos.d/elastix-cd.repo /mnt/iso/ Elastix-4.0.74-Stable-x86_64-bin-10Feb2016.iso
mv /etc/yum.repos.d/elastix.repo.rpmnew /etc/yum.repos.d/elastix.repo
yum clean all
mkdir .poop
cd .poop
yum -y reinstall elastix*
cd ..
rm -rf .poop
yum -y update
echo " "
echo " "
Expand Down
31 changes: 0 additions & 31 deletions inst1.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ firewalld
flac-libs
fontconfig
fontpackages-filesystem
freePBX
freetype
fxload
gawk
Expand Down Expand Up @@ -130,21 +129,17 @@ kexec-tools
keyutils-libs
kpartx
krb5-libs
lcdelastix
lcdproc
lcms2
less
libacl
libaio
liballogsmat
libao
libassuan
libasyncns
libattr
libblkid
libcap
libcap-ng
libc-client
libcom_err
libcroco
libcurl
Expand All @@ -161,12 +156,10 @@ libgcc
libgcrypt
libgomp
libgpg-error
libgsmat
libgudev1
libICE
libidn
libjpeg-turbo
libmcrypt
libmnl
libmodman
libmount
Expand All @@ -176,12 +169,10 @@ libnfnetlink
libnl3
libnl3-cli
libogg
libopenr2
libpcap
libpciaccess
libpipeline
libpng
libpri
libproxy
libpwquality
libreport-filesystem
Expand All @@ -193,15 +184,12 @@ libsepol
libSM
libsndfile
libsoup
libsrtp
libss
libss7
libssh2
libstdc++
libsysfs
libtasn1
libteam
libtidy
libtiff
libtiff-devel
libtiff-tools
Expand All @@ -214,7 +202,6 @@ libutempter
libuuid
libverto
libvorbis
libwat
libX11
libX11-common
libXau
Expand Down Expand Up @@ -253,7 +240,6 @@ mokutil
mozjs17
mtools
MySQL-python
mysql-to-mariadb-server
ncurses
ncurses-base
ncurses-libs
Expand All @@ -275,7 +261,6 @@ nss-util
ntp
ntpdate
numactl-libs
openfire
openldap
openssh
openssh-clients
Expand All @@ -301,7 +286,6 @@ perl-CGI
perl-Compress-Raw-Bzip2
perl-Compress-Raw-Zlib
perl-constant
perl-Convert-BinHex
perl-Crypt-OpenSSL-Bignum
perl-Crypt-OpenSSL-Random
perl-Crypt-OpenSSL-RSA
Expand Down Expand Up @@ -352,7 +336,6 @@ perl-Mail-DKIM
perl-Mail-IMAPClient
perl-Mail-SPF
perl-MailTools
perl-MIME-tools
perl-NetAddr-IP
perl-Net-Daemon
perl-Net-DNS
Expand Down Expand Up @@ -390,20 +373,13 @@ php-bcmath
php-cli
php-common
php-gd
php-IDNA_Convert
php-imap
php-jpgraph
php-magpierss
php-mbstring
php-mcrypt
php-mysql
php-pdo
php-pear
php-pear-DB
php-PHPMailer
php-process
php-simplepie
php-Smarty
php-soap
php-tcpdf
php-tidy
Expand All @@ -427,26 +403,20 @@ procps-ng
psmisc
pth
pulseaudio-libs
py-Asterisk
pygobject3-base
pygpgme
pyliblzma
pyOpenSSL
python
python-backports
python-backports-ssl_match_hostname
python-cjson
python-configobj
python-crypto
python-daemon
python-decorator
python-ecdsa
python-eventlet
python-greenlet
python-iniparse
python-libs
python-lockfile
python-paramiko
python-pycurl
python-pyudev
python-setuptools
Expand Down Expand Up @@ -509,7 +479,6 @@ vim-filesystem
vim-minimal
virt-what
vsftpd
wanpipe-util
wavpack
which
wpa_supplicant
Expand Down
Loading

0 comments on commit d6e8a62

Please sign in to comment.