Skip to content

Instantly share code, notes, and snippets.

@worldadventurer
Last active April 16, 2024 10:50
Show Gist options
  • Save worldadventurer/702eee3805a2e8ec5d5284ec50388c94 to your computer and use it in GitHub Desktop.
Save worldadventurer/702eee3805a2e8ec5d5284ec50388c94 to your computer and use it in GitHub Desktop.
FreePBX v13 Post-Install Script for Optimizing server
# This optimizes a fresh installed FreePBX 13 x64 Distro. Not tested on other versions.
echo This will optimize your server - only run this if you wont have hard phones.
echo Run this only for a virtual machine
read -rsp $'Press any key to continue OR CTRL-c to QUIT ...\n' -n1 key
#Install other needed packages:
yum install -y git gettext perl-CPAN lrzsz help2man
# Install other useful stuff from EPEL repository:
axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/iperf3-3.0.12-1.el6.x86_64.rpm
rpm -Uvh iperf3-3.0.12-1.el6.x86_64.rpm
axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/sqlite2-2.8.17-10.el6.x86_64.rpm
rpm -Uvh sqlite2-2.8.17-10.el6.x86_64.rpm
axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/easy-rsa-2.2.2-1.el6.noarch.rpm
rpm -Uvh easy-rsa-2.2.2-1.el6.noarch.rpm
# Get latest version of flite Text to Speech engine
rpm -e flite-devel-1.3-14.el6.x86_64
axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/flite-1.3-24.el6.x86_64.rpm
rpm -Uvh flite-1.3-24.el6.x86_64.rpm
axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/flite-devel-1.3-24.el6.x86_64.rpm
rpm -Uvh flite-devel-1.3-24.el6.x86_64.rpm
# Install MTR
git clone --depth 1 https://github.com/traviscross/mtr.git
cd mtr
./bootstrap.sh && ./configure && make
make install
# Install axel for multi-threaded downloading
bash <(curl -Ls https://gist.github.com/worldadventurer/a819c487a4ffc019059f3c623d243d7e/raw)
# Install Do The Right Extraction
cd
wget https://brettcsmith.org/2007/dtrx/dtrx-7.1.tar.gz
tar -xvf dtrx-7.1.tar.gz && cd dtrx-7.1 && python setup.py install
# Install Midnight Commander - http://download.opensuse.org/repositories/home:/laurentwandrebeck:/mc/CentOS_6/x86_64/
cd
axel -n 8 http://download.opensuse.org/repositories/home:/laurentwandrebeck:/mc/CentOS_6/x86_64/mc-4.8.19-1.1.x86_64.rpm
rpm -Uvh mc-4.8.19-1.1.x86_64.rpm
#Uninstall commercial and hardphone related modules & packages
rpm -e iSymphonyServerV3-fpbx
fwconsole ma downloadinstall customcontexts
fwconsole ma downloadinstall extensionsettings
fwconsole ma downloadinstall motif
fwconsole ma downloadinstall pm2
fwconsole ma uninstall areminder
fwconsole ma uninstall bria
fwconsole ma uninstall broadcast
fwconsole ma uninstall bulkdids
fwconsole ma uninstall bulkextensions
fwconsole ma uninstall callerid
fwconsole ma uninstall calllimit
fwconsole ma uninstall conferencespro
fwconsole ma uninstall cos
fwconsole ma uninstall cxpanel
fwconsole ma uninstall dahdiconfig
fwconsole ma uninstall digium_phones
fwconsole ma uninstall digiumaddoninstaller
fwconsole ma uninstall endpoint
fwconsole ma uninstall extensionroutes
fwconsole ma uninstall faxpro
fwconsole ma uninstall freepbx_ha
fwconsole ma uninstall iaxsettings
fwconsole ma uninstall pagingpro
fwconsole ma uninstall parkpro
fwconsole ma uninstall pinsetspro
fwconsole ma uninstall qxact_reports
fwconsole ma uninstall recording_report
fwconsole ma uninstall restapps
fwconsole ma uninstall rmsadmin
fwconsole ma uninstall sangomacrm
fwconsole ma uninstall sipstation
fwconsole ma uninstall sms
fwconsole ma uninstall sng_mcu
fwconsole ma uninstall ucpnode
fwconsole ma uninstall vmnotify
fwconsole ma uninstall voicemail_report
fwconsole ma uninstall vqplus
fwconsole ma uninstall webcallback
fwconsole ma uninstall xmpp
fwconsole ma uninstall zulu
# Add extended and unsupported repos to search. Yes, weird how need to run three times like this.
fwconsole ma showupgrades
fwconsole ma showupgrades -R extended
fwconsole ma showupgrades -R unsupported
# Upgrade all FreePBX packages
fwconsole ma upgradeall
#
#######################################
# Optimize OS now...
#
# Reduce Apache threads:
cd /etc/httpd/conf
wget https://raw.githubusercontent.com/FreePBXHosting/freepbx-scripts/master/optimizeapache/optimizeapache.sh
bash optimizeapache.sh
# Only needed for digium hardware boards:
service dahdi stop
chkconfig dahdi off
# Remove prosody xmpp server from running (already uninstalled from FreePBX Modules):
service prosody stop
chkconfig prosody off
# Remove audit:
rpm -e audit amtu autofs
# Remove support for plug and play devices
service haldaemon stop
chkconfig --levels 2345 haldaemon off
service messagebus stop
chkconfig messagebus off
# Remove acpid for the physical power button 
service acpid stop
chkconfig acpid off
chkconfig --levels 2345 acpid off
rpm -e acpid
# Remove avahi
rpm -e avahi
# Remove - only needed for Software RAID:
service stop mdmonitor
chkconfig mdmonitor off
# Now please reboot
echo Done Opimitizing your system.
echo PLEASE Reboot your server now
echo type reboot and hit enter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment