본문 바로가기
툴-레드마인, MANTIS 등

BeagleBone Black redmine 4 설치하기입니다. with debian 10. Install. DIY 비글본 블랙

by 해피비(Happy plan B) 2021. 8. 27.
반응형

안녕하세요.행부장입니다.

debian 10에 BeagleBone Black (이하 BBB) redmine 4 설치하기입니다.

출처: 본인

###0. debian 10 in BBB

$sudo apt update
$sudo apt -y upgrade

###################################################################
##1. Install MariaDB
###################################################################
##Install MariaDB 10.3 on Debian 10
$sudo apt install mariadb-server mariadb-client
###$sudo apt remove mariadb-server #삭제

#확인
$dpkg -l | grep -E 'mysql|mariadb'

#Running MariaDB 10 on Debian
$systemctl status mariadb

##2. Config MariaDB
#Create Redmine Database and Database User
$sudo mysql -u root
[none]>use mysql;
# update password to nothing
[mysql]>update user set authentication_string=PASSWORD("YOUR PASSWORD") where User='root';
# set password resolving to default mechanism for root user
[mysql]>update user set plugin="mysql_native_password" where User='root';

[mysql]>flush privileges;
[mysql]>\q

# redminedb
>create database redminedb;

# redmineuser
>grant all on redminedb.* to redmineuser@localhost identified by 'redmine1!';

#Reload privilege tables and exit the database.
>flush privileges;
>quit


####복구
$sudo su - root
#systemctl stop mariadb
#mysqld_safe --skip-grant-tables & # start mysql without password
#mysql -u root
[none]>use mysql;

# update password to nothing
[mysql]>update user set authentication_string=PASSWORD("YOUR PASSWORD") where User='root';
# set password resolving to default mechanism for root user
[mysql]>update user set plugin="mysql_native_password" where User='root';
[mysql]>flush privileges;
#systemctl status mariadb

##################################

##2. Install Required Build Tools and Dependencies
$sudo apt install build-essential ruby-dev libxslt1-dev libmariadb-dev libxml2-dev
$sudo apt install zlib1g-dev imagemagick libmagickwand-dev curl vim sudo



##################################

##3. Install Apache HTTP Server on Debian 10
$sudo apt install apache2

##Install the APache modules for the Passenger, lightweight web server for Ruby
$sudo apt install libapache2-mod-passenger


#The above command will also install other required dependencies including Ruby.

$ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [arm-linux-gnueabihf]


##Start and enable Apache to run on system boot.

$sudo systemctl enable --now apache2

###4.Create Redmine System User
##Hence, create a redmine user and assign the Redmine installation directory, /opt/redmine as its home directory.
$sudo useradd -r -m -d /opt/redmine -s /bin/bash redmine

##Add Apache user to Redmine group.
$sudo usermod -aG redmine www-data

##(custom) Download and Install Redmine
#4.0.9 (2021-04-26): redmine-4.0.9.tar.gz
$mkdir ~debian/dn
$wget http://www.redmine.org/releases/redmine-4.0.9.tar.gz -P ~debian/dn

$sudo -u redmine tar xzf ~debian/dn/redmine-4.0.9.tar.gz -C /opt/redmine/ --strip-components=1

##################################
###Configuring Redmine on Debian 10
#Once you have installed Redmine under the /opt/redmine directory, you can now proceed to configure it.
#Create Redmine configuration file by renaming the sample configuration files as shown below;


$sudo su redmine
$cd ~/config
$cp configuration.yml.example configuration.yml
$cp database.yml.example database.yml
$cp additional_environment.rb.example additional_environment.rb


##Configure Redmine Database Settings
$nano /opt/redmine/config/database.yml

...
production:
adapter: mysql2
database: redminedb
host: localhost
username: redmineuser
password: "YOUR PASSWORD"
encoding: utf8
...

redmine@beaglebone:~/config$exit

cd /opt/redmine
##Install Bundler for managing gem dependencies.
$sudo gem install bundler

#redmine user
#Next, install the required gems dependencies as non-privileged redmine user.
$sudo su redmine

