노력과 삽질 퇴적물

우분투: 레드마인 설치 본문

프로그래밍note/서버 및 통신

우분투: 레드마인 설치

MTG 2019. 6. 30. 23:24

* 해당 포스트는
우분투 16.04.4 LTS기준이며 아파치+mySQL조합입니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
root@ubuntu# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.4 LTS"
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
cs






1. 아파치


1) 설치

1
2
root@ubuntu# sudo apt update
root@ubuntu# sudo apt install apache2 libapache2-mod-passenger
cs



2) 방화벽

-> 웹 브라우저로 로컬호스트 혹은 AWS 인스턴스 주소로 접속이 안 될 경우입니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
root@ubuntu# service apache2 restart
root@ubuntu# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.
root@ubuntu# netstat -atp |grep apache
tcp6       0      0 [::]:http               [::]:*                  LISTEN      12743/apache2
root@ubuntu# netstat  -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
udp        0      0 0.0.0.0:68              0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     18891    /run/user/1000/systemd/private
unix  2      [ ACC ]     SEQPACKET  LISTENING     8806     /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     13293    /run/uuidd/request
unix  2      [ ACC ]     STREAM     LISTENING     13298    /var/lib/lxd/unix.socket
unix  2      [ ACC ]     STREAM     LISTENING     22157    /run/snapd.socket
unix  2      [ ACC ]     STREAM     LISTENING     22158    /run/snapd-snap.socket
unix  2      [ ACC ]     STREAM     LISTENING     13296    /run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     13297    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     32866    /tmp/passenger.bOlfeib/agents.s/watchdog_api
unix  2      [ ACC ]     STREAM     LISTENING     32911    /tmp/passenger.bOlfeib/agents.s/core
unix  2      [ ACC ]     STREAM     LISTENING     32912    /tmp/passenger.bOlfeib/agents.s/core_api
unix  2      [ ACC ]     STREAM     LISTENING     32962    /tmp/passenger.bOlfeib/agents.s/ust_router
unix  2      [ ACC ]     STREAM     LISTENING     15091    @ISCSIADM_ABSTRACT_NAMESPACE
unix  2      [ ACC ]     STREAM     LISTENING     32963    /tmp/passenger.bOlfeib/agents.s/ust_router_api
unix  2      [ ACC ]     STREAM     LISTENING     8796     /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     8807     /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     8813     /run/lvm/lvmpolld.socket
unix  2      [ ACC ]     STREAM     LISTENING     8814     /run/systemd/journal/stdout
root@ubuntu# netstat -atp |grep apache
tcp6       0      0 [::]:http               [::]:*                  LISTEN      12743/apache2
root@ubuntu# iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
root@ubuntu# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.
cs






2. mySQL & 레드마인


1) mySQL설치.

1
2
3
4
root@ubuntu# apt-get install mysql-server mysql-client
//설치시 mySQL-root계정 비번 입력
this_is_mySQL_password_2019
... ... ...
cs



2) 레드마인&레드마인-mysql

1
2
3
4
5
6
7
root@ubuntu# apt-get install redmine redmine-mysql
... ... ...
MySQL application password for redmine/instances/default:
this_is_mySQL_password_2019
... ... ...
Setting up sqlite3 (3.11.0-1ubuntu1.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
cs



3) 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ubuntu# sudo mysql -u root -p
Enter password: this_is_mySQL_password_2019
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.7.25-0ubuntu0.16.04.2 (Ubuntu)
 
Copyright (c) 20002019, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| redmine_default    |
| sys                |
+--------------------+
5 rows in set (0.00 sec)
cs






3. gem


1) 설치

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@ubuntu# ruby -v    //<--원래는 없는데, 아파치 이후에 자동으로 있음.
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
 
root@ubuntu# sudo gem update
... ... ...
Updating web-console
ERROR:  Error installing web-console:
        Unresolved dependency found during sorting - activesupport (>= 4.2.0) (requested by rails-dom-testing-2.0.3)
Gems updated: actionmailer actionpack actionview activejob activesupport concurrent-ruby erubi rack rails-dom-testing actionpack-action_caching actionpack-xml_parser method_source railties activemodel activerecord arel addressable public_suffix atomic awesome_nested_set bigdecimal binding_of_caller builder bundler byebug coderay coffee-rails coffee-script-source css_parser debug_inspector did_you_mean eventmachine execjs ffi globalid hike htmlentities i18n io-console jbuilder jquery-rails json listen rb-fsevent ruby_dep crass loofah mail mini_mime mime-types mime-types-data minitest molinillo multi_json mysql2 connection_pool net-http-persistent net-ldap net-telnet mini_portile2 nokogiri oj polyglot power_assert protected_attributes psych rack-test nio4r rails-html-sanitizer rails-observers rake rb-inotify rbpdf rbpdf-font rdoc redcarpet request_store rmagick nokogiri roadie-rails sass sass-listen sass-rails sdoc spring sprockets sprockets-rails sqlite3 test-unit thor thread_safe tilt treetop turbolinks turbolinks-source tzinfo uglifie
root@ubuntu# gem install -f web-console
root@ubuntu# sudo gem update
... ... ...
root@ubuntu# sudo gem install bundler
Successfully installed bundler-2.0.2
Parsing documentation for bundler-2.0.2
Done installing documentation for bundler after 2 seconds
1 gem installed
cs






4. conf


1) passenger.conf

1
2
3
4
5
6
7
8
9
10
root@ubuntu# sudo ln -s /usr/share/redmine/public /var/www/html/redmine
root@ubuntu# sudo touch /usr/share/redmine/Gemfile.lock
root@ubuntu# sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock
root@ubuntu# vi /etc/apache2/mods-available/passenger.conf
<IfModule mod_passenger.c>
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
  PassengerDefaultUser www-data            //<--추가항목
</IfModule>
:wq
cs



2) redmine.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@ubuntu# vi /etc/apache2/sites-available/redmine.conf    //<--신규생성
<VirtualHost *:80>
     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/redmine
     ServerName xxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com
     ServerAlias www.xxxxxxxxxxxxxxxxxxxxx.compute.amazonaws.com
 
     <Directory /var/www/html/redmine>
         RailsBaseURI /redmine
         PassengerResolveSymlinksInDocumentRoot on
     </Directory>
 
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
 
</VirtualHost>
:wq
cs



3) 서비스 실행.

1
2
3
4
5
6
7
root@ubuntu# sudo a2ensite redmine.conf  //반대는 a2dissite  redmine.conf
sudo a2ensite redmine.conf
Enabling site redmine.
To activate the new configuration, you need to run:
  service apache2 reload
root@ubuntu# service apache2 reload
root@ubuntu# sudo systemctl restart apache2.service
cs






기타. 변경이력


일자

변경이력

2019-06-30

 초안