Installing Directadmin : The Manual Way
#
# Directadmin installation - Alak
#
screen
rm -f /usr/lib/libexpat.so
ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so
# Make /da directory as installation dir
#
mkdir /da
cd /da
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
UID:
LID:
FQDN:
# Apache choose option 2
# with default configs for apache 2.2 and php5 cli
# then wait till like 15 minutes (seriously wor..)
#
# Del existing mysql? YES
#
# after installation complete perform Auto updater in DirectAdmin
#
mkdir -p /usr/local/updatescript
cd /usr/local/updatescript
wget http://tools.web4host.net/update.script
chmod 755 update.script
./update.script DATE * not neseccary
./update.script UPDATEME
./update.script CLAMAV
# then, again, wait.. the script do its thingy..
# Next, to configure spams stuff..
#
vi /etc/exim.conf
# before primary_hostname =
# add
av_scanner = clamd:/tmp/clamd
# after check_message:
# WARNING! NOT acl_smtp_data = check_message
# NOTE! BEFORE the 'accept' line.
# add
deny message = This message contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This message contains a virus or other harmful content ($malware_name)
demime = *
malware = *
deny message = This message contains an attachment of a type which we do not accept (.$found_extension)
demime = bat:com:pif:prf:scr:vbs
warn message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus
# check for spam assassin
# delete the # become
# Spam Assassin
spamcheck_director:
driver = accept
condition = "${if and { \
{!def:h_X-Spam-Flag:} \
{!eq {$received_protocol}{spam-scanned}} \
{!eq {$received_protocol}{local}} \
{exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
{<{$message_size}{100k}} \
} {1}{0}}"
retry_use_local_part
transport = spamcheck
no_verify
- start with line 321
# Note: IF using vi, the just ESC : 321 ENTER
# NOTE! Its just after the # to restrict port 587 to authenticated users only settings..
#
#***************************************
#**# RBL List Begin
#***************************************
#
# Always accept mail to postmaster & abuse for any local domain
#
accept domains = +local_domains
local_parts = postmaster:abuse
#
# Check sending hosts against DNS black lists.
# Accept all locally generated messages
# Reject message if address listed in blacklist.
deny message = Message rejected because $sender_fullhost is blacklisted at $dnslist_domain see $dnslist_text :
!hosts = +relay_hosts
!authenticated = *
!dnslists = whitelist.ipserverone.com
#dnslists = bl.spamcop.net : sbl.spamhaus.org : dnsbl-1.uceprotect.net : dhcp.tqmcube.com : spam.tqmcube.com : no-more-funn.moensted.dk : cbl.abuseat.org
dnslists = bl.spamcop.net : zen.spamhaus.org
# dnslists = bl.spamcop.net : sbl.spamhaus.org : dnsbl-1.uceprotect.net
# RBL Bypass Local Domain List
# RBL Whitelist incoming hosts
#***************************************
#**# RBL List End
#***************************************
# after editing exim.conf then
#
cd /usr/local/directadmin/scripts
./spam.sh
*
If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)
* NO
# NOTE! There will be few question after that, use loic lor..
# Then finish that time, not sure needs to start spamd or not,
#
/usr/bin/spamd -d -c -m 15
# Next, update the spamd
#
sa-update -D
# (spam assassin update) until here
# Will get error as cannot find LWP:: thingy, error like:
# [root@ifinteractive scripts]# sa-update -D
# Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/lib/per....failed--compilation aborted at /usr/bin/sa-update line 79.
# To fix:
#
perl -MCPAN -e shell
cpan> install LWP::UserAgent (because it can't locate it)
install Archive::Tar
install NetAddr::IP
install Mail::SPF
install Mail::SPF::Query ****
install IP::Country::Fast
force install Net::Ident
install IO::Socket::INET6
install Mail::DomainKeys **
install Mail::DKIM **
install Encode::Detect
# Update again (verify)
# if exit with code o, means OKie oredi :D
#
sa-update -D
# Done with PERL
# Now Spam Assasin Razor
#
cd /da
wget http://www.ipfusions.com/setup/razor.tar.bz2
tar xvfj razor.tar.bz2
cd razor-agents-2.84/
perl Makefile.PL
make
make install
# Good! Next Directadmin .pem keys and settings
#
cd /usr/local/directadmin/conf/
scp root@ns40:/usr/local/directadmin/conf/ca*pem .
chown diradmin:diradmin *pem
vi directadmin.conf - SSL=1
/etc/init.d/directadmin restart
# Success! hoyeah! o//
# Next, configure apache
#
cd /etc/httpd/conf
vi httpd.conf
# copy script from apache config.txt (replace the ip and dns)
#
cd /usr/local/directadmin/data/templates/custom/
scp root@ns40:/usr/local/directadmin/data/templates/custom/* .
chown diradmin:diradmin *
/etc/init.d/httpd restart or service httpd restart
# edit named.db template
# The 14400 need to change to 3600
#
vi /usr/local/directadmin/data/templates/named.db
# install zend optimizer
#
cd /usr/local/directadmin/custombuild
vi options.conf (zend = yes)
./build zend
# to verify :
/usr/local/bin/php -v
# Done! Now have to rebuild PHP wor..
#
build
- cd /usr/local/directadmin/custombuild/configure/ap2
- vi configure.php5
add in
--enable-pdo \
--with-pdo-mysql=/usr \
--enable-exif \
--without-pdo-sqlist \
--with-imap=/usr \
--with-imap-ssl=/usr \
--disable-postfix \
--enable-exif
- yum install libc-client libc-client-devel -y
- cd /usr/local/directadmin/custombuild
- ./build php -y
# Good! now copy my.cnf
# OR MAYBE no need.. but i just put it here
# you can skip this
cd /usr/local/lib
scp root@ns40:/usr/local/lib/php.ini . (or ns38)
cd /etc/
scp root@ns44:/etc/my.cnf . (or ns38)
# Next Squirelmail
#
- cd /var/www/html
- rm -Rf squirrelmail* roundcube* webmail*
wget http://ipfusions.com/setup/webmail.tar.gz
tar xvfz webmail.tar.gz
rm webmail.tar.gz
ln -s squirrelmail webmail
ln -s squirrelmail roundcube
vi /var/www/html/webmail/src/login.php (search for Change password and change it to dns that intented)
# Cun! almost there! :D~
# Now change SSH default port
#
- vi /etc/ssh/shhd_config (port xxx)
- /etc/init.d/sshd restart
# Next, create redirection
#
cd /var/www/html
mkdir cp
cd cp/
vi index.php
--> $lt;? header("Location: https://$lt;IP or Domain$gt;:2222"); ?$gt;
# WAHHHHH!! XD~ Almost finish!!
# Now last step!
# Firewall
#
/sbin/chkconfig --level 3 iptables off
/etc/init.d/iptables stop
cd /sbin
scp root@52:/sbin/fwup .
/sbin/fwup
visudo
adduser saport
passwd saport
visudo *
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
vi /etc/rc.d/rc.local
ADD --> /sbin/fwup
# DONE! :D~
#
Kudos: cllee kclee hmlee jwchai
//alak
# Directadmin installation - Alak
#
screen
rm -f /usr/lib/libexpat.so
ln -s /usr/lib64/libexpat.so /usr/lib/libexpat.so
# Make /da directory as installation dir
#
mkdir /da
cd /da
wget http://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh
UID:
LID:
FQDN:
# Apache choose option 2
# with default configs for apache 2.2 and php5 cli
# then wait till like 15 minutes (seriously wor..)
#
# Del existing mysql? YES
#
# after installation complete perform Auto updater in DirectAdmin
#
mkdir -p /usr/local/updatescript
cd /usr/local/updatescript
wget http://tools.web4host.net/update.script
chmod 755 update.script
./update.script DATE * not neseccary
./update.script UPDATEME
./update.script CLAMAV
# then, again, wait.. the script do its thingy..
# Next, to configure spams stuff..
#
vi /etc/exim.conf
# before primary_hostname =
# add
av_scanner = clamd:/tmp/clamd
# after check_message:
# WARNING! NOT acl_smtp_data = check_message
# NOTE! BEFORE the 'accept' line.
# add
deny message = This message contains malformed MIME ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
deny message = This message contains a virus or other harmful content ($malware_name)
demime = *
malware = *
deny message = This message contains an attachment of a type which we do not accept (.$found_extension)
demime = bat:com:pif:prf:scr:vbs
warn message = X-Antivirus-Scanner: Clean mail though you should still use an Antivirus
# check for spam assassin
# delete the # become
# Spam Assassin
spamcheck_director:
driver = accept
condition = "${if and { \
{!def:h_X-Spam-Flag:} \
{!eq {$received_protocol}{spam-scanned}} \
{!eq {$received_protocol}{local}} \
{exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
{<{$message_size}{100k}} \
} {1}{0}}"
retry_use_local_part
transport = spamcheck
no_verify
- start with line 321
# Note: IF using vi, the just ESC : 321 ENTER
# NOTE! Its just after the # to restrict port 587 to authenticated users only settings..
#
#***************************************
#**# RBL List Begin
#***************************************
#
# Always accept mail to postmaster & abuse for any local domain
#
accept domains = +local_domains
local_parts = postmaster:abuse
#
# Check sending hosts against DNS black lists.
# Accept all locally generated messages
# Reject message if address listed in blacklist.
deny message = Message rejected because $sender_fullhost is blacklisted at $dnslist_domain see $dnslist_text :
!hosts = +relay_hosts
!authenticated = *
!dnslists = whitelist.ipserverone.com
#dnslists = bl.spamcop.net : sbl.spamhaus.org : dnsbl-1.uceprotect.net : dhcp.tqmcube.com : spam.tqmcube.com : no-more-funn.moensted.dk : cbl.abuseat.org
dnslists = bl.spamcop.net : zen.spamhaus.org
# dnslists = bl.spamcop.net : sbl.spamhaus.org : dnsbl-1.uceprotect.net
# RBL Bypass Local Domain List
# RBL Whitelist incoming hosts
#***************************************
#**# RBL List End
#***************************************
# after editing exim.conf then
#
cd /usr/local/directadmin/scripts
./spam.sh
*
If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)
* NO
# NOTE! There will be few question after that, use loic lor..
# Then finish that time, not sure needs to start spamd or not,
#
/usr/bin/spamd -d -c -m 15
# Next, update the spamd
#
sa-update -D
# (spam assassin update) until here
# Will get error as cannot find LWP:: thingy, error like:
# [root@ifinteractive scripts]# sa-update -D
# Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/lib/per....failed--compilation aborted at /usr/bin/sa-update line 79.
# To fix:
#
perl -MCPAN -e shell
cpan> install LWP::UserAgent (because it can't locate it)
install Archive::Tar
install NetAddr::IP
install Mail::SPF
install Mail::SPF::Query ****
install IP::Country::Fast
force install Net::Ident
install IO::Socket::INET6
install Mail::DomainKeys **
install Mail::DKIM **
install Encode::Detect
# Update again (verify)
# if exit with code o, means OKie oredi :D
#
sa-update -D
# Done with PERL
# Now Spam Assasin Razor
#
cd /da
wget http://www.ipfusions.com/setup/razor.tar.bz2
tar xvfj razor.tar.bz2
cd razor-agents-2.84/
perl Makefile.PL
make
make install
# Good! Next Directadmin .pem keys and settings
#
cd /usr/local/directadmin/conf/
scp root@ns40:/usr/local/directadmin/conf/ca*pem .
chown diradmin:diradmin *pem
vi directadmin.conf - SSL=1
/etc/init.d/directadmin restart
# Success! hoyeah! o//
# Next, configure apache
#
cd /etc/httpd/conf
vi httpd.conf
# copy script from apache config.txt (replace the ip and dns)
#
cd /usr/local/directadmin/data/templates/custom/
scp root@ns40:/usr/local/directadmin/data/templates/custom/* .
chown diradmin:diradmin *
/etc/init.d/httpd restart or service httpd restart
# edit named.db template
# The 14400 need to change to 3600
#
vi /usr/local/directadmin/data/templates/named.db
# install zend optimizer
#
cd /usr/local/directadmin/custombuild
vi options.conf (zend = yes)
./build zend
# to verify :
/usr/local/bin/php -v
# Done! Now have to rebuild PHP wor..
#
build
- cd /usr/local/directadmin/custombuild/configure/ap2
- vi configure.php5
add in
--enable-pdo \
--with-pdo-mysql=/usr \
--enable-exif \
--without-pdo-sqlist \
--with-imap=/usr \
--with-imap-ssl=/usr \
--disable-postfix \
--enable-exif
- yum install libc-client libc-client-devel -y
- cd /usr/local/directadmin/custombuild
- ./build php -y
# Good! now copy my.cnf
# OR MAYBE no need.. but i just put it here
# you can skip this
cd /usr/local/lib
scp root@ns40:/usr/local/lib/php.ini . (or ns38)
cd /etc/
scp root@ns44:/etc/my.cnf . (or ns38)
# Next Squirelmail
#
- cd /var/www/html
- rm -Rf squirrelmail* roundcube* webmail*
wget http://ipfusions.com/setup/webmail.tar.gz
tar xvfz webmail.tar.gz
rm webmail.tar.gz
ln -s squirrelmail webmail
ln -s squirrelmail roundcube
vi /var/www/html/webmail/src/login.php (search for Change password and change it to dns that intented)
# Cun! almost there! :D~
# Now change SSH default port
#
- vi /etc/ssh/shhd_config (port xxx)
- /etc/init.d/sshd restart
# Next, create redirection
#
cd /var/www/html
mkdir cp
cd cp/
vi index.php
--> $lt;? header("Location: https://$lt;IP or Domain$gt;:2222"); ?$gt;
# WAHHHHH!! XD~ Almost finish!!
# Now last step!
# Firewall
#
/sbin/chkconfig --level 3 iptables off
/etc/init.d/iptables stop
cd /sbin
scp root@52:/sbin/fwup .
/sbin/fwup
visudo
adduser saport
passwd saport
visudo *
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
vi /etc/rc.d/rc.local
ADD --> /sbin/fwup
# DONE! :D~
#
Kudos: cllee kclee hmlee jwchai
//alak
Sedebbb,,,, bagusnih untuk koleksi..
ReplyDeleteSalam kenal mas.
shit blog ko dapat visit hakas!
ReplyDeletebtw dah gune screen nampak? ;p
teng, screen dowh.. dah penah kene skali.. haha..
ReplyDeleteer.. salam pekenalan.. :)