$bundle install --without development test --path vendor/bundle

#Generate Secret Session Token
#To prevent tempering of the cookies that stores session data,
#you need to generate a random secret key that Rails uses to encode them.
$bundle exec rake generate_secret_token

#Create Database Schema Objects
#Create Rails database structure by running the command below;
$RAILS_ENV=production bundle exec rake db:migrate

#Once the database migration is done,
#insert default configuration data into the database by executing;
#korean
$RAILS_ENV=production REDMINE_LANG=ko bundle exec rake redmine:load_default_data

##################################
### Configure FileSystem Permissions ###
##################################
##Configure FileSystem Permissions
#Ensure that the following directories are available on Redmine directory, /opt/redmine.

#tmp and tmp/pdf
#public and public/plugin_assets
#log
#files
# \If they do not exist, simply create them and ensure that they are owned by the user used to run Redmine.

#Change redmine user.
$sudo su redmine

$for i in tmp tmp/pdf public/plugin_assets; do [ -d $i ] || mkdir -p $i; done
$chown -R redmine:redmine files log tmp public/plugin_assets
$chmod -R 755 /opt/redmine
redmine@debian10:~$ exit

##Testing Redmine Installation
#The setup of Redmine on Debian 10 is now done.
#Redmine listens on TCP port 80800 by apache2.
#Hence, before running the tests, open port 8080/tcp on firewall if it is running.

#allow 8080 port. BBB에서 3000port는 cloud에서 사용중
$sudo apt install ufw #설치가 안되어 있는 경우
$sudo ufw allow 8080/tcp

반응형

##################################
##Configure Apache for Redmine
#Now that you have confirmed that Redmine is working as expected,
#proceed to configure Apache to server Redmine.

#Create Redmine Apache VirtualHost configuration file.
$sudo nano /etc/apache2/sites-available/redmine.conf

Listen 8080
<VirtualHost *:8080>
ServerName redmine.kifarunix-demo.com
RailsEnv production
DocumentRoot /opt/redmine/public

<Directory "/opt/redmine/public">
Allow from all
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/redmine_error.log
CustomLog ${APACHE_LOG_DIR}/redmine_access.log combined
</VirtualHost>

#Check Apache configuration for errors.
$sudo apachectl configtest
#Syntax OK
#Ensure that Passenger module is loaded;

$sudo apache2ctl -M | grep -i passenger
#passenger_module (shared)
#If not enabled, run the command below to enable it.

$sudo a2enmod passenger

#Enable Redmine site.
$sudo a2ensite redmine

#Reload Apache
$sudo systemctl reload apache2
#$sudo systemctl restart apache2


##Access Redmine on Browser
#Next, you can now access and sign in to Redmine on browser using the address
#http://192.168.7.2:8080 Default credentials: admin:admin.
##################################
### 참고 ###
## usb로 인터넷을 진행할려고 하면
## 매번 BBB 실행 후에 route add와, nameserver 설정을 해주어야 함
##
### route add
$sudo /sbin/route add default gw 192.168.7.1
#$sudo /sbin/route del default gw 192.168.7.1
##################################
$nano /etc/network/interfaces

# /etc/resolv.conf
# 수동편집
# sudo nano /etc/resolv.conf
nameserver 168.126.63.1
nameserver 8.8.8.8

#자동편집: 명령어로 입력
$sudo sh -c "echo nameserver 168.126.63.1 > /etc/resolv.conf"


#맨 마지막에 추가했지만 효과?? /etc/network/interfaces
$sudo /etc/network/interfaces
gateway 192.168.7.1

### 시간 KST설정
// ‘Seoul’ 파일 확인
$ ls /usr/share/zoneinfo/Asia

// Localtime 심볼릭 링크 재설정
$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

### 시간 동기화
$sudo apt install ntpdate
$sudo ntpdate time.bora.net

##################################

오늘 더 행복하시길.

도움이 되셨다면 아래▼▼▼ 공감하트 클릭 부탁드립니다.

감사합니다.






반응형

댓글