Posts

How to owncloud 9 install ssl certificate centos 7

Image
How to owncloud 9 install ssl certificate centos 7. in the previous, how to install owncloud 9 in centos 7 To install  mod SSL #yum install mod_ssl To create new certificate #mkdir /etc/httpd/ssl #openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/owncloud.key -out /etc/httpd/ssl/owncloud.pem Adjusting /etc/httpd/conf.d/owncloud.conf file <VirtualHost *:80>     DocumentRoot /var/www/html/owncloud/     Redirect permanent / https://172.16.235.145/     <Directory /var/www/html/owncloud>         Options FollowSymLinks MultiViews         AllowOverride ALL         Order allow,deny         allow from all     </Directory> </VirtualHost> <VirtualHost *:443>     SSLEngine on     SSLCertificateFile /etc/httpd/ssl/owncloud.pem     SSLCertificateKeyFile /etc/httpd/ssl/owncloud.key     DocumentRoot /var/www/html/owncloud/     <Directory /var/www/html/owncloud>         Options FollowSymLinks MultiViews    

How to install owncloud 9 centos 7

Image
How to install owncloud 9 on centos 7. I'm use bash script to install owncloud 9 on centos 7. Links to below you maybe likes: How to install php7 on centos 6 How to install and configure redmine on centos 6 How to owncloud 9 install ssl certificate centos 7 How To Install the BIND DNS Server on CentOS 6 KeepAlived IP Failover on CentOS & Red Hat #!/bin/bash #Full Name: Phan Van Huu #My Blog: www.huuphan.com #How to install owncloud 9 centos 7 #To update centos 7 echo -e "Updating pack for centos 7\n" yum install -y vim wget yum -y update #To install Mariadb server for centos 7 echo -e "Installing MariaDB server for centos 7\n" yum install -y mariadb-server systemctl enable mariadb systemctl start mariadb #To set password root for MariaDB server echo -e "To set password root for MariaDB server\n" mysqld_safe --skip-grant-tables --skip-networking & 1>/dev/null mysql -u root -e 'FLUSH PRIVILEGES;' mysql -u root -e

How to Manage Mailbox Folder using zmmailbox command in Zimbra

Image
How to Manage Mailbox Folder using zmmailbox command in Zimbra. zmmailbox command for mailbox manager. It's useful for admin. in this post will brief how to get all folder, empty, delete subfolder/folder in zimbra. How to get all folder using zmmailbox command. [zimbra@mail ~]$ zmmailbox -z -m  [email protected] gaf The output:         Id  View      Unread   Msg Count  Path ----------  ----  ----------  ----------  ----------          1  unkn           0           0  /         16  docu           0           0  /Briefcase         10  appo           0           0  /Calendar         14  mess           0           0  /Chats          7  cont           0           0  /Contacts          6  mess           0           0  /Drafts         13  cont           0           3  /Emailed Contacts          2  mess           8          11  /Inbox         320  mess           0           0  /Inbox/New_Sub_folder          4  mess           0           0  /Junk        321  mess 

How to check zimbra account status

Image
How to check zimbra account status? How to know zimbra account status pending. How to know zimbra account status active, closed, locked, maintenance. In my post, one bash script get all zimbra account status and zmaccts commands another. Links to below you maybe likes: zimbra custom spamassassin rules How to create auto Bcc for Recipient mails for Zimbra 8.6 How to add spam filters on zimbra 8.6 How to create auto Bcc for sender mails for Zimbra 8.6 list accounts that has not logged in for the last x days in zimbra Method 1: To bash script use zimbra ldap check zimbra account status. #!/bin/bash # sed ':a;N;$!ba;s/\n/ /g' file : command line # :a create a label 'a' # N append the next line to the pattern space # $! if not the last line, ba branch (go to) label 'a' # s substitute, /\n/ regex for new line, / / by a space, /g global match (as many times as it can) # sed will loop through step 1 to 3 until it reach the last line, getting all l

How to running cron job every 5 minutes,seconds,hours,days

Image
How to running cron job every 5 minutes,seconds,hours,days. How to running a script a specific interval using cronjob in linux.  To execute a cronjob every 5 minutes */5 * * * * /home/huupv/script.sh To execute a cronjob every 5 hours 0 */5 * * * /home/huupv/script.sh How to running a job every 5 seconds $ cat every-5-seconds.sh #!/bin/bash while true do  /home/huupv/script.sh  sleep 5 done $ nohup ./every-5-seconds.sh & To execute a cronjob every 5th weekday 0 0 * * 5 /home/huupv/script.sh or 0 0 * * Fri /home/huupv/script.sh 0=Sun 1=Mon 2=Tue 3=Wed 4=Thu 5=Fri 6=Sat

How to edit Undelivered Mail Returned to Sender on zimbra

