7-1. [CentOS7] ·¹µå¸¶ÀÎ (Redmine) ¼³Ä¡ -1
[CentOS7] ·¹µå¸¶ÀÎ (Redmine) ¼³Ä¡ -1
¾È³çÇϼ¼¿ä. °«´ëÈñ ÀÔ´Ï´Ù. À̹ø Æ÷½ºÆÃÀº [ Redmine ¼³Ä¡ ] ÀÔ´Ï´Ù. :)
·¹µå¸¶ÀÎÀ» 2°¡Áö ¹æ¹ýÀ¸·Î ¼³Ä¡ÇØ º¸¾Ò´Ù.
ù¹ø°, bitnami ·¹µå¸¶ÀÎÀ¸·Î ÇÊ¿äÇÑ ¸ðµâÀ» Çѹø¿¡ °°ÀÌ ¼³Ä¡, ¼³Á¤ÇÏ´Â ¹æ¹ý. ( ÇØ´ç ÆÄÀÏÀÇ ½ÇÇàÀ»·Î ¸ðµç°Í À» ¼¼Æà bitnami-redmine-3.4.3-2-linux-x64-installer.run )
µÎ¹ø°, Á÷Á¢ compile ÇÏ¿© ¼³Ä¡ÇÏ´Â ¹æ¹ý
µÎ¹ø° ¹æ¹ýÀÌ °³ÀÎÀûÀ¸·Î ´õ ±¦Âú¾Ò´Ù. ÇØ´ç ¹æ¹ýÀ¸·Î Á÷Á¢¼³Ä¡ ÇÏ´Ù·Ï Çغ¸°Ú´Ù.
¢º mysql VS maria DB
MYSQLÀº ±Û·Î¹ú IT¾÷ü ¿À¶óŬÀÇ ¼ÒÀ¯´Ù. ¿À¶óŬÀº ½ã¸¶ÀÌÅ©·Î½Ã½ºÅÛÁ ÀμöÇÏ¸é¼ MYSQLµµ ¼Õ¿¡ ³Ö¾ú´Ù.
±×·¯³ª ¿À¶óŬÀÌ ½ãÀ» ÀμöÇÑ ÈÄ MYSQL¿¡ ´ëÇÑ Á¤Ã¥À» Æó¼âÀûÀ¸·Î °¡Á®°¡´Â °Í ¾Æ´Ï³Ä´Â ¿ì·Á¸¦ ºÒ·¯ÀÏÀ¸Å² Á¶Ä¡µéÀÌ ¸¹ÀÌ ÃëÇØÁ³´Ù.
¿À¶óŬÀÌ ÀÚ»ç ±âÁ¸ DB »ç¾÷ º¸È£¸¦ À§ÇØ MYSQL¿¡ ´ëÇÑ Áö¿øÀ» ÁÙÀÌ°í, °á±¹ °í»ç½Ãų °ÍÀ̶õ °üÃøµµ ÀûÁö ¾Ê¾Ò´Ù.
½ÇÁ¦·Î MYSQLÀ» »ç¿ëÇÏ´ø ±¸±Û, À§Å°Çǵð¾Æ µî ´ëÇü ÀÎÅÍ³Ý ¼ºñ½º ±â¾÷µéµµ ¼Ó¼Ó ¸¶¸®¾ÆDB·Î °¥¾ÆŸ´Â ¿òÁ÷ÀÓÀ» º¸¿´´Ù.
ÀÌ ¿ÍÁß¿¡ MYSQL º¯Á¾ Á¦Ç°µéÀÌ °ü½ÉÀ» ²ø±â ½ÃÀÛÇß´Ù. ¸¶¸®¾ÆDB°¡ ´ëÇ¥ÀûÀÌ´Ù.
mysql °³¹ßÀÚ°¡ ³ª¿Í mariadb¸¦ ¸¸µé¾ú´Ù°í ÇÑ´Ù. ÀÌÈÄ Á¦¾à, ±Ô¾à ¾øÀÌ mariadb°¡ Á»´õ È®Àå, °³¹ß µÉ°ÍÃ÷·Î º¸ÀδÙ. ¿ì¿¬È÷ ³ªµµ mariadb·Î ÁøÇà.
¢º 1. mariadb ¼³Ä¡
yum -y install mariadb-server mariadb
1-1. ¼ºñ½º ½ÃÀÛ ¹× ÀçºÎÆà ½Ã ÀÚµ¿½ÇÇà ¼³Á¤
¼ºñ½º ½ÃÀÛ : systemctl start mariadb.service
ÀçºÎÆà ½Ã ÀÚµ¿½ÇÇà ¼³Á¤ : systemctl enable mariadb.service
1-2. ¼ºñ½º ÃʱâÈ(db root °èÁ¤ pw ¼³Á¤)
[root@goddaehee ~]# mysql_secure_installation <<<---- mysql ±âº» º¸¾È ¸í·É¾î(Ãʱ⠼³Ä¡ ÈÄ º¸¾ÈÀû¿ë ¹æ¹ý)
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): <<<---- Enter ÀÔ·Â(pw Ãʱ⠼³Á¤À̹ǷΠ¿£ÅÍ·Î ³Ñ¾î°£´Ù)
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] <<<---- Enter ÀÔ·Â(root pw ¼³Á¤? yes or Enter)
New password: <<<---- PW ÀÔ·Â
Re-enter new password: <<<---- PW ÀÔ·Â
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] <<<---- Enter ÀÔ·Â(À͸í»ç¿ëÀÚ »èÁ¦? yes or Enter)
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <<<---- Enter ÀÔ·Â(mysql ¿ø°Ý Á¢¼Ó ±ÇÇÑÁ¦ÇÑ)
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <<<---- Enter ÀÔ·Â(test DB »èÁ¦ ¿©ºÎ)
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <<<---- Enter ÀÔ·Â
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
1-3. mysqlÅ×ÀÌºí »ý¼º ¹× redmine °èÁ¤ »ý¼º
[root@goddaehee ~]# mysql -uroot -p
Enter password: <<<---- 1¹ø¿¡¼ mariadb root PW ÀÔ·Â
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci; <<<--- redmine DB »ý¼º
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE USER 'redmine'@'%' IDENTIFIED BY 'alswl1234'; <<<---- redmine DBÀÇ user(redmine)¿Í pw »ý¼º
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%'; <<<---- redmine¿¡°Ô ¸ðµç ±ÇÇÑ ºÎ¿©
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES; <<<---- ¼³Á¤ Àû¿ë
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
¢º 2. PHP¼³Ä¡
2-1. yum -y install php
2-2.1. PHP ¼³Ä¡
yum -y install php-mysql
2-2.2. PHP °øÅë ¸ðµâ ¼³Ä¡
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
2-3. ¾ÆÆÄÄ¡ Àç½ÃÀÛ
systemctl restart httpd.service
³ª¿Í °°Àº °æ¿ì service httpd restart
¢º 3. Redmine ÀÇÁ¸¼º ¶óÀ̺귯¸® ¼³Ä¡
yum -y install gcc g++ cpp gcc-c++
yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel
yum -y install mariadb-devel
yum -y install ImageMagick ImageMagick-devel
¢º 4. Ruby ¼³Ä¡(Mac OS´Â Ruby ¾ð¾î·Î ±¸¼ºµÇ¾î ÀÖÀ½)
yum -y install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri
4-1. rubygem ¼³Ä¡(gem : ¸®´ª½ºÀÇ yum°ú °°Àº °Í)
yum -y install rubygems
gem update <<<--- ¾ÈµÇ¸é --system ºÙ¿©¼ ÁøÇà
gem update --system
yum -y install gcc gcc-c++ make
4-2. rails ¼³Ä¡
gem install rails -V
4-3. ÄÄÆÄÀÏ ¼³Ä¡ <<<---- ·çºñ tar ÆÄÀÏ ´Ù¿î·Îµå ¹ÞÀ» °æ·Î·Î À̵¿
cd /tmp/lib
wget http://cache.ruby-lang.org/pub/ruby/ruby-2.5.0.tar.gz
tar xvf ruby-2.5.0.tar.gz
mv ruby-2.5.0.tar.gz /usr/local
cd /usr/local/ruby-2.5.0
./configure
make && make install
4-4. ·çºñ ¹öÁ¯ È®ÀÎ
[root@goddaehee ruby-2.5.0]# ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
4-5. bundler ¼³Ä¡
gem install bundler --no-rdoc --no-ri
¢º 5. Redmine ¼³Ä¡
cd /var/www/html
wget http://www.redmine.org/releases/redmine-3.4.4.tar.gz <<< ¿øÇÏ´Â ¹öÀü ´Ù¿î·Îµå : http://www.redmine.org/releases/
tar xvzf http://www.redmine.org/releases/redmine-3.4.4.tar.gz
mv redmine-3.4.4 redmine
cd redmine
5.1 database ¼³Á¤ ¹× mysql °èÁ¤ Á¤º¸ ÀÔ·Â
cp ./config/database.yml.example config/database.yml
vi ./config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "ºñ¹øÀÔ·Â"
encoding: utf8
* »ç¿ëÀÚ °èÁ¤À¸·Î ÇÒ °Í
5.2 Redmine Gem ¼³Ä¡
bundle install --without development test
5.3 ¼¼¼Ç º¯Á¶ ¹æÁö¸¦ À§ÇÑ Key ¸¦ »ý¼º
bundle exec rake generate_secret_token
5.4 µðºñ ½ºÅ°¸¶ ¼ÂÆÃ
bundle exec rake db:migrate RAILS_ENV=production
5.5 ±âº»¾ð¾î Çѱ¹¾î·Î ¼³Á¤
bundle exec rake redmine:load_default_data RAILS_ENV=production REDMINE_LANG=ko
5.6 Redmine Apahce ¿¬µ¿ ¸ðµâ ¼³Ä¡
gem install passenger
[root@goddaehee build]# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v5.1.12.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort. <<<--- Enter ÀÔ·Â
--------------------------------------------
Installation through RPMs recommended
It looks like you are on a Red Hat or CentOS operating system, with SELinux
enabled. SELinux is a security mechanism for which special Passenger-specific
configuration is required. We supply this configuration as part of
our Passenger RPMs.
However, Passenger is currently installed through gem or tarball and does not
include any SELinux configuration. Therefore, we recommend that you:
1. Uninstall your current Passenger install.
2. Reinstall Passenger through the RPMs that we provide:
https://www.phusionpassenger.com/library/install/apache/yum_repo/
What would you like to do?
Press Ctrl-C to exit this installer so that you can install RPMs (recommended)
-OR-
Press Enter to continue using this installer anyway
--------------------------------------------
Which languages are you interested in?
Use <space> to select.
If the menu doesn't display correctly, press '!'
‣ ⬢ Ruby <<<--- ´À³¦Ç¥ ÀÔ·Â ÈÄ, ¹æÇâÅ°·Î Ruby ÁöÁ¤ ÈÄ Enter ÀÔ·Â
⬢ Python
⬡ Node.js
⬡ Meteor
--------------------------------------------
Checking for required software...
* Checking for C compiler...
Found: yes
Location: /usr/bin/cc
* Checking for C++ compiler...
Found: yes
Location: /usr/bin/c++
* Checking for Curl development headers with SSL support...
Found: yes
curl-config location: /usr/bin/curl-config
Header location: /usr/include/curl/curl.h
Version: libcurl 7.29.0
Usable: yes
Supports SSL: yes
* Checking for Zlib development headers...
Found: yes
Location: /usr/include/zlib.h
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.4.6
* Checking for Rake (associated with /usr/bin/ruby)...
Found: yes
Location: /usr/bin/ruby /usr/local/bin/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /usr/include/ruby.h
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
* Checking for rack...
Found: yes
* Checking for OpenSSL development headers...
Found: yes
Location: /usr/include/openssl/ssl.h
* Checking for Apache 2 development headers...
Found: no
* Checking for Apache Portable Runtime (APR) development headers...
Found: no
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: no
Some required software is not installed.
But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort.
--------------------------------------------
Installation instructions for required software
* To install Apache 2 development headers:
Please install it with yum install httpd-devel
* To install Apache Portable Runtime (APR) development headers:
Please install it with yum install apr-devel
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with yum install apr-util-devel
If the aforementioned instructions didn't solve your problem, then please take
a look at our documentation for troubleshooting tips:
https://www.phusionpassenger.com/library/install/apache/
https://www.phusionpassenger.com/library/admin/apache/troubleshooting/
³ª¿Í °°ÀÌ ÀÌÀü ¾ÆÆÄÄ¡ºÎÅÍ ¼³Ä¡ÇÑ °æ¿ì ¿©±â¼ À§¿Í °°ÀÌ ³ª¿ÀÁö ¾Ê°í Á¤»ó ¼³Ä¡ ¿Ï·á.. ±×·¸Áö ¾ÊÀº°æ¿ì À§¿Í°°ÀÌ ³ëÃâ.
[root@goddaehee build]# yum -y install httpd-devel apr-develapr-util-devel <<<--- À§¿¡¼ ÇÊ¿äÇÏ´Ù°í ÇÏ´Â ÆÐÅ°Áö ¼³Ä¡
[root@goddaehee build]# passenger-install-apache2-module <<--- ´Ù½ÃÁøÇà
¾Æ·¡ ³»¿ë º¹»çÇؼ apache conf ¼³Á¤ ½Ã Ãß°¡
LoadModule passenger_module /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
5.7 Apache configure Æú´õ¿¡ .conf ÆÄÀÏ Ãß°¡
vi /etc/httpd/conf.d/redmine.conf
³ª¿Í °°Àº °æ¿ì ³»°¡ ¼³Ä¡ÇÑ apache Æú´õÀÇ ±âº» httpd.conf ÆÄÀÏ¿¡ Ãß°¡.
Listen 8081
LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
LoadModule passenger_module /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
<VirtualHost *:8081>
#ServerName your.server.com
#ServerAlias www.your.server.com
DocumentRoot /var/www/html/redmine/public
<Directory /var/www/html/redmine/public>
AllowOverride all
Options -Multiviews
Require all granted
</Directory>
</VirtualHost>
¡Ø virtual host ¼³Á¤½Ã ½ÇÁ¦ µ¿ÀÛÇÏ°Ô µÉ À§Ä¡¸¦ redmine ³»ÀÇ public µð·ºÅ丮¸¦ ±âÁØÀ¸·Î ¼³Á¤
5.8. redmine ¼³Ä¡ Æú´õÀÇ ±ÇÇÑ º¯°æ <<<--- ±ÇÇѺ¯°æÀ» ¾ÈÇÏ¸é »ç¿ëÀÚ Ãß°¡ ±â´É µî ¸î¸î ±â´É¿¡ ´ëÇؼ ±ÇÇÑÀÌ ¾ø¾î 500 ¿¡·¯ ¹ß»ý
cd /var/www/html
chown -R apache:apache redmine
5.9. ¹æȺ® Æ÷Æ® Ãß°¡
firewall-cmd --permanent --zone=public --add-port=8005/tcp
firewall-cmd --reload
firewall-cmd --list-ports
5.10. ¾ÆÆÄÄ¡ Àç½ÃÀÛ
systemctl restart httpd.service
³ª¿Í °°Àº °æ¿ì service httpd restart
6. Redmine Á¢¼Ó
http://ipÁÖ¼Ò:8081
Ãʱâ¾ÆÀ̵ð / password = admin/admin
Ãâó: https://goddaehee.tistory.com/78?category=250744 [°«´ëÈñÀÇ ÀÛÀº°ø°£]