Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
dev:ubuntu:setupsvr [2016/04/04 11:51]
denis
dev:ubuntu:setupsvr [2017/10/17 09:59] (текущий)
denis
Строка 122: Строка 122:
  
 === upgrade === === upgrade ===
-  - <​code>/​opt/​redmine/​ctlscript.sh stop</​code>​+  - <​code>​ 
 +cd /opt 
 +/​opt/​redmine/​mysql/​bin/​mysqldump -u bitnami -pDATABASE_PASSWORD bitnami_redmine > backup.sql 
 +/​opt/​redmine/​ctlscript.sh stop 
 +</​code>​
   - download and install new bitnami-redmine https://​bitnami.com/​stack/​redmine/​installer   - download and install new bitnami-redmine https://​bitnami.com/​stack/​redmine/​installer
-  - +  - recreate symlink ''/​opt/​redmine''​ 
 +  - <​code>​ 
 +/​opt/​redmine/​ctlscript.sh stop 
 +/​opt/​redmine/​ctlscript.sh mysql start
  
 +/​opt/​redmine/​mysql/​bin/​mysql -u root -p 
 +    Password: ****
 +    mysql> drop database bitnami_redmine;​
 +    mysql> create database bitnami_redmine;​
 +    mysql> grant all privileges on bitnami_redmine.* to '​bn_redmine'​@'​localhost'​ identified by '​DATABASE_PASSWORD';​
 +    ​
 +/​opt/​redmine/​mysql/​bin/​mysql -u root -p bitnami_redmine < /​opt/​backup.sql
 +</​code>​
 +  - ''/​opt/​redmine/​apps/​redmine/​htdocs/​config/​database.yml'':<​code>​
 +production:
 +  adapter: mysql2
 +  database: bitnami_redmine
 +  host: localhost
 +  username: bn_redmine
 +  password: "​DATABASE_PASSWORD"​
 +  encoding: utf8
 +</​code>​
 +  - <​code>​
 +cd /​opt/​redmine/​apps/​redmine/​htdocs ​
 +/​opt/​redmine/​ruby/​bin/​ruby bin/rake db:migrate RAILS_ENV=production
 +</​code>​
 +  - copy from the old installation
 +    - ''/​opt/​redmine/​apps/​redmine/​htdocs/​files'' ​
 +    - ''/​opt/​redmine/​apps/​redmine/​htdocs/​plugins''​
 +    - ''/​opt/​redmine/​apps/​redmine/​htdocs/​public/​themes''​
 +  - <​code>​
 +cd /​opt/​redmine/​apps/​redmine/​htdocs ​
 +/​opt/​redmine/​ruby/​bin/​ruby bin/rake redmine:​plugins RAILS_ENV=production
 +/​opt/​redmine/​ruby/​bin/​ruby bin/rake tmp:​cache:​clear
 +/​opt/​redmine/​ruby/​bin/​ruby bin/rake tmp:​sessions:​clear
 +/​opt/​redmine/​ctlscript.sh restart
 +</​code>​
  
 +
 +
 +==== iptable ====
 +Свой адрес - 192.168.2.190. Слушать порт 2223 и отправлять на 192.168.0.7:​80:​
 +  iptables -t nat -A PREROUTING -p tcp -d 192.168.2.190 --dport 2223 -j DNAT --to-destination 192.168.0.7:​80
 +
 +==== mount windows share for rsync operation ====
 +
 +  sudo apt-get install cifs-utils
 +
 +Создать файл ''/​data/​jroboplc/​backup'':​
 +<code bash>
 +#!/bin/bash
 +
 +# setup
 +targetdir=/​data/​jroboplc
 +sharehost=//​192.168.2.40/​promauto-src1
 +backupdir=.
 +
 +# code (do not change)
 +if [ "​$EUID"​ -ne 0 ]
 +  then echo "​Please run as root"
 +  exit
 +fi
 +mntdir=/​mnt/​wnd-share-tmp
 +if [ ! -d "​$mntdir"​ ]; then
 +  mkdir $mntdir
 +fi
 +mount $sharehost -t cifs -o uid=1000,​gid=1000,​username=guest,​password=''​ $mntdir
 +if ! grep $sharehost /​proc/​mounts;​ then
 +  echo "​Unable to mount share directory"​
 +  exit
 +fi
 +cd $mntdir
 +mkdir -p $backupdir
 +rsync -avzh $targetdir $mntdir/​$backupdir
 +cd /
 +sleep 1
 +umount $sharehost
 +</​code>​
 +
 +Настройка cron:
 +  sudo crontab -e
 +
 +  0 * * * * /​data/​jroboplc/​backup
  
   ​   ​
 +==== timezone ====
 +
 +  sudo dpkg-reconfigure tzdata
   ​   ​
 +Отключение и включение синхронизации времени в сети:  ​
 +  timedatectl set-ntp 0
 +  timedatectl set-ntp 1
 +
  
dev/ubuntu/setupsvr.1459759898.txt.gz · Последние изменения: 2016/04/04 11:51 — denis
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0