This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
1
Tomcat / Re: apache tomcat connector
« on: April 22, 2018, 08:20:11 AM »
you can use apache mod_proxy
in tomcat configuration
Code: [Select]
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
Code: [Select]
<VirtualHost x.x.x.x:80>
ServerName [servername]
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://[IP]:8080/
ProxyPassReverse / http://[IP]:8080/
</VirtualHost>
in tomcat configuration
Code: [Select]
<Host name="[domain]" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="[path]" reloadable="true" override="true"/>
</Host>
4
Backup / Backup to S3 or remote server daily job
« on: April 15, 2018, 05:11:38 PM »
1. Install & Configure AWS CLI https://docs.aws.amazon.com/cli/latest/userguide/installing.html
2.You can comment at /etc/cron.daily/cwp
3. New bash file like as /scripts/full_backup with content
OS Centos 7
PHP version 7.1
if any problem you can contact me:
skype: trongkhoa1505
email: trongkhoa1103@gmail.com or khoabidihost@gmail.com
2.You can comment at /etc/cron.daily/cwp
Code: [Select]
#/usr/local/cwp/php71/bin/php -d max_execution_time=1000000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php
3. New bash file like as /scripts/full_backup with content
Code: [Select]
#!/bin/bash
#
# BACKUP SCRIPT FOR USER FILES AND MYSQL DATABASES
# email: trongkhoa1103@gmail.com
#
#
MYSQLPWD=`grep password= /root/.my.cnf|awk -F= {'print $2'}`
QUERYCODE="select username from root_cwp.user where backup='on'"
# MySQL Backup
for i in `mysql --skip-column-names -uroot -p"$MYSQLPWD" -e "$QUERYCODE" -B`; do echo "$i"|sh /scripts/user_backup_s3 $i;done
4.create /scripts/user_backup_s3Code: [Select]
#!/bin/bash
#
# BACKUP SCRIPT FOR USER FILES AND MYSQL DATABASES
# trongkhoa1103@gmail.com
#
#
USERNAME=$1
BKPDATE=`date +%Y%m%d`
GETHOMEDIR="/backups"
GETUSERHOMEDIR=`grep $USERNAME /etc/passwd|awk -F: {'print $6'}`
QUERYCODE="show databases like \""$USERNAME"_%\""
MYSQLPWD=`grep password= /root/.my.cnf|awk -F= {'print $2'}`
if [ ! -e "$GETHOMEDIR/daily" ];then
mkdir -p "$GETHOMEDIR"/daily
fi
if [ ! -e "$GETHOMEDIR/mysql" ];then
mkdir -p "$GETHOMEDIR"/mysql
fi
# MySQL Backup
for i in `mysql --skip-column-names -uroot -p"$MYSQLPWD" -e "$QUERYCODE" -B`; do mysqldump -uroot -p"$MYSQLPWD" $i | gzip > "$GETHOMEDIR/mysql/$BKPDATE_$i".sql.gz;done
# move to S3
aws s3 mv $GETHOMEDIR/mysql/*.* s3://[bucketname]/[path]
# Files Backup
su -c "cd $GETUSERHOMEDIR;tar -pczf $GETHOMEDIR/daily/"$BKPDATE"_"$USERNAME".tar.gz * --exclude 'backups'" -s "/bin/bash"
# move to S3
aws s3 mv $GETHOMEDIR/daily/*.* s3://[bucketname]/[path]
4. Create Cron job at 00:30 or anytime you wantCode: [Select]
30 0 * * * /usr/bin/sh /scripts/full_backup >/dev/null 2>&1
My enviroment:OS Centos 7
PHP version 7.1
if any problem you can contact me:
skype: trongkhoa1505
email: trongkhoa1103@gmail.com or khoabidihost@gmail.com
5
Backup / Re: backup to compressed file
« on: November 28, 2017, 01:40:53 PM »
where is the script file.
I'll write for you!
I'll write for you!
Pages: [1]