Image
How to edit  The failure template is used when mail is returned to the sender, How to edit Undelivered Mail Returned to Sender. Links to below you maybe likes: zimbra custom spamassassin rules How to create auto Bcc for Recipient mails for Zimbra 8.6 How to add spam filters on zimbra 8.6 How to create auto Bcc for sender mails for Zimbra 8.6 list accounts that has not logged in for the last x days in zimbra The below command to login as zimbra user. To check bounce_template_file. $postconf |grep bounce_template_file To copy bounce.cf.default to bounce.cf $cd /opt/zimbra/postfix-2.11.1.2z/conf $cp bounce.cf.default bounce.cf To configure bounce.cf file $postconf -e bounce_template_file="/opt/zimbra/postfix-2.11.1.2z/conf/bounce.cf" $postconf |grep bounce_template_file To check bounce.cf file $postconf -b bounce.cf The content of bounce.cf file $cat bounce.cf To edit message red highlighted as below # # Do not edit this file. This file shows the default

How To Install CBPolicyd on Zimbra 8.6

Image
Step 1: To active cbpolicyd on zimbra 8.6 $su - zimbra $zmprov ms `zmhostname` +zimbraServiceInstalled cbpolicyd +zimbraServiceEnabled cbpolicyd Step 2: To acctive cbpolicyd webui cd /opt/zimbra/httpd/htdocs/ && ln -s ../../cbpolicyd/share/webui vim /opt/zimbra/cbpolicyd/share/webui/includes/config.php To add " $DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb ";" in config.php file. The ouput: #$DB_DSN="mysql:host=localhost;dbname=cluebringer"; $DB_DSN="sqlite:/opt/zimbra/data/cbpolicyd/db/cbpolicyd.sqlitedb"; $DB_USER="root"; #$DB_PASS=""; $DB_TABLE_PREFIX=""; Step 3: To restart services su - zimbra -c "zmcontrol restart" su - zimbra -c "zmapachectl restart" Step 4: To access cbpolicyd webui. http://IP-OF-Zimbra:7780/webui/index.php

How to install and configure zimbra proxy HA

Image
When you create multi server, and you want to deploy zimbra proxy in DMZ. To use zimbra proxy HA, then you use keepalived use VIP. Many other solution. Lab environment Server Mail Proxy 01 IP:  192.168.10.10 VIP:  192.168.30.30 DNS Name: proxy01.huuphan.com zimbra_server_hostname: mail.huuphan.com Server Mail Proxy 02 IP:  192.168.20.20 VIP:  192.168.30.30 DNS Name: proxy02.huuphan.com zimbra_server_hostname: mail.huuphan.com Step 1: To instal keepalived #yum update -y #yum install -y keepalived Step 2: To configure keepalived  To refer install and configure keepalived  Zimbra proxy01 Master Server global_defs {   notification_email {     [email protected]   }   notification_email_from [email protected]     smtp_server mbx.huuphan.com # mbx.huuphan.com mailstore     smtp_connect_timeout 30 } vrrp_script chk_nginx_service {     script "killall -0 nginx"     interval 3 } vrrp_instance VI_1 {     interface eth0     state MA

How to ssh tunnel in linux

Image
How to ssh port forwarding ( ssh tunneling) in linux. For example, Client [localhost:10000] ---> Server 1 [port:1111]----->Server 2 [port:22] Server 1 ip address: 192.168.1.12 port: 1111 Server 2 ip address: 192.168.1.13 port: 22 From client, how to login ssh to Server2 via Server1. ssh -p 1111 -f [email protected] -L 10000:[email protected]:22  -N ssh -p 10000 root@localhost From client, how to copy files to Server2? scp -r -P 10000 /path/to/file root@localhost:/path/to/folder

Script to prepare necessary package for install zimbra 8.6

Image
Script to prepare necessary package for install zimbra 8.6 #!/bin/bash #Author: Phan Van Huu #Blog: huuphan.com RED='\033[0;31m' BLUE='\033[0;34m' NC='\033[0m' #No color ############## Prepair for install Zimbra(OS: Centos 6).################# ifconfig | grep "inet addr" && route | grep default #echo -e "$BLUE ############## Prepair for Zimbra(OS: Centos 6).################# $NC" #echo -e "" echo -e "$BLUE 1.Input IP address for server. $NC" read IP1 #echo -e "" #echo -e "$BLUE 2.Input netmask for server. $NC" #read NETMASK1 #echo -e "" #echo -e "$BLUE 3.Input gateway for server. $NC" #read GATEWAY1 #echo -e "$BLUE Input interface (Ex: eth0) : $NC" #read INTERFACES1 #echo "" #echo -e "$BLUE 4.Input DNS2 (Ex: 8.8.4.4). $NC" #read DNS2 #echo -e "" echo -e "" echo -e "$BLUE 2.Input DNS1 (Ex: 8.8.8.8