Tuesday, July 22, 2025
Install Magnus Billing on Debian 12 ( Full MagnusBilling Install Script (for Debian 11/12) )
Full MagnusBilling Install Script (for Debian 11/12)
chmod +x install-magnusbilling.sh
sudo ./install-magnusbilling.sh
Script
#!/bin/bash
echo
echo
echo
echo "===================BY WWW.MAGNUSBILLING.ORG=========================";
echo "_ _ ______ _ _ _ _ ";
echo "|\ /| | ___ (_) | (_) ";
echo "| \ / | ___ ____ _ __ _ _ _____ | |_/ /_| | |_ _ __ ____ ";
echo "| \/ |/ \/ _ \| '_ \| | | \| ___| | ___ \ | | | | '_ \ / _ \ ";
echo "| |\/| | | | (_| | | | | |_| ||____ | |_/ / | | | | | | | (_| | ";
echo "|_| |_|\___|\___ |_| | |_____|_____| \___/|_|_|_|_|_| |_|\___ | ";
echo " _/ | _/ | ";
echo " |__/ |__/ ";
echo " ";
echo "======================= VOIP SYSTEM FOR LINUX =======================";
echo
sleep 3
if [[ -f /var/www/html/mbilling/index.php ]]; then
echo "This server already has MagnusBilling installed";
exit;
fi
get_linux_distribution ()
{
if [ -f /etc/debian_version ]; then
DIST="DEBIAN"
HTTP_DIR="/etc/apache2/"
HTTP_CONFIG=${HTTP_DIR}"apache2.conf"
MYSQL_CONFIG="/etc/mysql/mariadb.conf.d/50-server.cnf"
else
DIST="OTHER"
echo 'Installation does not support your distribution'
exit 1
fi
}
get_linux_distribution
startup_services()
{
# Startup Services
if [ ${DIST} = "DEBIAN" ]; then
systemctl restart mysql
systemctl restart apache2
systemctl restart asterisk
fi
}
genpasswd()
{
length=$1
[ "$length" == "" ] && length=16
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${length} | xargs
}
password=$(genpasswd)
if [ -e "/root/passwordMysql.log" ] && [ ! -z "/root/passwordMysql.log" ]
then
password=$(awk '{print $1}' /root/passwordMysql.log)
fi
touch /root/passwordMysql.log
echo "$password" > /root/passwordMysql.log
apt-get update --allow-releaseinfo-change
apt-get install -y locales
echo "LANG=en_US.utf-8" >> /etc/locale.gen
echo "LC_ALL=en_US.utf-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen en_US.UTF-8
source /etc/environment
apt-get -o Acquire::Check-Valid-Until=false update
apt-get install -y apache2
apt-get install -y autoconf automake devscripts gawk ntpdate ntp g++ git-core curl sudo xmlstarlet libjansson-dev git odbcinst1debian2 libodbc1 odbcinst unixodbc unixodbc-dev
apt-get install -y php-fpm php php-dev php-common php-cli php-gd php-pear php-cli php-sqlite3 php-curl php-mbstring unzip libapache2-mod-php uuid-dev libxml2 libxml2-dev openssl libcurl4-openssl-dev gettext gcc g++ libncurses5-dev sqlite3 libsqlite3-dev subversion mpg123
apt-get install -y mariadb-server php-mysql
apt-get install -y unzip git libcurl4-openssl-dev htop sngrep firewalld fail2ban cron
apt-get install -y rsyslog
apt-get install -y whiptail
PHP_INI=$(php -i | grep /.+/php.ini -oE)
mkdir -p /var/www/html/mbilling
cd /var/www/html/mbilling
wget --no-check-certificate https://magnusbilling.org/download/MagnusBilling-current.tar.gz
tar xzf MagnusBilling-current.tar.gz
echo
echo '----------- Install PJPROJECT ----------'
echo
sleep 1
cd /usr/src
wget http://www.digip.org/jansson/releases/jansson-2.7.tar.gz
tar -zxvf jansson-2.7.tar.gz
cd jansson-2.7
./configure
make clean
make && make install
ldconfig
echo
echo '----------- Install Asterisk 13 ----------'
echo
sleep 1
cd /usr/src
rm -rf asterisk*
mv /var/www/html/mbilling/script/asterisk-13.35.0.tar.gz /usr/src/
tar xzvf asterisk-13.35.0.tar.gz
rm -rf asterisk-13.35.0.tar.gz
cd asterisk-*
useradd -c 'Asterisk PBX' -d /var/lib/asterisk asterisk -s /sbin/nologin
echo 'asterisk' > /etc/cron.deny
mkdir /var/run/asterisk
mkdir /var/log/asterisk
chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
contrib/scripts/install_prereq install
make clean
./configure
make menuselect.makeopts
menuselect/menuselect --enable res_config_mysql menuselect.makeopts
menuselect/menuselect --enable format_mp3 menuselect.makeopts
menuselect/menuselect --enable codec_opus menuselect.makeopts
menuselect/menuselect --enable codec_silk menuselect.makeopts
menuselect/menuselect --enable codec_siren7 menuselect.makeopts
menuselect/menuselect --enable codec_siren14 menuselect.makeopts
contrib/scripts/get_mp3_source.sh
make
make install
make samples
make config
ldconfig
chmod -R 777 /tmp
echo '
AddType application/octet-stream .csv
AllowOverride All
DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi
deny from all
deny from all
deny from all
deny from all
deny from all
deny from all
' >> ${HTTP_CONFIG}
rm -rf ${PHP_INI}_old
cp -rf ${PHP_INI} ${PHP_INI}_old
sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 3M /" ${PHP_INI}
sed -i "s/post_max_size = 8M/post_max_size = 20M/" ${PHP_INI}
sed -i "s/max_execution_time = 30/max_execution_time = 90/" ${PHP_INI}
sed -i "s/max_input_time = 60/max_input_time = 120/" ${PHP_INI}
sed -i '/date.timezone/s/= .*/= '$phptimezone'/' ${PHP_INI}
sed -i "s/session.cookie_secure = 1/" ${PHP_INI}
sed -i 's/User ${APACHE_RUN_USER}/User asterisk/' ${HTTP_CONFIG}
sed -i 's/Group ${APACHE_RUN_GROUP}/Group asterisk/' ${HTTP_CONFIG}
sed -i "s/memory_limit = 16M/memory_limit = 512M /" ${PHP_INI}
sed -i "s/memory_limit = 128M/memory_limit = 512M /" ${PHP_INI}
mkdir -p /var/www/html
sed -i 's/ / /' "${HTTP_CONFIG}"
echo
echo "----------- Create mysql password: Your mysql root password is $password ----------"
echo
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb
chkconfig ntp on
mysql -uroot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '${password}';"
echo "
[server]
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
max_connections = 500
key_buffer_size = 64M
max_allowed_packet = 64M
thread_stack = 1M
thread_cache_size = 8
query_cache_limit = 8M
query_cache_size = 64M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 1G
secure-file-priv = ""
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
tmp_table_size=128MB
open_files_limit=500000
[embedded]
[mariadb]
[mariadb-10.1]
" > ${MYSQL_CONFIG}
startup_services
echo
echo '----------- Installing the Web Interface ----------'
echo
sleep 2
rm -rf /var/www/html/index.html
cd /var/www/html/mbilling/resources/images/
rm -rf lock-screen-background.jpg
wget --no-check-certificate https://magnusbilling.org/download/lock-screen-background.jpg
cd /var/www/html/mbilling/
rm -rf /var/www/html/mbilling/tmp && mkdir /var/www/html/mbilling/tmp
mkdir /var/www/html/mbilling/assets
chown -R asterisk:asterisk /var/www/html/mbilling
mkdir /var/run/magnus
touch /etc/asterisk/extensions_magnus.conf
touch /etc/asterisk/extensions_magnus_did.conf
touch /etc/asterisk/sip_magnus_register.conf
touch /etc/asterisk/sip_magnus.conf
touch /etc/asterisk/sip_magnus_user.conf
touch /etc/asterisk/iax_magnus_register.conf
touch /etc/asterisk/iax_magnus.conf
touch /etc/asterisk/iax_magnus_user.conf
touch /etc/asterisk/musiconhold_magnus.conf
touch /etc/asterisk/queues_magnus.conf
selectLanguage() {
echo "SELECT THE MAIN LANGUAGE"
echo "------------------------------------------"
echo "Options:"
echo
echo "1. Portuguese"
echo "2. English"
echo "3. Spanish"
echo
echo -n "Select one option: "
read opcao
case $opcao in
1) installBr;;
2) installEn;;
3) installEs;;
*) "Invalid option." ; echo ; selectLanguage ;;
esac
}
cp -rf /var/www/html/mbilling/resources/sounds/br /var/lib/asterisk/sounds
cp -rf /var/www/html/mbilling/resources/sounds/es /var/lib/asterisk/sounds
cp -rf /var/www/html/mbilling/resources/sounds/en /var/lib/asterisk/sounds
installBr() {
language='br'
cp -rf /var/www/html/mbilling/script/br /var/lib/asterisk/
cd /var/lib/asterisk
wget --no-check-certificate https://raw.githubusercontent.com/magnussolution/magnusbilling7/source/script/sounds/Sounds-br.tar.gz
tar xzvf Sounds-br.tar.gz
}
installEn() {
language='en'
}
installEs() {
language='en'
cp -n /var/www/html/mbilling/resources/sounds/en/* /var/lib/asterisk/sounds
mkdir /var/lib/asterisk/es
cd /var/lib/asterisk/es
wget --no-check-certificate https://raw.githubusercontent.com/magnussolution/magnusbilling7/source/script/sounds/Sounds-es.tar.gz
tar xzvf Sounds-es.tar.gz
}
if [[ $1 == '' ]]; then
selectLanguage
elif [[ $1 == 'en' ]]; then
installEn
elif [[ $1 == 'br' ]]; then
installBr
elif [[ $1 == 'es' ]]; then
installEs
else
selectLanguage
fi
cd /var/www/html/mbilling
echo $'[billing]
exten => _[*0-9].,1,AGI("/var/www/html/mbilling/resources/asterisk/mbilling.php")
same => n,Hangup()
exten => _+X.,1,Goto(billing,${EXTEN:1},1)
exten => h,1,hangup()
exten => *111,1,VoiceMailMain(${CHANNEL(peername)}@billing)
same => n,Hangup()
[trunk_answer_handler]
exten => s,1,Set(MASTER_CHANNEL(TRUNKANSWERTIME)=${EPOCH})
same => n,Return()
' > /etc/asterisk/extensions_magnus.conf
echo "
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
displayconnects = no
[magnus]
secret = magnussolution
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate
" > /etc/asterisk/manager.conf
echo "#include extensions_magnus.conf" >> /etc/asterisk/extensions.conf
echo '#include extensions_magnus_did.conf' >> /etc/asterisk/extensions.conf
echo "#include musiconhold_magnus.conf" >> /etc/asterisk/musiconhold.conf
echo "#include voicemail_magnus.conf" >> /etc/asterisk/voicemail.conf
echo "
noload => res_config_sqlite3.so
noload => res_config_sqlite.so
noload => chan_skinny.so
noload => cdr_custom.so
noload => cdr_odbc.so
noload => cdr_sqlite3_custom.so
noload => cdr_csv.so
noload => cdr_manager.so
noload => chan_iax2.so
noload => cdr_mysql.so
noload => app_celgenuserevent.so
noload => cel_custom.so
noload => cel_manager.so
noload => cel_odbc.so
noload => cel_sqlite3_custom.so
noload => res_format_attr_celt.so
" >> /etc/asterisk/modules.conf
echo "
/var/log/asterisk/*log {
missingok
rotate 3
weekly
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
/var/log/asterisk/messages {
missingok
rotate 3
weekly
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
/var/log/asterisk/magnus {
missingok
rotate 3
daily
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
/var/log/asterisk/fail2ban {
missingok
rotate 3
weekly
postrotate
/usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
endscript
}
" > /etc/logrotate.d/asterisk
MBillingMysqlPass=$(genpasswd)
echo
echo "----------- Installing the new Database ----------"
echo
sleep 2
mysql -uroot -p${password} -e "create database mbilling;"
mysql -uroot -p${password} -e "CREATE USER 'mbillingUser'@'localhost' IDENTIFIED BY '${MBillingMysqlPass}';"
mysql -uroot -p${password} -e "GRANT ALL PRIVILEGES ON \`mbilling\` . * TO 'mbillingUser'@'localhost' WITH GRANT OPTION;FLUSH PRIVILEGES;"
mysql -uroot -p${password} -e "GRANT FILE ON * . * TO 'mbillingUser'@'localhost' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;"
mysql -uroot -p${password} -e "update mysql.user set plugin='' where User='root';"
mysql mbilling -u root -p${password} < /var/www/html/mbilling/script/database.sql
rm -rf /var/www/html/mbilling/script
echo "[general]
dbhost = 127.0.0.1
dbname = mbilling
dbuser = mbillingUser
dbpass = $MBillingMysqlPass
" > /etc/asterisk/res_config_mysql.conf
echo '[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
' > /etc/asterisk/asterisk.conf
echo "
[options]
documentation_language = en_US
verbose = 5
debug = 0
maxfiles = 500000
hideconnect = 1
[compat]
pbx_realtime=1.6
res_agi=1.6
app_set=1.6" >> /etc/asterisk/asterisk.conf
echo 500000 > /proc/sys/fs/file-max
echo "fs.file-max=500000">>/etc/sysctl.conf
ulimit -c unlimited # The maximum size of core files created.
ulimit -d unlimited # The maximum size of a process's data segment.
ulimit -f unlimited # The maximum size of files created by the shell (default option)
ulimit -i unlimited # The maximum number of pending signals
ulimit -n 99999 # The maximum number of open file descriptors.
ulimit -q unlimited # The maximum POSIX message queue size
ulimit -u unlimited # The maximum number of processes available to a single user.
ulimit -v unlimited # The maximum amount of virtual memory available to the process.
ulimit -x unlimited # ???
ulimit -s 240 # The maximum stack size
ulimit -l unlimited # The maximum size that may be locked into memory.
ulimit -a # All current limits are reported.
echo '
* soft nofile 500000
* hard nofile 500000
* soft core unlimited
* hard core unlimited
* soft data unlimited
* hard data unlimited
* soft fsize unlimited
* hard fsize unlimited
* soft memlock unlimited
* hard memlock unlimited
* soft cpu unlimited
* hard cpu unlimited
* soft nproc unlimited
* hard nproc unlimited
* soft locks unlimited
* hard locks unlimited
* soft sigpending unlimited
* hard sigpending unlimited' >> /etc/security/limits.conf
CRONPATH='/var/spool/cron/crontabs/root'
echo "
8 8 * * * php /var/www/html/mbilling/cron.php servicescheck
* * * * * php /var/www/html/mbilling/cron.php callchart
1 * * * * php /var/www/html/mbilling/cron.php NotifyClient
1 22 * * * php /var/www/html/mbilling/cron.php DidCheck
1 23 * * * php /var/www/html/mbilling/cron.php PlanCheck
0 2 * * * php /var/www/html/mbilling/cron.php Backup
0 4 * * * /var/www/html/mbilling/protected/commands/clear_memory
*/2 * * * * php /var/www/html/mbilling/cron.php SummaryTablesCdr
*/3 * * * * php /var/www/html/mbilling/cron.php PhoneBooksReprocess
* * * * * php /var/www/html/mbilling/cron.php statussystem
* * * * * php /var/www/html/mbilling/cron.php didwww
*/5 * * * * php /var/www/html/mbilling/cron.php alarm
* * * * * php /var/www/html/mbilling/cron.php TrunkSIPCodes
59 23 * * * php /var/www/html/mbilling/cron.php NotifyClientDaily
" > $CRONPATH
chmod 600 $CRONPATH
echo "
* * * * * root php /var/www/html/mbilling/cron.php cryptocurrency
">> /etc/crontab
echo "
[general]
bindaddr=0.0.0.0
bindport=5060
context = billing
dtmfmode=RFC2833
disallow=all
allow=g729
allow=g723
allow=ulaw
allow=alaw
allow=gsm
rtcachefriends=yes
srvlookup=yes
useragent=MagnusBilling
allowsubscribe = no
alwaysauthreject=yes
rtupdate=yes
allowguest=no
language=$language
rtptimeout=60
rtpholdtimeout=300
rtsavesysname=yes
rtupdate=yes
ignoreregexpire=yes
#include sip_magnus_register.conf
#include sip_magnus_user.conf
#include sip_magnus.conf
" > /etc/asterisk/sip.conf
echo "
[general]
bandwidth=low
disallow=lpc10
jitterbuffer=no
autokill=yes
#include iax_magnus_register.conf
#include iax_magnus_user.conf
#include iax_magnus.conf
" > /etc/asterisk/iax.conf
echo "
#include queues_magnus.conf
" >> /etc/asterisk/queues.conf
echo "
" > /var/www/html/index.php
echo "
User-agent: *
Disallow: /mbilling/
" > /var/www/html/robots.txt
systemctl daemon-reload
install_fail2ban()
{
apt-get -y install fail2ban
}
echo
echo "Installing Fail2ban & Iptables"
echo
ssh_port=$(cat /etc/ssh/sshd_config | grep Port | awk 'NR==1{print $2}')
apt install -y firewalld
install_fail2ban
systemctl disable iptables
systemctl start firewalld
systemctl enable firewalld
systemctl enable fail2ban
firewall-cmd --zone=public --add-port=$sshPort/tcp --permanent
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --zone=public --add-port=5060/udp --permanent
firewall-cmd --zone=public --add-port=10000-60000/udp --permanent
firewall-cmd --reload
firewall-cmd --zone=public --list-all
touch /var/www/html/mbilling/protected/runtime/application.log
chmod 655 /var/www/html/mbilling/protected/runtime/application.log
echo
echo "Fail2ban configuration!"
echo
echo '
[INCLUDES]
[Definition]
failregex = NOTICE.* .*: Useragent: sipcli.*\[\]
ignoreregex =
' > /etc/fail2ban/filter.d/asterisk_cli.conf
echo '
[INCLUDES]
[Definition]
failregex = .*NOTICE.* tried to authenticate with nonexistent user.*
ignoreregex =
' > /etc/fail2ban/filter.d/asterisk_manager.conf
echo '
[INCLUDES]
[Definition]
failregex = NOTICE.* .*hangupcause to DB: 200, \[\]
ignoreregex =
' > /etc/fail2ban/filter.d/asterisk_hgc_200.conf
echo '
[INCLUDES]
[Definition]
failregex = .*client \].*request failed: URI too long.*
.*client \].*request failed: error reading the headers
ignoreregex =
' > /etc/fail2ban/filter.d/mbilling_ddos.conf
echo '
[INCLUDES]
[Definition]
failregex = .*Username and password combination is invalid - User.*IP:
ignoreregex =
datepattern = ^%%Y/%%m/%%d:%%H:%%M:%%S
' > /etc/fail2ban/filter.d/mbilling_login.conf
echo "
[DEFAULT]
ignoreip = 127.0.0.1
bantime = 600
findtime = 600
maxretry = 3
backend = auto
usedns = warn
banaction = firewallcmd-multiport
banaction_allports = firewallcmd-multiport
[asterisk-iptables]
enabled = true
filter = asterisk
logpath = /var/log/asterisk/messages
maxretry = 5
bantime = 600
[ast-cli-attck]
enabled = true
filter = asterisk_cli
logpath = /var/log/asterisk/messages
maxretry = 1
bantime = -1
[asterisk-manager]
enabled = true
filter = asterisk_manager
logpath = /var/log/asterisk/messages
maxretry = 1
bantime = -1
[ast-hgc-200]
enabled = true
filter = asterisk_hgc_200
logpath = /var/log/asterisk/messages
maxretry = 20
bantime = -1
[mbilling_login]
enabled = true
filter = mbilling_login
logpath = /var/www/html/mbilling/protected/runtime/application.log
maxretry = 3
bantime = 300
[ip-blacklist]
enabled = true
filter = ip-blacklist
logpath = /var/www/html/mbilling/resources/ip.blacklist
maxretry = 0
findtime = 15552000
bantime = -1
[ssh]
enabled=true
[mbilling_ddos]
enabled = true
filter = mbilling_ddos
logpath = /var/log/apache2/error.log
maxretry = 20
bantime = 3600" > /etc/fail2ban/jail.local
rm -rf /var/www/html/mbilling/resources/ip.blacklist
touch /var/www/html/mbilling/resources/ip.blacklist
chown -R asterisk:asterisk /var/www/html/mbilling/resources/
echo "
[Definition]
failregex = ^ \[.*\]$
ignoreregex =
" > /etc/fail2ban/filter.d/ip-blacklist.conf
echo "
[general]
dateformat=%F %T
[logfiles]
console => error
messages => notice,warning,error
magnus => debug
" > /etc/asterisk/logger.conf
touch /var/log/auth.log
mkdir /var/run/fail2ban/
asterisk -rx "module reload logger"
systemctl enable fail2ban.service
systemctl restart fail2ban.service
iptables -L -v
php /var/www/html/mbilling/cron.php updatemysql
chown -R asterisk:asterisk /var/lib/php/session*
chown -R asterisk:asterisk /var/spool/asterisk/outgoing/
chown -R asterisk:asterisk /etc/asterisk
chmod -R 777 /tmp
chmod -R 555 /var/www/html/mbilling/
chmod -R 750 /var/www/html/mbilling/resources/reports
chmod -R 774 /var/www/html/mbilling/protected/runtime/
mkdir -p /usr/local/src/magnus/monitor
mkdir -p /usr/local/src/magnus/sounds
mkdir -p /usr/local/src/magnus/backup
mkdir -p /var/www/tmpmagnus
chown -R asterisk:asterisk /var/www/tmpmagnus
chmod -R 777 /var/www/tmpmagnus
mv /usr/local/src/backup* /usr/local/src/magnus/backup
chown -R asterisk:asterisk /usr/local/src/magnus/
chmod -R 755 /usr/local/src/magnus/
chmod 774 /var/www/html/mbilling/resources/ip.blacklist
chmod -R 655 /var/www/html/mbilling/tmp
chmod -R 750 /var/www/html/mbilling/resources/sounds
chmod -R 770 /var/www/html/mbilling/resources/images
chmod -R 755 /var/www/html/mbilling/assets/
chown -R asterisk:asterisk /var/www/html/mbilling
chmod +x /var/www/html/mbilling/resources/asterisk/mbilling.php
chmod -R 100 /var/www/html/mbilling/resources/asterisk/
chown -R asterisk:asterisk /var/lib/asterisk/moh/
echo
echo
echo ===============================================================
echo
/var/www/html/mbilling/protected/commands/update.sh
p4_proc()
{
set $(grep "model name" /proc/cpuinfo);
if [ "$4" == "Celeron" ]; then
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast13-gcc4-glibc-pentium.so
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast13-gcc4-glibc-pentium.so
cp /usr/src/codec_g723-ast13-gcc4-glibc-pentium.so /usr/lib/asterisk/modules/codec_g723.so
cp /usr/src/codec_g729-ast13-gcc4-glibc-pentium.so /usr/lib/asterisk/modules/codec_g729.so
return 0;
fi
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast130-gcc4-glibc-pentium4.so
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast130-gcc4-glibc-pentium4.so
mv /usr/src/codec_g723-ast130-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g723.so
mv codec_g729-ast130-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g729.so
}
p4_x64_proc()
{
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast130-gcc4-glibc-x86_64-pentium4.so
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast130-gcc4-glibc-x86_64-pentium4.so
mv /usr/src/codec_g723-ast130-gcc4-glibc-x86_64-pentium4.so /usr/lib/asterisk/modules/codec_g723.so
mv /usr/src/codec_g729-ast130-gcc4-glibc-x86_64-pentium4.so /usr/lib/asterisk/modules/codec_g729.so
}
p3_proc()
{
set $(grep "model name" /proc/cpuinfo);
if [ "$4" == "Intel(R)" && "$5" == "Pentium(R)" && "$6"== "III" ];then
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast130-gcc4-glibc-pentium.so
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast130-gcc4-glibc-pentium.so
mv /usr/src/codec_g723-ast130-gcc4-glibc-pentium.so /usr/lib/asterisk/modules/codec_g723.so
mv /usr/src/codec_g729-ast130-gcc4-glibc-pentium.so /usr/lib/asterisk/modules/codec_g729.so
return 0;
fi
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast130-gcc4-glibc-pentium3.so
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast130-gcc4-glibc-pentium3.so
mv /usr/src/codec_g723-ast130-gcc4-glibc-pentium3.so /usr/lib/asterisk/modules/codec_g723.so
mv /usr/src/codec_g729-ast130-gcc4-glibc-pentium3.so /usr/lib/asterisk/modules/codec_g729.so
}
AMD_proc()
{
wget https://www.magnusbilling.org/download/codecs/codec_g729-ast130-gcc4-glibc-athlon-sse.so
wget https://www.magnusbilling.org/download/codecs/codec_g723-ast130-gcc4-glibc-athlon-sse.so
mv /usr/src/codec_g723-ast130-gcc4-glibc-athlon-sse.so /usr/lib/asterisk/modules/codec_g723.so
mv /usr/src/codec_g729-ast130-gcc4-glibc-athlon-sse.so /usr/lib/asterisk/modules/codec_g729.so
}
processor_type()
{
_UNAME=`uname -a`;
_IS_64_BIT=`echo "$_UNAME" | grep x86_64`
if [ -n "$_IS_64_BIT" ];
then _64BIT=1;
else _64BIT=0;
fi;
}
cd /usr/src/asterisk-13.35.0
make config
echo "INSTALLING G723 and G729 CODECS......... FROM http://asterisk.hosting.lv";
cd /usr/src
rm -rf codec_*
processor_type;
_IS_AMD=`cat /proc/cpuinfo | grep AMD`;
_P3=`cat /proc/cpuinfo | grep "Pentium III"`;
_P3_R=`cat /proc/cpuinfo | grep "Pentium(R) III"`;
_INTEL=`cat /proc/cpuinfo | grep Intel`;
if [ -n "$_IS_AMD" ];
then
echo "Processor type detected: AMD";
if [ "$_64BIT" == 1 ]; then
echo "It is a x64 proc";
p4_x64_proc;
else
echo "AMD processor detected";
AMD_proc;
fi
elif [ -n "$_P3_R" ]; then echo "Pentium(R) III processor detected"; p3_proc;
elif [ "$_64BIT" == 1 ]; then echo "Processor type detected: INTEL x64"; p4_x64_proc;
elif [ -n "$_INTEL" ]; then echo "Pentium IV processor detected"; p4_proc;
elif [ -n "$_P3" ]; then echo "Pentium III processor detected"; p3_proc;
else
echo -e "Automatic detection of required codec installation script failed\nYou must manually select and install the required codec according to this output:";
cat /proc/cpuinfo
uname -a
echo "you can find codecs installation scripts in http://asterisk.hosting.lv";
fi;
asterisk -rx 'module load codec_g729.so'
asterisk -rx 'module load codec_g723.so'
sleep 4
asterisk -rx 'core show translation'
whiptail --title "MagnusBilling Instalation Result" --msgbox "Congratulations! You have installed MagnusBilling in your Server.\n\nAccess your MagnusBilling in http://your_ip/ \n Username = root \n Password = magnus \n\nYour mysql root password is $password\n\n\nPRESS ANY KEY TO REBOOT YOUR SERVER" --fb 20 70
reboot
Friday, July 25, 2014
Easy Install Script for Fail2ban version 0.8.4
This script was written by Cédric Brohée in order to simplify and
accelerate the integration of the solution in a basic Asterisk
configuration on Red Hat.
Before running it, you will have to do chmod 755.
Download the Script here fail2banscript
Copy the script in /usr/src.
run the script : sh fail2ban.sh
Follow the Steps and thatsit
Before running it, you will have to do chmod 755.
Download the Script here fail2banscript
Copy the script in /usr/src.
run the script : sh fail2ban.sh
Follow the Steps and thatsit
Vicidial scratch installation on centos 6.5 asterisk 1.8
How To guide for installing ViciDial on a NEW SERVER
- ViciDial SVN Trunk 2.9 with Asterisk 1.8.23.0-vici On CentOS 6.5
Introduction
VICIDIAL is an enterprise class, open source, call center suite in use by many large call centers around the world.
Asterisk is software that turns an ordinary computer into a voice communications server.
Together, you have a full featured predictive dialer. It can also function as an ACD for inbound calls, or closer calls coming from VICIDIAL outbound fronters. It is capable of inbound, outbound, and blended call handling. VICIDIAL even allows you to have agents logged in from remote locations.
Preliminary Notes
In this guide I will be installing this on a newly installed & updated CentOS 6 64-bit dedicated server that I am leasing from a data center. It has no control panel (cPanel, Plesk, ISPconfig, etc..) because a control panel is not needed. You should be comfortable using the putty command line terminal software and knowledgeable in server administration.
This guide also applies to CentOS 6 32-bit. (There were a couple minor modifications needed that I pointed out in that part of the guide)
This guide will not explain how to configure or use vicidial. For that, I recommend purchasing the Agent and Managers Manual from www.eflo.net. This is required reading. There is also a free version of the Agent and Manager's Manual available for download that will help. You may also use the forums to ask specific questions.
This tutorial is a derivative of the original scratch install instructions found in the astguiclient source package. It has been adapted to CentOS.
I recommend reading this turorial in its entirety before starting so you get an idea of what prerequisites are required.
From time to time this page may get updated and if so, I will update the date at the bottom of this guide.
The text that are highlighted in red are the areas you need to customize.
You must login as root during the entire installation and configuration process.
Update the system
Make sure you update the system first, then reboot if you installed an updated kernel.
yum -y update
reboot
reboot
Install the following software
yum install rdate unzip make patch gcc gcc-c++
subversion php php-devel php-gd gd-devel php-mbstring php-mcrypt
php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl
curl-devel perl-libwww-perl ImageMagick libxml2 sqlite wget libxml2-devel httpd
libpcap libpcap-devel libnet ncurses ncurses-devel screen mysql-server
mysql-devel ntp kernel* mutt glibc.i686 conntrack-tools telnet
Setup MySQL
Setup default MySQL tables, start MySQL and configure root password
Replace "MYSQL_PASSWORD" with a password that you want to create.
/etc/init.d/mysqld start
/usr/bin/mysqladmin -u root password 'MYSQL_PASSWORD'
mysql_secure_installation
chkconfig mysqld on
Here is a sample mysql configuration file you can use. Backup your original, then use this instead./usr/bin/mysqladmin -u root password 'MYSQL_PASSWORD'
mysql_secure_installation
chkconfig mysqld on
service mysqld stop
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf
nano /etc/my.cnf
cp /etc/my.cnf /etc/my.cnf.original
echo "" > /etc/my.cnf
nano /etc/my.cnf
[mysql.server] user = mysql #basedir = /var/lib [client] port = 3306 socket = /var/lib/mysql/mysql.sock [mysqld] datadir = /var/lib/mysql #tmpdir = /home/mysql_tmp socket = /var/lib/mysql/mysql.sock user = mysql old_passwords = 0 ft_min_word_len = 3 max_connections = 800 max_allowed_packet = 32M skip-external-locking log-error = /var/log/mysqld/mysqld.log query-cache-type = 1 query-cache-size = 32M long_query_time = 1 #slow_query_log = 1 #slow_query_log_file = /var/log/mysqld/slow-queries.log tmp_table_size = 128M table_cache = 1024 join_buffer_size = 1M key_buffer = 512M sort_buffer_size = 6M read_buffer_size = 4M read_rnd_buffer_size = 16M myisam_sort_buffer_size = 64M max_tmp_tables = 64 thread_cache_size = 8 thread_concurrency = 8 # If using replication, uncomment log-bin below #log-bin = mysql-bin [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [isamchk] key_buffer = 256M sort_buffer_size = 256M read_buffer = 2M write_buffer = 2M [myisamchk] key_buffer = 256M sort_buffer_size = 256M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [mysqld_safe] #log-error = /var/log/mysqld/mysqld.log #pid-file = /var/run/mysqld/mysqld.pid
mkdir
/var/log/mysqld
mv /var/log/mysqld.log /var/log/mysqld/mysqld.log
touch /var/log/mysqld/slow-queries.log
chown -R mysql:mysql /var/log/mysqld
service mysqld restart
mv /var/log/mysqld.log /var/log/mysqld/mysqld.log
touch /var/log/mysqld/slow-queries.log
chown -R mysql:mysql /var/log/mysqld
service mysqld restart
Update the time zone
Configure the system time and update it.
Customize the timezone. Take a look inside /usr/share/zoneinfo/ for all possible values.
rm /etc/localtime
ln -sf /usr/share/zoneinfo/US/Arizona /etc/localtime
rdate -s wwv.nist.gov
Changes take effect immediately after you run the rdate command.ln -sf /usr/share/zoneinfo/US/Arizona /etc/localtime
rdate -s wwv.nist.gov
Note: It's very important to set the correct time zone of your Operating System (shown above) and in the vicidial admin area (Admin->Phones, Admin->Servers, Admin->System Settings) and also in your php.ini file. They must all be the same time zone or offset equivalent. Don't forget about this when configuring vicidial after using this guide.
Turn off ntpd and remove it from bootup runlevels.
You will be running ntpdate from cron instead.
service ntpd stop
chkconfig ntpd off
chkconfig ntpd off
Setup CPAN and install libraries
Run the following command
yum install perl-CPAN
yum install perl-YAML
perl -MCPAN -e shell
yum install perl-YAML
perl -MCPAN -e shell
You will then install some CPAN libraries
Once you see the cpan> prompt you can begin installing modules.
This may take a while.
In the end, I usually run all these commands once again to make sure its all installed.This may take a while.
cpan> install CPAN::Meta
cpan> install CPAN
cpan> reload cpan
cpan> install YAML
cpan> install MD5
cpan> install Digest::MD5
cpan> install Digest::SHA1
cpan> install readline
cpan> install Bundle::CPAN
cpan> reload cpan
cpan> install DBI
cpan> force install DBD::mysql
cpan> install Net::Telnet
cpan> install Time::HiRes
cpan> install Net::Server
cpan> install Switch
cpan> install Mail::Sendmail
cpan> install Unicode::Map
cpan> install Jcode
cpan> install Spreadsheet::WriteExcel
cpan> install OLE::Storage_Lite
cpan> install Proc::ProcessTable
cpan> install IO::Scalar
cpan> install Spreadsheet::ParseExcel
cpan> install Curses
cpan> install Getopt::Long
cpan> install Net::Domain
cpan> install Term::ReadKey
cpan> install Term::ANSIColor
cpan> install Spreadsheet::XLSX
cpan> install Spreadsheet::Read
cpan> install LWP::UserAgent
cpan> install HTML::Entities
cpan> install HTML::Strip
cpan> install HTML::FormatText
cpan> install HTML::TreeBuilder
cpan> install Time::Local
cpan> install MIME::Decoder
cpan> install Mail::POP3Client
cpan> install Mail::IMAPClient
cpan> install Mail::Message
cpan> install IO::Socket::SSL
cpan> install MIME::Base64
cpan> install MIME::QuotedPrint
cpan> install Crypt::Eksblowfish::Bcrypt
cpan> quit
cpan> install CPAN
cpan> reload cpan
cpan> install YAML
cpan> install MD5
cpan> install Digest::MD5
cpan> install Digest::SHA1
cpan> install readline
cpan> install Bundle::CPAN
cpan> reload cpan
cpan> install DBI
cpan> force install DBD::mysql
cpan> install Net::Telnet
cpan> install Time::HiRes
cpan> install Net::Server
cpan> install Switch
cpan> install Mail::Sendmail
cpan> install Unicode::Map
cpan> install Jcode
cpan> install Spreadsheet::WriteExcel
cpan> install OLE::Storage_Lite
cpan> install Proc::ProcessTable
cpan> install IO::Scalar
cpan> install Spreadsheet::ParseExcel
cpan> install Curses
cpan> install Getopt::Long
cpan> install Net::Domain
cpan> install Term::ReadKey
cpan> install Term::ANSIColor
cpan> install Spreadsheet::XLSX
cpan> install Spreadsheet::Read
cpan> install LWP::UserAgent
cpan> install HTML::Entities
cpan> install HTML::Strip
cpan> install HTML::FormatText
cpan> install HTML::TreeBuilder
cpan> install Time::Local
cpan> install MIME::Decoder
cpan> install Mail::POP3Client
cpan> install Mail::IMAPClient
cpan> install Mail::Message
cpan> install IO::Socket::SSL
cpan> install MIME::Base64
cpan> install MIME::QuotedPrint
cpan> install Crypt::Eksblowfish::Bcrypt
cpan> quit
Installing the Asterisk-Perl module
NOTE: Do NOT use the 0.09 or any newer version, they do not work with ViciDial.
cd /usr/src
wget download.vicidial.com/required-apps/asterisk-perl-0.08.tar.gz
tar -zxf asterisk-perl-0.08.tar.gz
cd asterisk-perl-0.08
perl Makefile.PL
make all
make install
wget download.vicidial.com/required-apps/asterisk-perl-0.08.tar.gz
tar -zxf asterisk-perl-0.08.tar.gz
cd asterisk-perl-0.08
perl Makefile.PL
make all
make install
Installing additional software from source
Next, you will download, compile and install the following software.
- lame
- ttyload
- iftop
- mtop
- mytop
- htop
- sipsak
- ploticus
LAME:
LAME is an MP3 encoder used to convert audio files from WAV to MP3. Some prefer GSM usually, but others have standardized on MP3 so you would need this utility to be loaded to use that option.
cd /usr/src
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -zxf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make
make install
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar -zxf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make
make install
SOX:
SoX is a cross-platform command line utility that can convert various formats of computer audio files in to other formats.
cd /usr/src
wget http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.gz
tar -zxf sox-14.4.1.tar.gz
cd sox-14.4.1
./configure
make -s
make install
wget http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.gz
tar -zxf sox-14.4.1.tar.gz
cd sox-14.4.1
./configure
make -s
make install
TTYLOAD:
ttyload is a simple terminal application that shows the processor load in a graphical time-based scrolling graph. I use it to view how loaded the system is and it visualizes load spikes very well.
cd /usr/src
wget http://www.daveltd.com/src/util/ttyload/ttyload-0.5.3.tar.bz2
tar -xvjpf ttyload-0.5.3.tar.bz2
cd ttyload-0.5.3
nano ttyload.h
insert this #include directive just above the #define directives, then save and close the ttyload.h file
#include <time.h>
make
ln -s /usr/src/ttyload-0.5.3/ttyload /usr/bin/ttyload
wget http://www.daveltd.com/src/util/ttyload/ttyload-0.5.3.tar.bz2
tar -xvjpf ttyload-0.5.3.tar.bz2
cd ttyload-0.5.3
nano ttyload.h
insert this #include directive just above the #define directives, then save and close the ttyload.h file
#include <time.h>
make
ln -s /usr/src/ttyload-0.5.3/ttyload /usr/bin/ttyload
IFTOP:
iftop is a good console bandwidth visualization tool that shows you active connections, where they are going to/from and how much of your precious bandwidth they are using.
cd /usr/src
wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar -zxf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make
make install
wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar -zxf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make
make install
MTOP:
mtop is a great utility for real-time monitoring of mysql and the queries that are running in it.
Note: the root mysql password must be blank before installing this
mysql -u root -p
Enter your MySQL password, then the following MySQL command:
SET PASSWORD FOR root@localhost=PASSWORD('');QUIT;
cd /usr/src
wget http://downloads.sourceforge.net/project/mtop/mtop/v0.6.6/mtop-0.6.6.tar.gz
tar -zxf mtop-0.6.6.tar.gz
cd mtop-0.6.6
perl Makefile.PL
make
make install
wget http://downloads.sourceforge.net/project/mtop/mtop/v0.6.6/mtop-0.6.6.tar.gz
tar -zxf mtop-0.6.6.tar.gz
cd mtop-0.6.6
perl Makefile.PL
make
make install
Enter the following MySQL command to put your root password back the way it was originally
Replace "MYSQL_PASSWORD" with your real password.
SET PASSWORD FOR root@localhost=PASSWORD('MYSQL_PASSWORD');QUIT;
MYTOP:
mytop is is an optional utility for monitoring the threads and overall performance of mysql
Note: the root mysql password must be blank before installing this
mysql -u root -p
Enter your MySQL password, then the following MySQL command:
SET PASSWORD FOR root@localhost=PASSWORD('');QUIT;
cd /usr/src
wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar -zxf mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make
make test
make install
Enter the following MySQL command to put your root password back the way it was originallywget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar -zxf mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make
make test
make install
Replace "MYSQL_PASSWORD" with your real password.
SET PASSWORD FOR root@localhost=PASSWORD('MYSQL_PASSWORD');QUIT;
HTOP:
htop is an interactive process viewer for Linux
cd /usr/src
wget http://downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz
tar -zxf htop-1.0.2.tar.gz
cd htop-1.0.2
./configure
make
make install
wget http://downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz
tar -zxf htop-1.0.2.tar.gz
cd htop-1.0.2
./configure
make
make install
SIPSAK:
sipsak is an optional utility that VICIDIAL can use to send messages to an agent's SIP-based phone(like the Snom 320) to display text on their LCD screen.
cd /usr/src
wget http://downloads.sourceforge.net/project/sipsak.berlios/sipsak-0.9.6-1.tar.gz
tar -zxf sipsak-0.9.6-1.tar.gz
cd sipsak-0.9.6
./configure
make
make install
/usr/local/bin/sipsak --version
wget http://downloads.sourceforge.net/project/sipsak.berlios/sipsak-0.9.6-1.tar.gz
tar -zxf sipsak-0.9.6-1.tar.gz
cd sipsak-0.9.6
./configure
make
make install
/usr/local/bin/sipsak --version
PLOTICUS:
ploticus is a free graph creation package that allows you to create line graphs within PNG files simply by creating a config file and a data file. ViciDial uses this package to generate server performance graphs that can be displayed real-time within the ViciDial reports page.
cd /usr/src
wget http://downloads.sourceforge.net/project/ploticus/ploticus/2.42/ploticus242_src.tar.gz
tar -zxf ploticus242_src.tar.gz
cd ploticus242/src/
make clean
make
make install
mkdir -p /var/www/html/vicidial/ploticus/
cp pl /var/www/html/vicidial/ploticus/
wget http://downloads.sourceforge.net/project/ploticus/ploticus/2.42/ploticus242_src.tar.gz
tar -zxf ploticus242_src.tar.gz
cd ploticus242/src/
make clean
make
make install
mkdir -p /var/www/html/vicidial/ploticus/
cp pl /var/www/html/vicidial/ploticus/
Installing eAccelerator for PHP
Install the php module
cd /usr/src
wget http://downloads.sourceforge.net/project/eaccelerator/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.zip
unzip eaccelerator-0.9.6.1.zip
cd eaccelerator-0.9.6.1
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
wget http://downloads.sourceforge.net/project/eaccelerator/eaccelerator/eAccelerator%200.9.6.1/eaccelerator-0.9.6.1.zip
unzip eaccelerator-0.9.6.1.zip
cd eaccelerator-0.9.6.1
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install
Configure php.ini
nano /etc/php.ini
Change the following values in your php.ini file.Customize the date.timezone so you don't end up with a bunch of php errors complaining about it not being defined.
error_reporting = E_ALL & ~E_NOTICE
memory_limit = 48M
short_open_tag = On
max_execution_time = 330
max_input_time = 360
post_max_size = 48M
upload_max_filesize = 42M
default_socket_timeout = 360
date.timezone = America/Phoenix
Add the following lines to the dynamic extensions section of php.ini:
Note: For CentOS 32-bit, use this below: zend_extension="/usr/lib/php/modules/eaccelerator.so"
zend_extension="/usr/lib64/php/modules/eaccelerator.so" ;For CentOS 32-bit: zend_extension="/usr/lib/php/modules/eaccelerator.so" eaccelerator.shm_size="48" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="0" eaccelerator.shm_only="0" eaccelerator.compress="1" eaccelerator.compress_level="9"
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
php -v
You should see something like this:chmod 0777 /tmp/eaccelerator
php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
Editing the Apache config file
nano /etc/httpd/conf/httpd.conf
To disable logging, change:
CustomLog logs/access_log combinedto this:
CustomLog /dev/null combined
To enable web browsing of Recordings on Asterisk server, add this:
Alias /RECORDINGS/ "/var/spool/asterisk/monitorDONE/" <Directory "/var/spool/asterisk/monitorDONE"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all <files *.mp3> Forcetype application/forcedownload </files> </Directory>
Change the values of ServerSignature and ServerTokens directives as shown below.
ServerSignature Off ServerTokens Prod
Restart the Apache web server to apply the changes
service httpd restart
chkconfig httpd on
chkconfig httpd on
Install php-mcrypt extension module from a fedora repository since its not available in the standard repo.
You will need this so phpMyAdmin doesn't complain about not having mcrypt installed.
cd /usr/src
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum update
yum install php-mcrypt*
nano /etc/php.d/mcrypt.ini
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
yum update
yum install php-mcrypt*
nano /etc/php.d/mcrypt.ini
Comment out the current mcrypt location because it is incorrect, then add the new path below it.
Note: For CentOS 32-bit, use this below: extension=mcrypt.so"
; Enable mcrypt extension module ;For CentOS 32-bit: extension=mcrypt.so extension=/usr/lib64/php/modules/mcrypt.so
Restart the Apache web server to apply the changes
service httpd restart
Installing Asterisk
Any time you upgrade the Linux kernel you must recompile/install dahdi for the new kernel.
Asterisk must be compiled with dahdi support.
Note: The install MUST be done in the following order:
Minor note: dahdi-linux-complete-current.tar.gz and libpri-1.4-current.tar.gz may contain an updated version than what I am currently using, therefore the directory names may be different than shown below.
mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://download.vicidial.com/required-apps/asterisk-1.8.23.0-vici.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.9.1.1+2.9.1.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/old/libpri-1.4.15.tar.gz
tar -zxf asterisk-11.22.0-vici.tar.gz
tar -zxf dahdi-linux-complete-current.tar.gz
tar -zxf libpri-1.4-current.tar.gz
cd dahdi-linux-complete-2.11.1+2.11.1
make clean
make
make install
make config
cd tools
make clean
make
make install
make config
cd ../../libpri-1.6.0
make clean
make
make install
cd ../asterisk-11.22.0
./configure
make clean
make menuselect
make
make install
make samples
cp /usr/src/asterisk/asterisk-1.8.23.0/contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
chkconfig asterisk on
cd /usr/src/asterisk
wget http://download.vicidial.com/required-apps/asterisk-1.8.23.0-vici.tar.gz
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.9.1.1+2.9.1.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/old/libpri-1.4.15.tar.gz
tar -zxf asterisk-11.22.0-vici.tar.gz
tar -zxf dahdi-linux-complete-current.tar.gz
tar -zxf libpri-1.4-current.tar.gz
cd dahdi-linux-complete-2.11.1+2.11.1
make clean
make
make install
make config
cd tools
make clean
make
make install
make config
cd ../../libpri-1.6.0
make clean
make
make install
cd ../asterisk-11.22.0
./configure
make clean
make menuselect
make
make install
make samples
cp /usr/src/asterisk/asterisk-1.8.23.0/contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
chkconfig asterisk on
* Confirm DAHDI works properly.
* You do not need dahdi_dummy anymore, because it has not been required since DAHDI-Linux 2.3.0.
* The core of DAHDI is now able to use the kernel timers automatically if no telephony hardware is installed.
* http://www.voip-info.org/wiki/view/DAHDI
* http://www.voip-info.org/wiki/view/chan_dahdi.conf
* http://www.voip-info.org/wiki/view/Asterisk+CLI
service dahdi restart
chkconfig dahdi on
modprobe dahdi
lsmod | grep dahdi
dahdi_genconf
dahdi_cfg -vvv
dahdi_test
Check to see if the dahdi drivers are loaded.chkconfig dahdi on
modprobe dahdi
lsmod | grep dahdi
dahdi_genconf
dahdi_cfg -vvv
dahdi_test
lsmod | grep dahdi
Output should look similar to this:dahdi_transcode 6697 1 wctc4xxp dahdi_voicebus 54834 2 wctdm24xxp,wcte12xp dahdi 223523 15 xpp,dahdi_transcode,wcb4xxp,wctdm,wcfxo,wcaxx,wctdm24xxp,wcte11xp,wct1xxp,wcte13xp,wcte12xp,dahdi_voicebus,wcte43x,wct4xxp,oct612x crc_ccitt 1717 2 wctdm24xxp,dahdi
Installing audio files
Download the audio files
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-wav-current.tar.gz
Place the audio files in their proper placeswget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-gsm-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-ulaw-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-moh-opsound-wav-current.tar.gz
cd /var/lib/asterisk/sounds
tar -zxf /usr/src/asterisk-core-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-wav-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-wav-current.tar.gz
mkdir /var/lib/asterisk/mohmp3
mkdir /var/lib/asterisk/quiet-mp3
ln -s /var/lib/asterisk/mohmp3 /var/lib/asterisk/default
cd /var/lib/asterisk/mohmp3
tar -zxf /usr/src/asterisk-moh-opsound-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-wav-current.tar.gz
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/moh
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/sounds
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/quiet-mp3
sox ../mohmp3/macroform-cold_day.wav macroform-cold_day.wav vol 0.25
sox ../mohmp3/macroform-cold_day.gsm macroform-cold_day.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-cold_day.ulaw -t ul macroform-cold_day.ulaw vol 0.25
sox ../mohmp3/macroform-robot_dity.wav macroform-robot_dity.wav vol 0.25
sox ../mohmp3/macroform-robot_dity.gsm macroform-robot_dity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-robot_dity.ulaw -t ul macroform-robot_dity.ulaw vol 0.25
sox ../mohmp3/macroform-the_simplicity.wav macroform-the_simplicity.wav vol 0.25
sox ../mohmp3/macroform-the_simplicity.gsm macroform-the_simplicity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-the_simplicity.ulaw -t ul macroform-the_simplicity.ulaw vol 0.25
sox ../mohmp3/reno_project-system.wav reno_project-system.wav vol 0.25
sox ../mohmp3/reno_project-system.gsm reno_project-system.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/reno_project-system.ulaw -t ul reno_project-system.ulaw vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.wav manolo_camp-morning_coffee.wav vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.gsm manolo_camp-morning_coffee.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/manolo_camp-morning_coffee.ulaw -t ul manolo_camp-morning_coffee.ulaw vol 0.25
tar -zxf /usr/src/asterisk-core-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-core-sounds-en-wav-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-extra-sounds-en-wav-current.tar.gz
mkdir /var/lib/asterisk/mohmp3
mkdir /var/lib/asterisk/quiet-mp3
ln -s /var/lib/asterisk/mohmp3 /var/lib/asterisk/default
cd /var/lib/asterisk/mohmp3
tar -zxf /usr/src/asterisk-moh-opsound-gsm-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-ulaw-current.tar.gz
tar -zxf /usr/src/asterisk-moh-opsound-wav-current.tar.gz
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/moh
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/sounds
rm -f CHANGES*
rm -f LICENSE*
rm -f CREDITS*
cd /var/lib/asterisk/quiet-mp3
sox ../mohmp3/macroform-cold_day.wav macroform-cold_day.wav vol 0.25
sox ../mohmp3/macroform-cold_day.gsm macroform-cold_day.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-cold_day.ulaw -t ul macroform-cold_day.ulaw vol 0.25
sox ../mohmp3/macroform-robot_dity.wav macroform-robot_dity.wav vol 0.25
sox ../mohmp3/macroform-robot_dity.gsm macroform-robot_dity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-robot_dity.ulaw -t ul macroform-robot_dity.ulaw vol 0.25
sox ../mohmp3/macroform-the_simplicity.wav macroform-the_simplicity.wav vol 0.25
sox ../mohmp3/macroform-the_simplicity.gsm macroform-the_simplicity.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/macroform-the_simplicity.ulaw -t ul macroform-the_simplicity.ulaw vol 0.25
sox ../mohmp3/reno_project-system.wav reno_project-system.wav vol 0.25
sox ../mohmp3/reno_project-system.gsm reno_project-system.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/reno_project-system.ulaw -t ul reno_project-system.ulaw vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.wav manolo_camp-morning_coffee.wav vol 0.25
sox ../mohmp3/manolo_camp-morning_coffee.gsm manolo_camp-morning_coffee.gsm vol 0.25
sox -t ul -r 8000 -c 1 ../mohmp3/manolo_camp-morning_coffee.ulaw -t ul manolo_camp-morning_coffee.ulaw vol 0.25
Installing Proftpd
Install the FTP server from source
cd /usr/src
wget --passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.5.tar.gz
tar -zxf proftpd-1.3.5.tar.gz
cd proftpd-1.3.5
./configure --prefix=/usr --sysconfdir=/etc
make
make install
wget --passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.5.tar.gz
tar -zxf proftpd-1.3.5.tar.gz
cd proftpd-1.3.5
./configure --prefix=/usr --sysconfdir=/etc
make
make install
The proftpd binary gets installed in /usr/local/sbin, but we need it in /usr/sbin, so we create a symlink:
(This file might already exist, so don't worry if it gives you an error message that says it already exists)
ln -s /usr/local/sbin/proftpd /usr/sbin/proftpd
Create the init.d script
touch /etc/init.d/proftpd
nano /etc/init.d/proftpd
nano /etc/init.d/proftpd
insert the following code:
#! /bin/sh # # proftpd Start/Stop the cron proftpd daemon. # # chkconfig: 2345 40 60 # description: proftpd is a ftp server. # processname: proftpd # config: /etc/proftpd # pidfile: /var/run/proftpd # RedHat or Suse? if [ -e "/etc/SuSE-release" ]; then SUSE=1 DAEMONIZE='' RESULT='done' else REDHAT=1 DAEMONIZE='daemon' RESULT='' fi if [ "$REDHAT" = "1" ]; then # Source function library. if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions elif [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions else echo "Could not find functions file, your system may be broken" exit 1 fi fi if [ "$SUSE" = "1" ]; then # Source rc status functions . /etc/rc.status fi # See how we were called. case "$1" in start) echo -n "Starting proftpd: " $DAEMONIZE proftpd -p 0 echo $RESULT touch /var/lock/subsys/proftpd ;; stop) echo -n "Stopping proftpd: " killproc proftpd echo $RESULT rm -f /var/lock/subsys/proftpd ;; status) status proftpd ;; restart) $0 stop $0 start ;; *) echo "Usage: proftpd {start|stop|status|restart}" exit 1 esac
Create a log directory and log files for proftpd to use
mkdir /var/log/proftpd/
touch /var/log/proftpd/ftpxferlog
touch /var/log/proftpd/proftpd.log
touch /var/log/proftpd/ftpxferlog
touch /var/log/proftpd/proftpd.log
I use /var/www/html as my web root. You should do the same.
MY_FTP_USERNAME is the name of a Linux user account that you will create.
groupadd proftpd
useradd MY_FTP_USERNAME
passwd MY_FTP_USERNAME
chown -R MY_FTP_USERNAME /var/www/html
useradd MY_FTP_USERNAME
passwd MY_FTP_USERNAME
chown -R MY_FTP_USERNAME /var/www/html
Generate SSL certificate and key so you can transfer files securely to/from your server using SSL.
openssl version -a
openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ftpd-rsa-key.pem -out /etc/ftpd-rsa.pem
openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/ftpd-rsa-key.pem -out /etc/ftpd-rsa.pem
It will ask you some questions. Fill it out correctly.
Country Name (2 letter code) [XX]: US
State or Province Name (full name) []: Arizona
Locality Name (eg, city) [Default City]: Mesa
Organization Name (eg, company) [Default Company Ltd]: MyBusiness LLC
Organizational Unit Name (eg, section) []: HQ
Common Name (eg, your name or your server's hostname) []: dialer.mydomain.com
Email Address []: email@ddress.com
Backup the proftpd.conf file, delete all the contents, then edit it.
cp /etc/proftpd.conf /etc/proftpd.conf.original
echo "" > /etc/proftpd.conf
nano /etc/proftpd.conf
echo "" > /etc/proftpd.conf
nano /etc/proftpd.conf
insert the collowing code and replace xxx.xxx.xxx.xxx with the static IP address that ONLY YOU will be connecting from:
# This is a basic ProFTPD configuration file (rename it to # 'proftpd.conf' for actual use. It establishes a single server # and a single anonymous login. It assumes that you have a user/group # "nobody" and "ftp" for normal operation and anon. ServerName "MyBusiness Dialer" ServerType standalone DefaultServer on <IfModule mod_tls.c> TLSEngine on TLSProtocol SSLv23 TLSRequired off TLSRSACertificateFile /etc/ftpd-rsa.pem TLSRSACertificateKeyFile /etc/ftpd-rsa-key.pem TLSVerifyClient off TLSCipherSuite HIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3 TLSOptions NoSessionReuseRequired </IfModule> TransferLog /var/log/proftpd/ftpxferlog ExtendedLog /var/log/proftpd/proftpd.log read,write UseReverseDNS off IdentLookups off # Port 21 is the standard FTP port. Port 21 # Don't use IPv6 support by default. UseIPv6 off # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022 # To prevent DoS attacks, set the maximum number of child processes # to 30. If you need to allow more than 30 concurrent connections # at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd). MaxInstances 30 # Set the user and group under which the server will run. User nobody Group proftpd # To cause every FTP user to be "jailed" (chrooted) into their home # directory, uncomment this line. #DefaultRoot ~ # Normally, we want files to be overwriteable. AllowOverwrite on DefaultRoot /var/www/html <Limit LOGIN> Order Allow,Deny Allow xxx.xxx.xxx.xxx Deny from all </Limit> <Limit LIST NLST STOR STOU APPE RETR RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE_CHMOD PWD XPWD SIZE STAT CWD XCWD CDUP XCUP > AllowAll </Limit> <Limit SITE SITE_CHMOD SITE_CHGRP MTDM > DenyAll </Limit>
Allow proftpd to run on bootup and start proftpd
chmod 755 /etc/init.d/proftpd
chkconfig proftpd on
service proftpd restart
chkconfig proftpd on
service proftpd restart
Now you can connect to your server via FTP with or without SSL. Vicidial by default will not use SSL. This configuration gives the opportunity to use it either way. Use Filezilla to test this and see what it does.
Installing astGUIclient (ViciDial)
First, login to mysql to create the database, add a couple users and assign privileges.
NOTE: MY_DATABASE_USER and MY_DATABASE_PASSWORD will be used for login with phpMyAdmin
mysql -u root -p
Enter these MySQL commands:
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'MY_DATABASE_USER'@'localhost' IDENTIFIED BY 'MY_DATABASE_PASSWORD';
GRANT ALL PRIVILEGES on asterisk.* to MY_DATABASE_USER@localhost;
CREATE USER 'cron'@'localhost' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
quit
CREATE USER 'MY_DATABASE_USER'@'localhost' IDENTIFIED BY 'MY_DATABASE_PASSWORD';
GRANT ALL PRIVILEGES on asterisk.* to MY_DATABASE_USER@localhost;
CREATE USER 'cron'@'localhost' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@'%' IDENTIFIED BY '1234';
GRANT SELECT,INSERT,UPDATE,DELETE,LOCK TABLES on asterisk.* TO cron@localhost IDENTIFIED BY '1234';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
flush privileges;
quit
I am going to install the latest 2.x SVN trunk which happens to be version 2.9 at this time.
mkdir /usr/src/astguiclient
cd /usr/src/astguiclient
svn checkout svn://svn.eflo.net:43690/agc_2-X/trunk
cd trunk
perl install.pl
cd /usr/src/astguiclient
svn checkout svn://svn.eflo.net:43690/agc_2-X/trunk
cd trunk
perl install.pl
You will have to define various things like IP address of the server and FTP username/password.
It will also ask you where is the web root, use /var/www/html
Leave the other login settings as-is unless you already know how to update the database and other asterisk config files.
defined server_ip: xxx.xxx.xxx.xxx defined DB_server: localhost defined DB_database: asterisk defined DB_user: cron defined DB_pass: 1234 defined DB_custom_user: custom defined DB_custom_pass: custom1234 defined DB_port: 3306 defined active_keepalives: 1234568 defined asterisk_version: 1.8 defined copying conf files: y defined copying weblang files: n defined FTP_host: xxx.xxx.xxx.xxx defined FTP_user: MY_FTP_USERNAME defined FTP_pass: MY_FTP_PASSWORD defined FTP_port: 21 defined FTP_dir: RECORDINGS defined HTTP_path: http://xxx.xxx.xxx.xxx defined REPORT_host: xxx.xxx.xxx.xxx defined REPORT_user: MY_FTP_USERNAME defined REPORT_pass: MY_FTP_PASSWORD defined REPORT_port: 21 defined REPORT_dir: REPORTS
Import sample data
Login to mysql to run some commands
mysql -u root -p
Enter these MySQL commands:
SET GLOBAL connect_timeout=60;
use asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
\. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
quit
In the Linux terminal, enter these commandsuse asterisk;
\. /usr/src/astguiclient/trunk/extras/MySQL_AST_CREATE_tables.sql
\. /usr/src/astguiclient/trunk/extras/first_server_install.sql
\. /usr/src/astguiclient/trunk/extras/sip-iax_phones.sql
quit
/usr/share/astguiclient/ADMIN_area_code_populate.pl
cp /usr/src/astguiclient/trunk/extras/performance_test_leads.txt /usr/share/astguiclient/LEADS_IN/
/usr/src/astguiclient/trunk/bin/VICIDIAL_IN_new_leads_file.pl --forcelistid=107 --forcephonecode=1
cp /usr/src/astguiclient/trunk/extras/performance_test_leads.txt /usr/share/astguiclient/LEADS_IN/
/usr/src/astguiclient/trunk/bin/VICIDIAL_IN_new_leads_file.pl --forcelistid=107 --forcephonecode=1
Final Adjustments
Make several entries in the rc.local of your system.
nano /etc/rc.d/rc.local
On a new system I just overwrite the file with the following:#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local # OPTIONAL enable ip_relay(for same-machine trunking and blind monitoring) /usr/share/astguiclient/ip_relay/relay_control start 2>/dev/null 1>&2 # Disable console blanking and powersaving /usr/bin/setterm -blank /usr/bin/setterm -powersave off /usr/bin/setterm -powerdown ### start up the MySQL server /etc/init.d/mysqld start ### start up the apache web server /etc/init.d/httpd start ### roll the Asterisk logs upon reboot /usr/share/astguiclient/ADMIN_restart_roll_logs.pl ### clear the server-related records from the database /usr/share/astguiclient/AST_reset_mysql_vars.pl ### load dahdi drivers modprobe dahdi /usr/sbin/dahdi_cfg -vvvvvvvvvvvvv ### sleep for 20 seconds before launching Asterisk sleep 20 ### start up asterisk /usr/share/astguiclient/start_asterisk_boot.pl
Make several entries in the crontab of your system:
crontab -e
### recording mixing/compressing/ftping scripts #0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_mix.pl --MIX 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/share/astguiclient/AST_CRON_audio_1_move_VDonly.pl 1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58 * * * * /usr/share/astguiclient/AST_CRON_audio_2_compress.pl --GSM #2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59 * * * * /usr/share/astguiclient/AST_CRON_audio_3_ftp.pl --GSM ### keepalive script for astguiclient processes * * * * * /usr/share/astguiclient/ADMIN_keepalive_ALL.pl --cu3way ### kill Hangup script for Asterisk updaters * * * * * /usr/share/astguiclient/AST_manager_kill_hung_congested.pl ### updater for voicemail * * * * * /usr/share/astguiclient/AST_vm_update.pl ### updater for conference validator * * * * * /usr/share/astguiclient/AST_conf_update.pl ### flush queue DB table every hour for entries older than 1 hour 11 * * * * /usr/share/astguiclient/AST_flush_DBqueue.pl -q ### fix the vicidial_agent_log once every hour and the full day run at night 33 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl 50 0 * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --last-24hours ## uncomment below if using QueueMetrics #*/5 * * * * /usr/share/astguiclient/AST_cleanup_agent_log.pl --only-qm-live-call-check ## uncomment below if using Vtiger #1 1 * * * /usr/share/astguiclient/Vtiger_optimize_all_tables.pl --quiet ### updater for VICIDIAL hopper * * * * * /usr/share/astguiclient/AST_VDhopper.pl -q ### adjust the GMT offset for the leads in the vicidial_list table 1 1,7 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --debug ### reset several temporary-info tables in the database 2 1 * * * /usr/share/astguiclient/AST_reset_mysql_vars.pl ### optimize the database tables within the asterisk database 3 1 * * * /usr/share/astguiclient/AST_DB_optimize.pl ## adjust time on the server with ntp 30 * * * * /usr/sbin/ntpdate -u pool.ntp.org 2>/dev/null 1>&2 ### VICIDIAL agent time log weekly and daily summary report generation 2 0 * * 0 /usr/share/astguiclient/AST_agent_week.pl 22 0 * * * /usr/share/astguiclient/AST_agent_day.pl ### VICIDIAL campaign export scripts (OPTIONAL) #32 0 * * * /usr/share/astguiclient/AST_VDsales_export.pl #42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl ### remove old recordings more than 7 days old #24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f ### roll logs monthly on high-volume dialing systems #30 1 1 * * /usr/share/astguiclient/ADMIN_archive_log_tables.pl ### remove old vicidial logs and asterisk logs more than 2 days old 28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f 29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f 30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | xargs rm -f ### cleanup of the scheduled callback records 25 0 * * * /usr/share/astguiclient/AST_DB_dead_cb_purge.pl --purge-non-cb -q ### GMT adjust script - uncomment to enable #45 0 * * * /usr/share/astguiclient/ADMIN_adjust_GMTnow_on_leads.pl --list-settings ### Dialer Inventory Report 1 7 * * * /usr/share/astguiclient/AST_dialer_inventory_snapshot.pl -q --override-24hours ### inbound email parser * * * * * /usr/share/astguiclient/AST_inbound_email_parser.pl
Next, it is important to change the externip and localnet values in the sip.conf
The externip needs to be the public facing ip of your server.
The localnet will consist of the public facing ip and netmask of your server.
nano /etc/asterisk/sip.conf
externip = xxx.xxx.xxx.xxx localnet=xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx
Run this perl script to update the server_ip fields in the asterisk tables (copy the command as-is)
/usr/share/astguiclient/ADMIN_update_server_ip.pl --old-server_ip=10.10.10.15
Update music on hold configuration
nano /etc/asterisk/musiconhold.conf
; ; Music on Hold -- Sample Configuration ;[default] mode=files directory=/var/lib/asterisk/mohmp3 [quiet] mode=files directory=/var/lib/asterisk/quiet-mp3 #include musiconhold-vicidial.conf
* There are other sample configration files in /usr/src/astguiclient/docs/conf_examples/ that you might want to look at and maybe copy from and customize.
Lastly, reboot the machine
reboot
Diagnostics
After reboot, check your logs for any errors, make sure asterisk is up and running.
Be proactive and look for problems before you start configuring vicidial.
Run these commands to view log files:
- tail -f -n 50 /var/log/asterisk/messages
- tail -f -n 50 /var/log/messages
- more /var/log/dmesg
- tail -f -n 40 /etc/httpd/logs/error_log
- tail -f -n 40 /var/log/maillog
- tail -f -n 40 /var/log/cron
screen -ls
The output should look similar to this:There are screens on: 2301.ASTVDauto (Detached) 2125.asterisk (Detached) 2292.ASTupdate (Detached) 2307.ASTVDadapt (Detached) 2120.astshell20131221211922 (Detached) 2304.ASTVDremote (Detached) 2310.ASTfastlog (Detached) 2298.ASTlisten (Detached) 2295.ASTsend (Detached) 9 Sockets in /var/run/screen/S-root.
Start using vicidial
Login to vicidial and configure it.
Add users, campaigns, in-group, DID's, server, etc....
Go to: http://youripaddress/vicidial/admin.php
The default username is: 6666 and the password is: 1234
A note about security
When you get the vicidial server configured and working, make sure to follow basic common sense server administration rules like setting up a firewall, changing default passwords, disallow remote mysql connections or limiting it, etc...
Below is firewall script I borrowed from VICIbox Server that works quite well (why reinvent the wheel?). It basically blocks all IP adresses by default and only allows the IP addresses in which you specify to have access to the server. It's pretty good at blocking out all those voip hackers. I almost don't even need to worry anymore.
I personally implement these iptable rules as soon as I get my server online and running and BEFORE starting this guide. DO NOT implement this unless you have a way to get back into your server in case it does not work for you. Take a look at it and modify it as needed. In my case, I use a server that I lease from Softlayer and they provide me with a VPN and IPMI interface and software to get back in if needed.
mkdir /usr/src/iptables/
touch /usr/src/iptables/whitelist.rules
nano /usr/src/iptables/whitelist.rules
I also had to add various IP addresses for softlayer to connect to
my server because they might do automated ping scans and remote
management.touch /usr/src/iptables/whitelist.rules
nano /usr/src/iptables/whitelist.rules
Replace xxx.xxx.xxx.xxx with the IP address that you need to allow access to your server.
These ip addresses will be your remote location (using a static IP), your data center IP's, DID providers (such as Aretta, Switch2Voip, etc..), external database servers, etc...
Customize and add the following code to the whitelist.rules file:
# Generated by iptables-save v1.4.7 on Sat Dec 21 21:31:39 2013 *raw :PREROUTING ACCEPT [72:5698] :OUTPUT ACCEPT [71:5742] -A PREROUTING -i lo -j NOTRACK -A OUTPUT -o lo -j NOTRACK COMMIT # Completed on Sat Dec 21 21:31:39 2013 # Generated by iptables-save v1.4.7 on Sat Dec 21 21:31:39 2013 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] :forward_ext - [0:0] :forward_int - [0:0] :input_ext - [0:0] :input_int - [0:0] :reject_func - [0:0] -A INPUT -s xxx.xxx.xxx.xxx -j ACCEPT -A INPUT -s xxx.xxx.xxx.xxx -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state ESTABLISHED -j ACCEPT -A INPUT -p icmp -m state --state RELATED -j ACCEPT -A INPUT -i eth0 -j input_int -A INPUT -i eth1 -j input_ext -A INPUT -j input_ext -A INPUT -m limit --limit 3/min -j LOG --log-prefix "SFW2-IN-ILL-TARGET " --log-tcp-options --log-ip-options -A INPUT -j DROP -A FORWARD -m limit --limit 3/min -j LOG --log-prefix "SFW2-FWD-ILL-ROUTING " --log-tcp-options --log-ip-options -A OUTPUT -o lo -j ACCEPT -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT -A OUTPUT -m limit --limit 3/min -j LOG --log-prefix "SFW2-OUT-ERROR " --log-tcp-options --log-ip-options -A input_ext -m pkttype --pkt-type broadcast -j DROP -A input_ext -m recent --rcheck --name GOOD --rsource -j ACCEPT -A input_ext -p icmp -m icmp --icmp-type 4 -j ACCEPT -A input_ext -p tcp -m tcp --dport 113 -m state --state NEW -j reject_func -A input_ext -m pkttype --pkt-type multicast -j DROP -A input_ext -m pkttype --pkt-type broadcast -j DROP -A input_ext -p tcp -m limit --limit 3/min -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j LOG --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options -A input_ext -p icmp -m limit --limit 3/min -j LOG --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options -A input_ext -p udp -m limit --limit 3/min -m state --state NEW -j LOG --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options -A input_ext -j DROP -A input_ext -p icmp -m icmp --icmp-type 4 -j ACCEPT -A input_ext -p tcp -m tcp --dport 113 -m state --state NEW -j reject_func -A input_int -j ACCEPT -A reject_func -p tcp -j REJECT --reject-with tcp-reset -A reject_func -p udp -j REJECT --reject-with icmp-port-unreachable -A reject_func -j REJECT --reject-with icmp-proto-unreachable COMMIT # Completed on Sat Dec 21 21:31:39 2013
To implement the firewall rules immediately, run this command
iptables-restore < /usr/src/iptables/whitelist.rules
Edit the iptables configuration
nano /etc/sysconfig/iptables-config
Change the following values to yesThis will ensure the iptable rules get saved to the default iptables file (/etc/sysconfig/iptables) and re-used each time the firewall is stopped or restarted.
IPTABLES_SAVE_ON_STOP="yes"
IPTABLES_SAVE_ON_RESTART= "yes"
You can verify this by stopping and restarting the firewall or rebooting the server. Go ahead and try this.
service iptables stop
iptables -L
service iptables restart
iptables -L
reboot
iptables -L
iptables -L
service iptables restart
iptables -L
reboot
iptables -L
Upgrading
First, you will do a full backup, then you will upgrade your local copy of astguiclient via SVN and install it.
Make sure to read the UPGRADE doc for any new instructions.
/usr/share/astguiclient/ADMIN_backup.pl --debugX
cd /usr/src/astguiclient/trunk
svn up
perl install.pl
nano UPGRADE
cd /usr/src/astguiclient/trunk
svn up
perl install.pl
nano UPGRADE
Friday, March 7, 2014
Windows Shortcut Commands - 156 Useful Run Commands
Windows Shortcut Commands - 156 Useful Run Commands |
---|
To Access… | Run Command |
---|---|
Accessibility Controls | access.cpl |
Accessibility Wizard | accwiz |
Add Hardware Wizard | hdwwiz.cpl |
Add/Remove Programs | appwiz.cpl |
Administrative Tools | control admintools |
Adobe Acrobat (if installed) | acrobat |
Adobe Designer (if installed) | formdesigner |
Adobe Distiller (if installed) | acrodist |
Adobe ImageReady (if installed) | imageready |
Adobe Photoshop (if installed) | photoshop |
Automatic Updates | wuaucpl.cpl |
Bluetooth Transfer Wizard | fsquirt |
Calculator | calc |
Certificate Manager | certmgr.msc |
Character Map | charmap |
Check Disk Utility | chkdsk |
Clipboard Viewer | clipbrd |
Command Prompt | cmd |
Component Services | dcomcnfg |
Computer Management | compmgmt.msc |
Control Panel | control |
Date and Time Properties | timedate.cpl |
DDE Shares | ddeshare |
Device Manager | devmgmt.msc |
Direct X Control Panel (if installed)* | directx.cpl |
Direct X Troubleshooter | dxdiag |
Disk Cleanup Utility | cleanmgr |
Disk Defragment | dfrg.msc |
Disk Management | diskmgmt.msc |
Disk Partition Manager | diskpart |
Display Properties | control desktop |
Display Properties | desk.cpl |
Display Properties (w/Appearance Tab Preselected) | control color |
Dr. Watson System Troubleshooting Utility | drwtsn32 |
Driver Verifier Utility | verifier |
Event Viewer | eventvwr.msc |
Files and Settings Transfer Tool | migwiz |
File Signature Verification Tool | sigverif |
Findfast | findfast.cpl |
Firefox (if installed) | firefox |
Folders Properties | folders |
Fonts | control fonts |
Fonts Folder | fonts |
Free Cell Card Game | freecell |
Game Controllers | joy.cpl |
Group Policy Editor (XP Prof) | gpedit.msc |
Hearts Card Game | mshearts |
Help and Support | helpctr |
HyperTerminal | hypertrm |
Iexpress Wizard | iexpress |
Indexing Service | ciadv.msc |
Internet Connection Wizard | icwconn1 |
Internet Explorer | iexplore |
Internet Properties | inetcpl.cpl |
Internet Setup Wizard | inetwiz |
IP Configuration (Display Connection Configuration) | ipconfig /all |
IP Configuration (Display DNS Cache Contents) | ipconfig /displaydns |
IP Configuration (Delete DNS Cache Contents) | ipconfig /flushdns |
IP Configuration (Release All Connections) | ipconfig /release |
IP Configuration (Renew All Connections) | ipconfig /renew |
IP Configuration (Refreshes DHCP & Re-Registers DNS) | ipconfig /registerdns |
IP Configuration (Display DHCP Class ID) | ipconfig /showclassid |
IP Configuration (Modifies DHCP Class ID) | ipconfig /setclassid |
Java Control Panel (if installed) | jpicpl32.cpl |
Java Control Panel (if installed) | javaws |
Keyboard Properties | control keyboard |
Local Security Settings | secpol.msc |
Local Users and Groups | lusrmgr.msc |
Logs You Out Of Windows | logoff |
Malicious Software Removal Tool | mrt |
Microsoft Access (if installed) | msaccess |
Microsoft Chat | winchat |
Microsoft Excel (if installed) | excel |
Microsoft Frontpage (if installed) | frontpg |
Microsoft Movie Maker | moviemk |
Microsoft Paint | mspaint |
Microsoft Powerpoint (if installed) | powerpnt |
Microsoft Word (if installed) | winword |
Microsoft Syncronization Tool | mobsync |
Minesweeper Game | winmine |
Mouse Properties | control mouse |
Mouse Properties | main.cpl |
Nero (if installed) | nero |
Netmeeting | conf |
Network Connections | control netconnections |
Network Connections | ncpa.cpl |
Network Setup Wizard | netsetup.cpl |
Notepad | notepad |
Nview Desktop Manager (if installed) | nvtuicpl.cpl |
Object Packager | packager |
ODBC Data Source Administrator | odbccp32.cpl |
On Screen Keyboard | osk |
Opens AC3 Filter (if installed) | ac3filter.cpl |
Outlook Express | msimn |
Paint | pbrush |
Password Properties | password.cpl |
Performance Monitor | perfmon.msc |
Performance Monitor | perfmon |
Phone and Modem Options | telephon.cpl |
Phone Dialer | dialer |
Pinball Game | pinball |
Power Configuration | powercfg.cpl |
Printers and Faxes | control printers |
Printers Folder | printers |
Private Character Editor | eudcedit |
Quicktime (If Installed) | QuickTime.cpl |
Quicktime Player (if installed) | quicktimeplayer |
Real Player (if installed) | realplay |
Regional Settings | intl.cpl |
Registry Editor | regedit |
Registry Editor | regedit32 |
Remote Access Phonebook | rasphone |
Remote Desktop | mstsc |
Removable Storage | ntmsmgr.msc |
Removable Storage Operator Requests | ntmsoprq.msc |
Resultant Set of Policy (XP Prof) | rsop.msc |
Scanners and Cameras | sticpl.cpl |
Scheduled Tasks | control schedtasks |
Security Center | wscui.cpl |
Services | services.msc |
Shared Folders | fsmgmt.msc |
Shuts Down Windows | shutdown |
Sounds and Audio | mmsys.cpl |
Spider Solitare Card Game | spider |
SQL Client Configuration | cliconfg |
System Configuration Editor | sysedit |
System Configuration Utility | msconfig |
System File Checker Utility (Scan Immediately) | sfc /scannow |
System File Checker Utility (Scan Once At The Next Boot) | sfc /scanonce |
System File Checker Utility (Scan On Every Boot) | sfc /scanboot |
System File Checker Utility (Return Scan Setting To Default) | sfc /revert |
System File Checker Utility (Purge File Cache) | sfc /purgecache |
System File Checker Utility (Sets Cache Size to size x) | sfc /cachesize=x |
System Information | msinfo32 |
System Properties | sysdm.cpl |
Task Manager | taskmgr |
TCP Tester | tcptest |
Telnet Client | telnet |
Tweak UI (if installed) | tweakui |
User Account Management | nusrmgr.cpl |
Utility Manager | utilman |
Windows Address Book | wab |
Windows Address Book Import Utility | wabmig |
Windows Backup Utility (if installed) | ntbackup |
Windows Explorer | explorer |
Windows Firewall | firewall.cpl |
Windows Magnifier | magnify |
Windows Management Infrastructure | wmimgmt.msc |
Windows Media Player | wmplayer |
Windows Messenger | msmsgs |
Windows Picture Import Wizard (need camera connected) | wiaacmgr |
Windows System Security Tool | syskey |
Windows Update Launches | wupdmgr |
Windows Version (to show which version of windows) | winver |
Windows XP Tour Wizard | tourstart |
Wordpad | write |
Monday, September 30, 2013
Setup VsFTPD With Multiple Users Home dir with different permission
#yum install vsftpd* //for install the FTP Server packege
#vim /etc/vsftpd/vsftpd.conf //Mention below screen shoot entry in vsftpd.conf file
anonymous_enable=NO //Disable anonymous user
local_enable=YES //Enable local user for login
chroot_local_user=YES //for not shown user home dir path
user_config_dir=/etc/vsftpd/vsftpd-virtual-user/ //virtual user config dir
virtual_use_local_privs=YES //use local user as a virtual user
dual_log_enable=YES //For enable dual log /var/log/vsftpd.log
connect_from_port_20=YES //FTP port no
listen=YES //Read port no.
pam_service_name=vsftpd //PAM Authentication enable
tcp_wrappers=YES //TCP warapper enable
For Change FTP Portlisten_port=27 //Add this line in vsftpd.conf file for port changeHow to use Passive FTPIf you use FTP server in Passive Mode, Please enter these below line's in vsftpd.conf file
pasv_enable=yes //Enable FTP Server to Passive Mode
pasv_max_port=55000 //Passive FTP Maximum DATA port
pasv_min_port=50000 //Passive FTP Minimum DATA port
port_enable=YES //Enable Passive FTP DATA port
pasv_address=54.251.136.7 //Public ip of machine where ftp server is running
local_root=/home/kamal //Virtual user HOME dir
cmds_allowed=USER,PASS,SYST,FEAT,OPTS,PWD,TYPE,PASV,LIST,STOR,CWD,MKD,SIZE,MDTM,CDUP,RETR,RNFR,RNTO //Allow FTP CMD in this virtual user
local_umask=022 //SET umask value for virtual user
write_enable=YES //Write Enable for virtual user
Set Pam Authentication in vsftpd
#service vsftpd start
If disable Any FTP user Account Please Enter username in "#vim /etc/vsftpd/ftpusers"
all FTP commands and save it on the system for reference:
#vim /etc/vsftpd/vsftpd.conf //Mention below screen shoot entry in vsftpd.conf file

anonymous_enable=NO //Disable anonymous user
local_enable=YES //Enable local user for login
chroot_local_user=YES //for not shown user home dir path
user_config_dir=/etc/vsftpd/vsftpd-virtual-user/ //virtual user config dir
virtual_use_local_privs=YES //use local user as a virtual user
dual_log_enable=YES //For enable dual log /var/log/vsftpd.log
connect_from_port_20=YES //FTP port no
listen=YES //Read port no.
pam_service_name=vsftpd //PAM Authentication enable
tcp_wrappers=YES //TCP warapper enable
For Change FTP Portlisten_port=27 //Add this line in vsftpd.conf file for port changeHow to use Passive FTPIf you use FTP server in Passive Mode, Please enter these below line's in vsftpd.conf file
pasv_enable=yes //Enable FTP Server to Passive Mode
pasv_max_port=55000 //Passive FTP Maximum DATA port
pasv_min_port=50000 //Passive FTP Minimum DATA port
port_enable=YES //Enable Passive FTP DATA port
pasv_address=54.251.136.7 //Public ip of machine where ftp server is running
Create Dir for Virtual User in Vsftpd Root Dir
#mkdir /etc/vsftpd/vsftpd-virtual-user/
#cd /etc/vsftpd/vsftpd-virtual-user/
#vim vsftpd_user //enter your virtual user name and save

vivek //virtual user
kamal //virtual user
kamal //virtual user
Then create your virtual username file like vivek and kamal for special permission and set local_root
#vim /etc/vsftpd/vsftpd-virtual-user/ vivek and #vim /etc/vsftpd/vsftpd-virtual-user/kamal

cmds_allowed=USER,PASS,SYST,FEAT,OPTS,PWD,TYPE,PASV,LIST,STOR,CWD,MKD,SIZE,MDTM,CDUP,RETR,RNFR,RNTO //Allow FTP CMD in this virtual user
local_umask=022 //SET umask value for virtual user
write_enable=YES //Write Enable for virtual user
If you want to set All users login to one dir then enter line in vsftpd.conf file “ local_root=/your/dir/path”
AND
If you want to set All users login to own home dir then no need to mention “ local_root=/your/dir/path” entry in any file
AND
If you want to set only a users login to other dir (like kamal’s home dir is /data/k but you want set, its login on /home/kamal) then enter line in specific virtual user file /etc/vsftpd/vsftpd-virtual-user/kamal file “ local_root=/home/kamal”
Set Pam Authentication in vsftpd
# vim /etc/pam.d/vsftpd

#service vsftpd start
If disable Any FTP user Account Please Enter username in "#vim /etc/vsftpd/ftpusers"

all FTP commands and save it on the system for reference:
#
# List of FTP commands
#
# ABOR - Abort an active file transfer.
# ACCT - Account information.
# ADAT - Authentication/Security Data (RFC 2228)
# ALLO - Allocate sufficient disk space to receive a file.
# APPE - Append.
# AUTH - Authentication/Security Mechanism (RFC 2228)
# CCC - Clear Command Channel (RFC 2228)
# CDUP - Change to Parent Directory.
# CONF - Confidentiality Protection Command (RFC 697)
# CWD - Change working directory.
# DELE - Delete file.
# ENC - Privacy Protected Channel (RFC 2228)
# EPRT - Specifies an extended address and port to which the server should connect. (RFC 2428)
# EPSV - Enter extended passive mode. (RFC 2428)
# FEAT - Get the feature list implemented by the server. (RFC 2389)
# HELP - Returns usage documentation on a command if specified, else a general help document is returned.
# LAND - Language Negotiation (RFC 2640)
# LIST - Returns information of a file or directory if specified, else information of the current working directory is returned.
# LPRT - Specifies a long address and port to which the server should connect. (RFC 1639)
# LPSV - Enter long passive mode. (RFC 1639)
# MDTM - Return the last-modified time of a specified file. (RFC 3659)
# MIC - Integrity Protected Command (RFC 2228)
# MKD - Make directory.
# MLST - Lists the contents of a directory if a directory is named. (RFC 3659)
# MODE - Sets the transfer mode (Stream, Block, or Compressed).
# NLST - Returns a list of file names in a specified directory.
# NOOP - No operation (dummy packet; used mostly on keepalives).
# OPTS - Select options for a feature. (RFC 2389)
# PASS - Authentication password.
# PASV - Enter passive mode.
# PBSZ - Protection Buffer Size (RFC 2228)
# PORT - Specifies an address and port to which the server should connect.
# PWD - Print working directory. Returns the current directory of the host.
# QUIT - Disconnect.
# REIN - Re initializes the connection.
# REST - Restart transfer from the specified point.
# RETR - Retrieve (download) a remote file.
# RMD - Remove a directory.
# RNFR - Rename from.
# RNTO - Rename to.
# SITE - Sends site specific commands to remote server.
# SIZE - Return the size of a file. (RFC 3659)
# SMNT - Mount file structure.
# STAT - Returns the current status.
# STOR - Store (upload) a file.
# STOU - Store file uniquely.
# STRU - Set file transfer structure.
# SYST - Return system type.
# TYPE - Sets the transfer mode (ASCII/Binary).
# USER - Authentication username.
Subscribe to:
Posts (Atom)