Thursday, August 25, 2011

DirectAdmin use port 80

1. create a da.ns64.small-dns.net account first, enable SSL, use private_html

2. add /usr/local/directadmin/data/users/dans72/http.conf
        SSLProxyEngine ON
        ProxyRequests Off
        ProxyPass / https://localhost:2222/
        ProxyPassReverse / https://localhost:2222/

3. vi /usr/local/directadmin/conf/directadmin.conf
check_referer=0

4. restart apache

MYSQL

restor SQL

To check admin password:
cat /usr/local/directadmin/conf/mysql.conf

Restore mySQL:
mysql -u da_admin -p -v -D bryanlyt_wrdp2 < ./bryanlyt_wrdp2.sql




backup SQL
mysqldump -u user01 -p -Q --disable --extended-insert database01 > filename.sql

restore SQL
mysql -u username -p database_name < filename.sql



MySQL grant permission
1. login as da_admin
2. use mysql;
3. select super_priv from user where user='webmanfb_wfb'; (to check privilege)
3. update user set super_priv='y' WHERE user='webmanfb_wfb'; (grant privilege)
4. flush privileges;

install php SOAP

mkdir /usr/local/directadmin/custombuild/custom
mkdir /usr/local/directadmin/custombuild/custom/ap2
cp /usr/local/directadmin/custombuild/configure/ap2/configure.php5 /usr/local/directadmin/custombuild/custom/ap2/configure.php5

Edit ./custom/ap2/configure.php5 and add --enable-soap to the file, using the same \ syntax as you see in the file. Save it, ./build php and it worked perfectly.

install 'i DBD::mysql

*** using perl
http://help.directadmin.com/item.php?id=49

This line should be good:
perl -MCPAN -e 'install Bundle::DBD::mysql'



***** from source
wget http://www.cpan.org/modules/by-module/DBD/DBI-1.608.tar.gz
tar xvzf DBI-1.608.tar.gz
cd DBI-1.608
unset LANG;
perl Makefile.PL
make
make install

cd ..
wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-3.0002.tar.gz
tar xvzf DBD-mysql-3.0002.tar.gz
cd DBD-mysql-3.0002
unset LANG;
perl Makefile.PL
make
make install

rsync example

nice -n10 rsync --verbose --group --owner  --progress --stats --recursive --times --perms --links /home/eagroup/ /home2/eagroup

mv /home/eagroup  /home/eagroup_bak
ln -s /home2/eagroup /home/eagroup


***********
TEST
1. eamil
2. web
3. FTP

If ok, rm -Rf /home/eagroup_bak


run at ns16

nice -n10 rsync --verbose --group --owner --progress --stats --recursive --times --perms --links --bwlimit=1024 --rsh="/usr/bin/ssh -l root -p 9321" -p 9321 /home/bernamatv/imap/bernama-tv.com root@210.5.45.153:/home/bernamatv/imap/bernama-tv.com/

Retrieve DirectAdmin Passowrd

vi /etc/shadow

do a backup before change