- RubyとPassengerのビルドに必要なヘッダファイルなど
# yum groupinstall "Development Tools"
# yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel wget
- MySQLとヘッダファイル
# yum install mysql-server mysql-devel
- Apacheとヘッダファイル
# yum install httpd httpd-devel
- ImageMagickとヘッダファイル・日本語フォント
# yum install ImageMagick ImageMagick-devel
# yum install ipa-pgothic-fonts
rbenvを参照
[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 # 追加する # 任意設定 default-storage-engine=InnoDB 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 # 追加する
# /etc/init.d/mysqld start
# chkconfig mysqld on
# chkconfig --list | grep mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
rootユーザーのパスワード変更・匿名ユーザー削除を対話方式で行います
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, 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): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL 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] Y ... 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] ... Success! By default, MySQL 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] - 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] ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL!
# mysql -u root -p
Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 5.0.77 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec) mysql>
mysql> create database redmine default character set utf8; Query OK, 1 row affected (0.00 sec) mysql> grant all on redmine.* to 'redmine'@'localhost' identified by 'xxxxxxxx'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye
# vi config/database.yml
production: adapter: mysql2 database: redmine username: redmine password: ******** host: localhost encoding: utf8
# vi config/configuration.yml
production: email_delivery: delivery_method: :smtp smtp_settings: address: "localhost" port: 25 rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf ← 190行目を修正する
# bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf
# vi /etc/httpd/conf.d/passenger.conf
# Passengerの基本設定 # passsenger-install-apache2-module --snippetを実行して表示される結果 LoadModule passenger_module /usr/local/rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so PassengerRoot /usr/local/rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/passenger-3.0.19 PassengerRuby /usr/local/rbenv/versions/1.9.3-p385/bin/ruby # 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のチューニングのための設定を追加。 # PassengerMaxPoolSize 20 PassengerMaxInstancesPerApp 4 PassengerPoolIdleTime 3600 PassengerUseGlobalQueue on PassengerHighPerformance on PassengerStatThrottleRate 10 RailsSpawnMethod smart RailsAppSpawnerIdleTime 86400 RailsFrameworkSpawnerIdleTime 0
# ln -s /var/lib/redmine/public /var/www/html/redmine
# echo "RailsBaseURI /redmine" >> /etc/httpd/conf.d/passenger.conf
最新コメント