Created
February 8, 2014 19:40
-
-
Save legnoh/8889027 to your computer and use it in GitHub Desktop.
rbenv,CentOS6.5で作るredmine環境 ref: http://qiita.com/legnoh/items/835ad5d1fa06a333348e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host legnoh | |
User root | |
HostName legnoh.jp | |
Port 10022 | |
IdentityFile ~/.ssh/id_rsa | |
ForwardAgent yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
production: | |
email_delivery: | |
delivery_method: :smtp | |
smtp_settings: | |
address: "localhost" | |
port: 25 | |
domain: 'rm.legnoh.jp' | |
rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
production: | |
adapter: mysql2 | |
database: db_redmine | |
host: localhost | |
username: user_redmine | |
password: ††††††††† | |
encoding: utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ssh root@legnoh.jp | |
$ mkdir .ssh | |
$ touch ~/.ssh/authorized_keys | |
...(セキュリティ上、SCPせずに手打ちでコピペする) | |
$ chmod 700 ~/.ssh | |
$ chmod 600 ~/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /etc/ssh/sshd_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chmod o+x /root/ .rbenv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbenv exec gem install bundler --no-rdoc --no-ri | |
$ rbenv rehash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /etc/my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service mysqld start | |
$ chkconfig mysqld on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service mysqld start | |
$ chkconfig mysqld on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mysql -uroot | |
mysql> show variables like 'character_set%'; | |
+--------------------------+----------------------------+ | |
| Variable_name | Value | | |
+--------------------------+----------------------------+ | |
| character_set_client | utf8 | | |
| character_set_connection | utf8 | | |
| character_set_database | utf8 | | |
| character_set_filesystem | binary | | |
| character_set_results | utf8 | | |
| character_set_server | utf8 | | |
| character_set_system | utf8 | | |
| character_sets_dir | /usr/share/mysql/charsets/ | | |
+--------------------------+----------------------------+ | |
8 rows in set (0.00 sec) | |
mysql> use mysql; | |
mysql> update user set password=password('********') where user = 'root'; | |
mysql> delete from user where user = ''; | |
mysql> create database db_redmine default character set utf8; | |
mysql> grant all on db_redmine.* to user_redmine identified by '†††††††††'; | |
mysql> flush privileges; | |
mysql> exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget http://www.redmine.org/releases/redmine-2.4.3.tar.gz | |
$ tar zxf redmine-2.4.3.tar.gz | |
$ mv redmine-2.4.3 /var/lib/redmine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /var/lib/redmine/config/database.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /var/lib/redmine/config/configuration.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /var/lib/redmine/config/configuration.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /var/lib/redmine | |
$ bundle install --without development test | |
$ bundle exec rake generate_secret_token | |
$ RAILS_ENV=production bundle exec rake db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /var/lib/redmine | |
$ rbenv local 2.1.0 | |
$ rbenv rehash | |
$ ruby -v | |
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux] | |
$ bundle install --without development test | |
$ bundle exec rake generate_secret_token | |
$ RAILS_ENV=production bundle exec rake db:migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbenv exec gem install passenger --no-rdoc --no-ri | |
$ rbenv rehash | |
$ passenger-install-apache2-module | |
(Enter連打) | |
$ passenger-install-apache2-module --snippet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim /etc/httpd/conf.d/passenger.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service httpd configtest | |
$ service httpd start | |
$ chkconfig httpd on | |
$ chown -R apache:apache /var/lib/redmine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service httpd configtest | |
$ service httpd start | |
$ chkconfig httpd on | |
$ chown -R apache:apache /var/lib/redmine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm A (IPアドレス) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm A (IPアドレス) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service httpd configtest | |
$ service httpd start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbenv exec gem install redcarpet | |
$ rbenv rehash | |
$ git clone https://github.com/alminium/redmine_redcarpet_formatter.git /var/lib/redmine/plugins/redmine_redcarpet_formatter | |
$ cd redmine_redcarpet_formatter | |
$ git checkout v2.0.1 | |
$ service httpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service sshd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone git://github.com/makotokw/redmine-theme-gitmike.git /var/lib/redmine/gitmike | |
$ service httpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir ~/code | |
$ git clone https://github.com/legnoh/rm_gh.git ~/code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vim .ssh/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yum install -y openssl-devel readline-devel zlib-devel curl-devel libyaml-devel | |
$ yum install -y mysql-server mysql-devel | |
$ yum install -y httpd httpd-devel | |
$ yum install -y ImageMagick ImageMagick-devel | |
$ yum install -y ipa-pgothic-fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
$ source ~/.bash_profile | |
$ type rbenv | |
#=> "rbenv is a function" | |
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbenv install -l | |
... | |
2.0.0-p195 | |
2.0.0-rc2 | |
2.1.0 | |
2.1.0-dev | |
2.1.0-preview1 | |
2.1.0-preview2 | |
2.1.0-rc1 | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rbenv install 2.1.0 | |
$ rbenv rehash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameVirtualHost *:80 | |
<VirtualHost *:80> | |
ServerName legnoh.jp | |
DocumentRoot /var/www/html | |
</VirtualHost> | |
<VirtualHost *:80> | |
ServerName rm.legnoh.jp | |
DocumentRoot /var/lib/redmine/public | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
datadir=/var/lib/mysql | |
socket=/var/lib/mysql/mysql.sock | |
user=mysql | |
# Disabling symbolic-links is recommended to prevent assorted security risks | |
symbolic-links=0 | |
character-set-server=utf8 | |
# 任意設定 | |
innodb_file_per_table | |
query-cache-size=16M | |
[mysqld_safe] | |
log-error=/var/log/mysqld.log | |
pid-file=/var/run/mysqld/mysqld.pid | |
[mysql] | |
default-character-set=utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoadModule passenger_module /root/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so | |
<IfModule mod_passenger.c> | |
PassengerRoot /root/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.37 | |
PassengerDefaultRuby /root/.rbenv/versions/2.1.0/bin/ruby | |
</IfModule> | |
# Passengerが追加するHTTPヘッダを削除するための設定(任意)。 | |
# | |
Header always unset "X-Powered-By" | |
Header always unset "X-Rack-Cache" | |
Header always unset "X-Content-Digest" | |
Header always unset "X-Runtime" | |
# 必要に応じてPassengerのチューニングのための設定を追加(任意)。 | |
# 詳しくはPhusion Passenger users guide(http://www.modrails.com/documentation/Users%20guide%20Apache.html)をご覧ください。 | |
PassengerMaxPoolSize 20 | |
PassengerMaxInstancesPerApp 4 | |
PassengerPoolIdleTime 3600 | |
PassengerHighPerformance on | |
PassengerStatThrottleRate 10 | |
PassengerSpawnMethod smart | |
RailsAppSpawnerIdleTime 86400 | |
PassengerMaxPreloaderIdleTime 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Port 10022 | |
PermitRootLogin without-password | |
PasswordAuthentication no | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment