www.ravispatel.in/mobile/php-projects.
html
How to install a SMTP server for email MKT
http://how2install.in/index.php/how-to-rotate-ip-address-
pool-in-linux-redhatcentosubuntudebian/
Q1: How To Rotate IP Address Pool In Linux (Redhat / Centos / Ubuntu /
Debian)
NOTE: x.x.x.1-8 for PUBLIC IP
/*
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.1
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.2
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.3
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.4
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.5
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.6
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.7
# iptables -t nat -I POSTROUTING -m state --state NEW -p tcp --dport 25 -o
eth0 -m statistic --mode nth --every 8 --packet 0 -j SNAT --to-source x.x.x.8
*/
How to install and configure POSTFIX MAIL SERVER
apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules
/etc/postfix/main.cf
---At the bottom of the file add the following lines:
/*
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes
/*
SAVE + EXIT
Vim /etc/postfix/sasl_passwd
/*
[smtp.gmail.com]:587 [email protected]:YOURPASSWORD
*/
For Permission
chmod 400 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
/etc/init.d/postfix reload
--make sure everything is running right
/*
echo "Testing Postfix to relay mail through Gmail SMTP" | mail -s "Postfix Testing"
[email protected]/*
OR TUTORIAL-2
http://www.blackhatworld.com/blackhat-seo/making-
money/488164-tutorial-how-set-up-your-own-linux-smtp-
server-ip-rotation-rdns-spf-dkim.html
OR TUTORIAL-3
[root@mail ~]# vim /etc/postfix/main.cf (config this file)
Line: 69 (#myhostname=host.domain.tld) clean this (host.domain.tld), word and a
(myhostname=mail.contoso.com) (# Zz‡j w`‡Z n‡e)
Line: 77 (#myhostname=domain.tld), clean this (domain.tld) word and add
(mydomain=contoso.com) (# Zz‡j w`‡Z n‡e)
Line : 93 (#myorigin=$mydomain) (# Zz‡j w`‡Z n‡e)
Line : 107 #inet_interfaces = all (# Zz‡j w`‡Z n‡e)
Line : 157 #mydestination = $myhostname, localhost.$mydomain, localhost,
$mydomain, and add (contoso.com, mail.contoso.com)
Line : 255 #mynetwork = 168.100.189.0/18, 127.0.0.0/8 (mynetwork = 172.24.0/16,
127.0.0.0/8) (# Zz‡j w`‡Z n‡e)
Line : 287 #relay_domains = $mydestination (# Zz‡j w`‡Z n‡e)
Line : 304 #relayhost = $mydomain (# Zz‡j w`‡Z n‡e)
Line : 377 alias_maps = hash:/etc/aliases (# Zz‡j w`‡Z n‡e bv)
Line : 378 #alias_maps = hash:/etc/aliases, nis:mail.aliases(# Zz‡j w`‡Z n‡e)
Line : 388 alias_database = hash:/etc/aliases (# Zz‡j w`‡Z n‡e bv)
Line : 388 #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases (# Zz‡j w`‡Z n‡e)
Line : 410 #home_maildox = maildir/ (# Zz‡j w`‡Z n‡e)
Line : 417 #mail_spool_directory = /var/spool/directory
Line : 536 #heaer_cheeks = regexp: /etc/postfix/header_checks (# Zz‡j w`‡Z n‡e)
Line : 549 #fast_flush_domains = $relay_domains
[root@mail ~]# /etc/init.d/postfix restart;chkconfig postfix on
FOR other tutoila
https://www.youtube.com/watch?v=Hn58eLyDfCc
Web address:
http://wiki.freepbx.org/display/HTGS/Installing+FreePBX+
13+on+Debian+8.1
HOW TO INSTALL ASTERISK + FREE PBX 13 ON
DEBIAN 8.1
1. After install debian 8.1 for SSH root permission
sed -i 's/PermitRootLogin without-password/PermitRootLogin
yes/' /etc/sshd/sshd_config
service sshd restart
2. Update Your System
apt-get update && apt-get upgrade –y
3. Install Required Dependencies
apt-get install -y build-essential linux-headers-`uname -r` openssh-
server apache2 mysql-server\
mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear
php5-gd curl sox\
libncurses5-dev libssl-dev libmysqlclient-dev mpg123 libxml2-dev
libnewt-dev sqlite3\
libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev
uuid uuid-dev\
libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev
libneon27-dev libsrtp0-dev\
libspandsp-dev sudo
reboot
4. Install Legacy pear requirements
pear install Console_Getopt
5. Install iksemel
cd /usr/src
wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
tar xf iksemel-1.4.tar.gz
cd iksemel-*
./configure
make
make install
ldconfig
6. Install and Configure Asterisk
cd /usr/src
wget
http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-
linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-
current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-
current.tar.gz
wget -O jansson.tar.gz
https://github.com/akheron/jansson/archive/v2.7.tar.gz
wget http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2
7. Compile and install DAHDI.
cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
rm -f dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install
make config
cd /usr/src
tar xvfz libpri-1.4-current.tar.gz
rm -f libpri-1.4-current.tar.gz
cd libpri-*
make
make install
8. Compile and install pjproject
cd /usr/src
tar -xjvf pjproject-2.4.tar.bz2
rm -f pjproject-2.4.tar.bz2
cd pjproject-2.4
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --enable-shared --disable-sound --disable-
resample --disable-video --disable-opencore-amr
make dep
make
make install
9. Compile and Install jansson
cd /usr/src
tar vxfz jansson.tar.gz
rm -f jansson.tar.gz
cd jansson-*
autoreconf -i
./configure
make
make install
10. Compile and install Asterisk
cd /usr/src
tar xvfz asterisk-13-current.tar.gz
rm -f asterisk-13-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install
./configure
contrib/scripts/get_mp3_source.sh
make menuselect
make
make install
make config
ldconfig
update-rc.d -f asterisk remove
11. Install Asterisk Soundfiles.
cd /var/lib/asterisk/sounds
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-extra-
sounds-en-wav-current.tar.gz
tar xvf asterisk-core-sounds-en-wav-current.tar.gz
rm -f asterisk-core-sounds-en-wav-current.tar.gz
tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
rm -f asterisk-extra-sounds-en-wav-current.tar.gz
# Wideband Audio download
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-
sounds-en-g722-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-
sounds-en-g722-current.tar.gz
tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
rm -f asterisk-extra-sounds-en-g722-current.tar.gz
tar xfz asterisk-core-sounds-en-g722-current.tar.gz
rm -f asterisk-core-sounds-en-g722-current.tar.gz
12. Install and Configure FreePBX
A. Create the Asterisk user and set base file permissions.
useradd -m asterisk
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
rm -rf /var/www/html
B. A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\
120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
sed -i 's/AllowOverride None/AllowOverride
All/' /etc/apache2/apache2.conf
service apache2 restart
13. Download and install FreePBX.
cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-
latest.tgz
tar vxfz freepbx-13.0-latest.tgz
rm -f freepbx-13.0-latest.tgz
cd freepbx
./start_asterisk start
./install -n
https://amatijasec.wordpress.com/2015/07/17/otrs-help-desk-4-0-10-how-to-
install-on-debian-8-1-part-12/
How to insall ZOHO servicedesk manageengine plus
apt-get update && upgrade -y
apt-get install -y build-essential linux-headers-`uname -r` bison flex php5-curl php5-cli
php5-mysql php-pear php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient-dev
mpg123 libxml2-dev libnewt-dev sqlite3 chkconfig
apt-get install -y libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev
uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-
dev libneon27-dev libsrtp0-dev libspandsp-dev sudo
reboot
pear install Console_Getopt
#chmod +xManageEngine_ServiceDesk_Plus_x_Linux.bin
./ManageEngine_ServiceDesk_Plus.bin –console
Touch servicedesk.txt
Chmod +x servicedesk.txt
Cp /etc/init.d/servicedesk
Vim servicedesk
__ ADD THIS SCRIPT
#!/bin/bash
#
# Startup script for the pmagent
#
# chkconfig: 345 99 02
# description: Run the ServiceDesk-Plus program
INITLOG_ARGS=""
prog="servicedesk"
progname="AdventNet ManageEngine ServiceDesk-Plus"
RETVAL=0
# Edit the following to indicate the 'bin' directory for your installation
MDIR=/home/guest/servicedesk/AdventNet/ME/ServiceDesk/bin
if [ ! -d "$MDIR" ]
then
echo "Invalid directory $MDIR"
exit 1
fi
start()
{
mv -f /var/log/servicedesk-plus.log /var/log/servicedesk-plus1.log
echo "Starting $progname"
cd $MDIR
nohup sh run.sh >/var/log/servicedesk-plus.log 2>&1 &
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/servicedesk
}
stop()
{
echo "Stopping $progname"
cd $MDIR
sh shutdown.sh -S >>/var/log/servicedesk-plus.log 2>&1
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $prog {start|stop}"
exit 1
;;
esac
exit $RETVAL
NOTE: from servicedesk :
MDIR=/home/guest/servicedesk/AdventNet/ME/ServiceDesk/bin
(Installtion Location)
chmod 755 /etc/init.d/servicedesk
touch /var/log/servicedesk-plus.log
chkconfig --add servicedesk1
cd /root/ManageEngine/ServiceDesk/bin
./run.sh
HOW TO Debian join windows domain
I use:
Debian squeeze
samba 2:3.2.5-4l
winbind 2:3.2.5-4l
krb5-config 1.22
krb5-user 1.6.dfsg.4
192.168.11.100 – is my Windows AD Server (Windows Server 2003)
192.168.11.200 – Debian server
REDIRECTOR.NAME – is my domain
1. Install software
Apt-get install install samba winbind ntpdate ntp krb5*
2. Service stop
/etc/init.d/samba stop
/etc/init.d/winbind stop
/etc/init.d/ntp stop
3. Configure Kerberos
Vim /etc/krb5.conf
/*
[libdefaults]
default_realm = REDIRECTOR.NAME
# The following krb5.conf variables are only for MIT Kerberos.
krb4_config = /etc/krb.conf
krb4_realms = /etc/krb.realms
kdc_timesync = 1
ccache_type = 4
forwardable = true
proxiable = true
# The following encryption type specification will be used by MIT Kerberos
# if uncommented. In general, the defaults in the MIT Kerberos code are
# correct and overriding these specifications only serves to disable new
# encryption types as they are added, creating interoperability problems.
#
# Thie only time when you might need to uncomment these lines and change
# the enctypes is if you have local software that will break on ticket
# caches containing ticket encryption types it doesn't know about (such as
# old versions of Sun Java).
# default_tgs_enctypes = des3-hmac-sha1
# default_tkt_enctypes = des3-hmac-sha1
# permitted_enctypes = des3-hmac-sha1
# The following libdefaults parameters are only for Heimdal Kerberos.
v4_instance_resolve = false
v4_name_convert = {
host = {
rcmd = host
ftp = ftp
}
plain = {
something = something-else
}
}
fcc-mit-ticketflags = true
dns_lookup_realm = false
dns_lookup_kdc = false
[realms]
REDIRECTOR.NAME = {
kdc = 192.168.11.100:88
admin_server = 192.168.11.100
}
[domain_realm]
.redirector.name = REDIRECTOR.NAME
redirector.name = REDIRECTOR.NAME
[login]
krb4_convert = true
krb4_get_tickets = false
*/
4. Configure NTP
ntpdate 192.168.11.100
/etc/init.d/ntp stop
/etc/ntp.conf
/*
# Our primary DC
server 192.168.11.100
/*
/etc/init.d/ntp start
5. Configure DNS resolution
Vim /etc/resolv.conf
/*
nameserver 192.168.11.100
*/
6. Configure Winbind
Vim /etc/samba/smb.conf
/*
# Global parameters
[global]
workgroup = REDIRECTOR
realm = REDIRECTOR.NAME
server string = %h server (Samba %v)
load printers = no
security = ads
local master = no
domain master = no
preferred master = no
wins server = 192.168.11.100
dns proxy = no
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind use default domain = yes
interfaces = eth0 lo
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d
invalid users = root
template homedir = /home/%D/%U
template shell = /bin/bash
winbind offline logon = yes
winbind refresh tickets = yes
*/
7. Configure Nsswitch
Vim /etc/nsswitch.conf
/*
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat winbind
group: compat winbind
shadow: compat
hosts: files dns wins
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
*/
ldconfig
8. Join the Domain
net ads join -U Administrator
9. Edit PAM settings
/*
vim /etc/pam.d/common-account
# should contain the following
lines:
account sufficient pam_winbind.so
account required pam_unix.so
1 vim /etc/pam.d/common-auth
2 # should contain the following
3 lines:
4 auth sufficient
pam_unix.so
auth required
pam_winbind.so use_first_pass
1 vim /etc/pam.d/common-password
2 # should be similar to the one
3 shown below:
password required pam_unix.so
nullok obscure min=4 max=50 md5
1 vim /etc/pam.d/common-session
2 # file contains the following
3 line:
session required
pam_mkhomedir.so umask=0022
skel=/etc/skel
*/
10. Restart these services in order
/etc/init.d/samba stop
/etc/init.d/winbind stop
/etc/init.d/samba start
/etc/init.d/winbind start
11. Verify
wbinfo –u
wbinfo -g.
net ads status
net ads leave -U Administrator