{"id":1990,"date":"2017-05-10T22:42:52","date_gmt":"2017-05-10T13:42:52","guid":{"rendered":"http:\/\/bton.papalabs.net\/?p=1990"},"modified":"2022-04-12T22:00:00","modified_gmt":"2022-04-12T13:00:00","slug":"ubuntu16-04nginxunicornmysqlajenti%e3%81%a7%e3%83%90%e3%83%bc%e3%83%81%e3%83%a3%e3%83%ab%e3%83%9b%e3%82%b9%e3%83%88%e3%81%aeredmine%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/bton.papalabs.net\/?p=1990","title":{"rendered":"ubuntu16.04 + nginx + unicorn + mysql + ajenti\u3067\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u306bredmine\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>\u3053\u3061\u3089\u306f\u3001\u524d\u56de\u306e<a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=2TGK61+JNBQQ+50+4YR6O2\" target=\"_blank\" rel=\"nofollow noopener\">ConoHa<\/a><img loading=\"lazy\" border=\"0\" width=\"1\" height=\"1\" src=\"https:\/\/www16.a8.net\/0.gif?a8mat=2TGK61+JNBQQ+50+4YR6O2\" alt=\"\">\u306eubuntu\u306bnginx\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3068\u3053\u308d\u306b\u3001Ajenti\u3067\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u3092\u884c\u3046\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u8a18\u4e8b\u306e\u7d9a\u304d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Redmine\u3092\u52d5\u304b\u3059\u306b\u5f53\u305f\u3063\u3066\u3001nginx\u306f\u3001\u4eca\u56de\u306f\u30d7\u30ed\u30ad\u30b7\u30fc\u30b5\u30fc\u30d0\u3068\u3057\u3066\u6a5f\u80fd\u3057\u3066\u3082\u3089\u3044\u3001WEB\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u30e9\u30a4\u30c8\u30a6\u30a8\u30a4\u30c8\u306aunicorn\u306b\u6d3b\u8e8d\u3057\u3066\u3082\u3089\u3046\u3053\u3068\u3068\u3057\u307e\u3057\u305f\u3002\uff08\u304a\u305d\u3089\u304f\u540c\u3058\u30ed\u30b8\u30c3\u30af\u306e\u5fdc\u7528\u3067puma\u3084thin+nginx\u3067\u3082\u69cb\u7bc9\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002\uff09<\/p>\n<p>\u4eca\u56de\u306f\u3001Ajenti\u306e\u30b3\u30f3\u30d1\u30cd\u7ba1\u7406\u3092\u4f75\u7528\u3057\u3064\u3064\u3001ubuntu\u306eVPS\u74b0\u5883\u306b\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u3092\u8ffd\u52a0\u4f5c\u6210\u3057\u3066Redmine\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>ubunutu16.04<\/li>\n<li>nginx\uff08proxy\u3068\u3057\u3066\u4f7f\u3046\uff09<\/li>\n<li>unicorn\uff08WEB\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u4f7f\u3046\uff09<\/li>\n<\/ul>\n<p>Redmine\u306fRuby on Rails\u3067\u3067\u304d\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002<br>\nGit\u3084Subversion\u3068\u306e\u9023\u643a\u304c\u3067\u304d\u305f\u308a\u3001\u30ac\u30f3\u30c8\u30c1\u30e3\u30fc\u30c8\u304c\u5229\u7528\u3067\u304d\u305f\u308a\u3068\u3001\u8272\u3005\u3068\u4fbf\u5229\u306a\u306e\u3067\u3059\u304c\u3001\u3044\u304b\u3093\u305b\u3093\u74b0\u5883\u3092\u9078\u3076\u3068\u3044\u3046\u304b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5927\u5909\u306a\u3053\u3068\u3067\u3082\u77e5\u3089\u308c\u308b\u30b7\u30b9\u30c6\u30e0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Redmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u306e\u30b3\u30de\u30f3\u30c9\u5165\u529b\u3092\u4f75\u7528\u3057\u3064\u3064\u3001\u9762\u5012\u306a\u3068\u3053\u308d\u306f\u3001Ajenti\u306e\u30b3\u30f3\u30d1\u30cd\u3084FTP\u3067\u7c21\u5358\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\u3001<a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=2TGK61+JNBQQ+50+4YR6O2\" target=\"_blank\" rel=\"nofollow noopener\">ConoHa<\/a><img loading=\"lazy\" border=\"0\" width=\"1\" height=\"1\" src=\"https:\/\/www16.a8.net\/0.gif?a8mat=2TGK61+JNBQQ+50+4YR6O2\" alt=\"\">\u306eVPS\u3067ubuntu16.04\u30b5\u30fc\u30d0\u30fc\u306b\u3001ajenti\u3084nginx\u3001\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306a\u3069\u306e\u57fa\u672c\u306e\u30b5\u30fc\u30d0\u30fc\u69cb\u6210\u304c\u69cb\u7bc9\u3067\u304d\u3066\u3044\u308b\u524d\u63d0\u3067\u3059\u3002<\/p>\n<h3>\u307e\u305a\u306f\u4e0b\u6e96\u5099\u3092\u3002<\/h3>\n<ol>\n<li>\u6700\u521d\u306b\u3001<a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=2TGK61+JNBQQ+50+4YR6O2\" target=\"_blank\" rel=\"nofollow noopener\">ConoHa<\/a><img loading=\"lazy\" border=\"0\" width=\"1\" height=\"1\" src=\"https:\/\/www16.a8.net\/0.gif?a8mat=2TGK61+JNBQQ+50+4YR6O2\" alt=\"\">\u306eVPS\u30b3\u30f3\u30d1\u30cd\u304b\u3089DNS\u3067A\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3001Redmine\u3092\u904b\u7528\u3059\u308b\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u767a\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002\uff08\u4eee\u306bredmine.example.com\u3068\u3057\u307e\u3059\u3002\uff09<\/li>\n<li>Ajenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u306eWEB\u30b5\u30a4\u30c8\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u3001\u65b0\u3057\u3044WEB\u30b5\u30a4\u30c8\u3068\u3057\u3066\u3001redmine.example.com\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u4e00\u822c\u8a2d\u5b9a\u30bf\u30d6\u3067\u306f\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u3001\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\u3067\u4f5c\u6210\u3057\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u30e2\u30fc\u30c9\u306e\u30c1\u30a7\u30c3\u30af\u306f\u5916\u3057\u307e\u3059\u3002\u30c9\u30e1\u30a4\u30f3\u30bf\u30d6\u3067\u306f\u3001redmine.example.com\u3092\u8ffd\u52a0\u3057\u3066\u3001\u300cAPPLY CHANGES\u300d\u30dc\u30bf\u30f3\u3067\u8a2d\u5b9a\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p>\u3053\u3053\u307e\u3067\u3067\u3001redmine.example.com\u306eWEB\u30b5\u30a4\u30c8\u3092\u5f8c\u6094\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002<br>\nhtttp:\/\/redmine.example.com\u3067\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001nginx\u306e\u521d\u671f\u30da\u30fc\u30b8\u304c\u898b\u3048\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u6b21\u306b\u3001Redmine\u306b\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u985e\u3092\u8ffd\u52a0\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/h3>\n<pre><span style=\"color: #999999;\">#Ruby\u3068\u95a2\u9023\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span>\nsudo apt-get install ruby bundler imagemagick libmagickwand-dev libcurl4-openssl-dev git subversion rails ruby-dev gcc make libmagick++-dev\n<span style=\"color: #999999;\">#MySQL\u95a2\u9023\u306f\u4e0b\u8a18\u3067\u3001\u307e\u3060\u5165\u3063\u3066\u3044\u306a\u3044\u3082\u306e\u3092\u8ffd\u52a0\u3059\u308b<\/span>\nsudo apt-get install mysql-server mysql-client libmysqlclient-dev\n<span style=\"color: #999999;\">#MariaDB\u3092MySQL\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u3046\u5834\u5408\u306f\u3053\u3061\u3089\u304b\u3089\u3001\u307e\u3060\u5165\u3063\u3066\u3044\u306a\u3044\u3082\u306e\u3092\u8ffd\u52a0\u3059\u308b\uff08\u203b\u4eca\u56de\u306f\u3001MySQL\u3067\u9032\u3081\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3061\u3089\u306b\u3064\u3044\u3066\u306f\u3001\u8aac\u660e\u3057\u307e\u305b\u3093\u3002\u5fc5\u8981\u306a\u3082\u306e\u306e\u53c2\u8003\u60c5\u5831\u306e\u307f\u3067\u3059\uff09<\/span>\nsudo apt-get install mariadb-server libmariadb-client-lgpl-dev<\/pre>\n<h3>Redmine\u7528\u306eMySQLconfig\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/h3>\n<p>redmine.cnf\u3068\u3044\u3046\u540d\u79f0\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\/etc\/mysql\/conf.d\/\u306b\u8ffd\u52a0\u3057\u3001\u4e0b\u8a18\u306e\u5185\u5bb9\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<pre><span style=\"color: #999999;\">#\/etc\/mysql\/conf.d\/redmine.cnf<\/span>\n[mysqld]\ninnodb_file_format = Barracuda\ninnodb_file_per_table = 1\ninnodb_large_prefix = ON\ncharacter-set-server = utf8mb4\nskip-character-set-client-handshake\ncollation-server = utf8mb4_general_ci\ninit-connect = SET NAMES utf8mb4\n \n[mysql]\ndefault-character-set = utf8mb4\n \n[client]\ndefault-character-set = utf8mb4\n \n[mysqldump]\ndefault-character-set = utf8mb4\n<\/pre>\n<p>\u3053\u308c\u306f\u3001MySQL\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u3001uft8\u306e\u7d75\u6587\u5b57\u304c\u4f7f\u3048\u308b\u3088\u3046\u3001\uff14\u30d0\u30a4\u30c8\u5bfe\u5fdc\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u3059\u308b\u8a2d\u5b9a\u3067\u3059\u3002<\/p>\n<p>Ajenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u3067\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u958b\u304d\u3001\/etc\/mysql\/conf.d\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3001\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002new file\u3068\u3044\u3046\u540d\u524d\u306e\u65b0\u3057\u3044\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u540d\u524d\u3092\u300credmine.cnf\u300d\u306b\u5909\u66f4\u3057\u3066\u4e00\u65e6\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter wp-image-1995 size-medium\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf-300x142.png\" alt=\"\" width=\"300\" height=\"142\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf-300x142.png 300w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf-768x364.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf-1024x485.png 1024w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/83c1be62cdce004f96bc350162c77adf.png 1622w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br>\n\u4fdd\u5b58\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30e1\u30e2\u5e33\u3067\u958b\u304d\uff08\u518d\u5ea6\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u306e\u7de8\u96c6\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30e1\u30e2\u5e33\u3067\u958b\u304b\u308c\u307e\u3059\uff09\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/7e6557ddd591c49d2634434d29993f69.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-1996\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/7e6557ddd591c49d2634434d29993f69-250x300.png\" alt=\"\" width=\"250\" height=\"300\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/7e6557ddd591c49d2634434d29993f69-250x300.png 250w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/7e6557ddd591c49d2634434d29993f69-768x923.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/7e6557ddd591c49d2634434d29993f69.png 850w\" sizes=\"(max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<h3>\u3055\u3089\u306b\u3001migrate\u6642\u306brow_format\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u3001\u540c\u69d8\u306e\u624b\u9806\u3067\u4e0b\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/h3>\n<pre><span style=\"color: #999999;\">#\/var\/www\/redmine.example.com\/config\/initializers\/utf8mb4.rb<\/span>\n\nActiveSupport.on_load :active_record do\n module ActiveRecord::ConnectionAdapters\n\n  class AbstractMysqlAdapter\n   def create_table_with_innodb_row_format(table_name, options = {})\n    table_options = options.merge(:options =&gt; 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC')\n    create_table_without_innodb_row_format(table_name, table_options) do |td|\n     yield td if block_given?\n    end\n   end\n   alias_method_chain :create_table, :innodb_row_format\n  end\n\n end\nend\n<\/pre>\n<h3>\u6b21\u306b\u3001svn\u3067Redmine\u672c\u4f53\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/h3>\n<pre>sudo -u www-data svn co http:\/\/svn.redmine.org\/redmine\/branches\/3.3-stable \/var\/www\/redmine.example.com\/html<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u4e00\u5f0f\u306e\u6240\u6709\u6a29\u3092\u3001\u30e6\u30fc\u30b6\u30fc\u30fb\u30b0\u30eb\u30fc\u30d7\u3068\u3082\u306b\u3001www-data\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>chown -R www-data:www-data \/var\/www\/redmine.example.com\/html<\/pre>\n<p>\u3082\u3046\u3072\u3068\u3064\u306e\u3084\u308a\u65b9\u3068\u3057\u3066\u3001Ajenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u304b\u3089\u884c\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\n\u3069\u3061\u3089\u3067\u3082\u540c\u3058\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u304a\u597d\u304d\u306a\u3084\u308a\u65b9\u3067\u3002svn\u3067\u4f5c\u696d\u3057\u305f\u5834\u5408\u306f\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306e\u969b\u306b\u3001svn\u7d4c\u7531\u3067\u884c\u3048\u307e\u3059\u306e\u3067\u3001\u5f8c\u3005\u5c11\u3057\u697d\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>WEB\u30b5\u30a4\u30c8\u30e1\u30cb\u30e5\u30fc\u306e\u4e00\u822c\u8a2d\u5b9a\u30bf\u30d6\u306e\u4e2d\u306e\u3001\u300cAUTOMATIC DOWNLOADER\u300d\u306eURL\u306b\u4e0b\u8a18\u306eRedmine\u306e\u5727\u7e2e\u30d5\u30a1\u30a4\u30eb\u307e\u3067\u306e\u30ea\u30f3\u30af\u3092\u5165\u529b\u3057\u3001\u300cDOWNLOAD AND UNPACK\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<pre>http:\/\/www.redmine.org\/releases\/redmine-3.3.3.tar.gz<\/pre>\n<p>\u3059\u308b\u3068\u3001\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/\u5185\u306b\u3001\u201credmine-3.3.3\u201d\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u3067\u304d\u3001Redmine\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u5f0f\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u540c\u3058\u304f\u4e00\u822c\u8a2d\u5b9a\u30bf\u30d6\u3067\u3001\u300cFIX FILE PERMISSIONS\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\n\u3053\u308c\u3067\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u6240\u6709\u6a29\u3092WEB\u306e\u5b9f\u884c\u30e6\u30fc\u30b6\u30fc\u3067\u3042\u308bwww-data\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30e1\u30cb\u30e5\u30fc\u3067\u3001\u201credmine-3.3.3\u201d\u306e\u4e2d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u3066\u3001\u4e00\u3064\u4e0a\u306e \/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/ \u3078\u79fb\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067\u3001Redmine\u306e\u30d5\u30a1\u30a4\u30eb\u4e00\u5f0f\u3092WEB\u306e\u516c\u958b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u8a2d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h3>Redmine\u7528\u306b\u3001MySQL\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/h3>\n<p>Ajenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u306eWEB\u30b5\u30a4\u30c8\u30e1\u30cb\u30e5\u30fc\u3092\u958b\u304d\u3001MySQL\u30bf\u30d6\u3067\u3001\u65b0\u3057\u3044DB\u3068DB\u30e6\u30fc\u30b6\u30fc\u30fb\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\uff08<span style=\"color: #ff0000;\">redminedb<\/span> \/ <span style=\"color: #ff0000;\">redmineuser<\/span> \/ <span style=\"color: #ff0000;\">password<\/span> \u3068\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002\u308f\u304b\u308a\u3084\u3059\u3044\u9069\u5f53\u306a\u540d\u79f0\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u8003\u616e\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\uff1b\uff09<\/p>\n<h3>\u7d9a\u3051\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u305f\u3081\u306e\u521d\u671f\u30d5\u30a1\u30a4\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/h3>\n<ol>\n<li>Gemfile<br>\nAjenti\u7ba1\u7406\u30d1\u30cd\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u3001 \/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/Gemfile \u3092\u958b\u304d\u307e\u3059\u3002<br>\n<a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/66208d06e16372ae1f2a6df995bf235e.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-1997\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/66208d06e16372ae1f2a6df995bf235e-247x300.png\" alt=\"\" width=\"247\" height=\"300\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/66208d06e16372ae1f2a6df995bf235e-247x300.png 247w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/66208d06e16372ae1f2a6df995bf235e-768x933.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/66208d06e16372ae1f2a6df995bf235e.png 838w\" sizes=\"(max-width: 247px) 100vw, 247px\" \/><\/a><br>\n\u30e1\u30e2\u5e33\u3067\u3001\uff17\u884c\u3081\u306b\u3001\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<p><\/p>\n<pre>gem \"unicorn\"<\/pre>\n<p><a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-1998\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72-300x161.png\" alt=\"\" width=\"300\" height=\"161\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72-300x161.png 300w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72-768x411.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72-1024x548.png 1024w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/05a60bc33763fd79c5f109f93c6c1f72.png 1106w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p><\/li>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u7528\u306econfig\u30d5\u30a1\u30a4\u30eb<br>\nAjenti\u7ba1\u7406\u30d1\u30cd\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u3001 \/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/config\/database.yml.sample \u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u3001\u300cdatabase.yml\u300d\u306b\u5909\u66f4\u3057\u4fdd\u5b58\u3057\u3066\u304b\u3089\u3001\u30e1\u30e2\u5e33\u3067\u958b\u304d\u307e\u3059\u3002<br>\n\u4eca\u56de\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7ba1\u7406\u30c4\u30fc\u30eb\u3068\u3057\u3066Redmine\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u3001\u30c6\u30b9\u30c8\u74b0\u5883\u306a\u3069\u306f\u4e0d\u8981\u3067\u3059\u3002production\u306e\u307f\u7de8\u96c6\u3057\u3001\u5148\u307b\u3069\u4f5c\u6210\u3057\u305fMySQL\u306eDB\u60c5\u5831\u3092\u5165\u529b\u3057\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<p><\/p>\n<ul>\n<li>MySQL\u306eDB\u540d<\/li>\n<li>MySQL\u306eDB\u30e6\u30fc\u30b6\u30fc\u540d<\/li>\n<li>MySQL\u306eDB\u30d1\u30b9\u30ef\u30fc\u30c9<br>\n<a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-1999\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb-300x123.png\" alt=\"\" width=\"300\" height=\"123\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb-300x123.png 300w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb-768x314.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb-1024x419.png 1024w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/3f164517e6dd87fc70c9ad64d75549eb.png 1110w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u30e1\u30fc\u30eb\u9001\u4fe1\u7528\u306econfig\u30d5\u30a1\u30a4\u30eb<br>\n\u540c\u3058\u624b\u9806\u3067\u4e0b\u8a18\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<br>\n\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/config\/configuration.yml.sample \u30fc\uff1e\u300cconfiguration.yml\u300d\u3068\u3057\u3066\u4fdd\u5b58\u3002<br>\n\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3068\u30e1\u30fc\u30eb\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<br>\nRedmine\u7528\u306e\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\u30fc\u3092\u65b0\u898f\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001\u5148\u306bAjenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u306e\u30e1\u30fc\u30eb\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u4f5c\u6210\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u524d\u56de\u307e\u3067\u306b\u4f5c\u6210\u3057\u305f\u72ec\u81ea\u30c9\u30e1\u30a4\u30f3\u306e\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u524d\u63d0\u3067\u3059\u3002SSL\u901a\u4fe1\u3067\u63a5\u7d9a\u3059\u308b\u5834\u5408\u3084\u3001Gmail\u306a\u3069\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u691c\u7d22\u3059\u308b\u3068\u8a2d\u5b9a\u5185\u5bb9\u304c\u898b\u3064\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u4ed6\u306e\u30d6\u30ed\u30b0\u306a\u3069\u3067\u63a2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br>\nconfiguration.yml\u306e\u8a2d\u5b9a\u306f\u3001Redmine\u3067\u30e1\u30fc\u30eb\u901a\u5185\u3092\u884c\u3046\u5834\u5408\u306b\u5fc5\u8981\u3067\u3059\u304c\u3001\u8a2d\u5b9a\u3057\u306a\u304f\u3066\u3082Redmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u81ea\u4f53\u306f\u9032\u3081\u3089\u308c\u307e\u3059\u3002\u30e1\u30fc\u30eb\u8a2d\u5b9a\u3092\u884c\u308f\u305a\u3001\u305d\u306e\u307e\u307e\u9032\u3081\u308b\u5834\u5408\u306f\u3001config\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<p><\/p>\n<ul>\n<li>address \u30fc\uff1e\u30e1\u30fc\u30eb\u30b5\u30fc\u30d0\u30fc<\/li>\n<li>domain \u30fc\uff1e\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u3059\u308b\u30c9\u30e1\u30a4\u30f3<\/li>\n<li>user_name \u30fc\uff1e\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\u30fc\u540d<\/li>\n<li>password \u30fc\uff1e\u30e1\u30fc\u30eb\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9<br>\n<a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-2000\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0-300x86.png\" alt=\"\" width=\"300\" height=\"86\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0-300x86.png 300w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0-768x221.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0-1024x294.png 1024w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/a0da6e23b6a63032e260e48d7d0e08e0.png 1120w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u3044\u3088\u3044\u3088\u3001Redmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<\/h3>\n<p>\u3053\u3053\u307e\u3067\u3067\u3001\u4e00\u901a\u308a\u306e\u6e96\u5099\u304c\u3067\u304d\u305f\u306e\u3067\u3001Redmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u9032\u3081\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u3001\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3001Redmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u958b\u59cb\u3002<\/p>\n<pre>cd&nbsp;\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\n\nsudo -u www-data bundle install --path vendor\/bundle --without development test postgresql sqlite<\/pre>\n<p>DB\u306bRedmine\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u30ab\u30e9\u30e0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>sudo -u www-data bundle exec rake generate_secret_token\n\nsudo -u www-data bundle exec rake db:migrate RAILS_ENV=production<\/pre>\n<p>MySQL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u30ab\u30e9\u30e0\u304c\u4f5c\u6210\u3067\u304d\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3059\u3002(\u4e0b\u8a18redmineuser\u3068redminedb\u306f\u3001DB\u30e6\u30fc\u30b6\u30fc\u540d\u3067\u3059\u306e\u3067\u3001\u81ea\u5206\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<pre>mysql -u <span style=\"color: #ff0000;\">redmineuser<\/span> -p;<\/pre>\n<p>\uff08\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u5165\u529b\u3057\u3066Enter\u30ad\u30fc\u3092\u62bc\u3059\uff09<\/p>\n<pre>use <span style=\"color: #ff0000;\">redminedb<\/span>;<\/pre>\n<pre>show tables;<\/pre>\n<p>\u30c6\u30fc\u30d6\u30eb\u304c\u305a\u3089\u3063\u3068\u8868\u793a\u3055\u308c\u305f\u3089OK\u3067\u3059\u3002MySQL\u3092\u629c\u3051\u307e\u3059\u3002<\/p>\n<pre>exit;<\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067\u3001\u30a8\u30e9\u30fc\u306a\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u3066\u3044\u308c\u3070\u3001unicorn\u5358\u4f53\u3067\u3001Redmine\u304c\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001unicorn\u3092\u8d77\u52d5\u3057\u3066\u3001\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>sudo -u www-data bundle exec unicorn_rails -l 3000 -E production<\/pre>\n<p>\u30a8\u30e9\u30fc\u306a\u304f\u8d77\u52d5\u3067\u304d\u305f\u3089\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u3001<br>\nhttp:\/\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>:3000<br>\n\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001Redmine\u306e\u521d\u671f\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876.png\" rel=\"lightbox[1990]\"><img loading=\"lazy\" class=\"aligncenter size-medium wp-image-2002\" src=\"http:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876-300x93.png\" alt=\"\" width=\"300\" height=\"93\" srcset=\"https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876-300x93.png 300w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876-768x238.png 768w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876-1024x318.png 1024w, https:\/\/bton.papalabs.net\/wp-content\/uploads\/2017\/05\/c1c9a7c36f0ae53111507e8d4b92a876.png 1804w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u78ba\u8a8d\u3067\u304d\u305f\u3089\u3001Unicorn\u306f\u3001Control\u30ad\u30fc+C\u30ad\u30fc\u3067\u3001\u4e00\u65e6\u7d42\u4e86\u3057\u307e\u3059\u3002<\/p>\n<h3>\u6b21\u306b\u3001Nginx\u3092\u30d7\u30ed\u30ad\u30b7\u30fc\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u3001Unicorn\u306b\u30bd\u30b1\u30c3\u30c8\u63a5\u7d9a\u3059\u308b\u3068\u3053\u3068\u307e\u3067\u3092\u3084\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/h3>\n<ol>\n<li>Ajenti\u306e\u7ba1\u7406\u30d1\u30cd\u30eb\u304b\u3089\u3001WEB\u30b5\u30a4\u30c8\u30e1\u30cb\u30e5\u30fc\u3067\u3001redmine.example.com\u306e\u30b5\u30a4\u30c8\u7ba1\u7406\u30a6\u30a4\u30f3\u30c9\u30a6\u3092\u958b\u304d\u307e\u3059\u3002<\/li>\n<li>\u300cCustom top level configuration \u300d\u306b\u306f\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002\n<pre>upstream <span style=\"color: #ff0000;\">redmine.example.com<\/span> {\nserver unix:\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/tmp\/unicorn.sock;\n}<\/pre>\n<\/li>\n<li>\u300cAPPLY CHANGES\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u8a2d\u5b9a\u3092\u53cd\u6620\u3055\u305b\u307e\u3059\u3002<\/li>\n<li>\u300c\u9ad8\u5ea6\u306a\u8a2d\u5b9a\u300d\u30bf\u30d6\u306e\u300c\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a\u300d\u306b\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002proxy\u306b\u95a2\u3059\u308b\u4e0a\u306e\uff13\u884c\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3055\u305b\u308b\u6642\u9593\u306e\u9577\u3055\u3092\u8a2d\u5b9a\u3057\u305f\u3082\u306e\u306a\u306e\u3067\u30a8\u30e9\u30fc\u5bfe\u7b56\u306a\u306e\u3067\u3001\u7121\u304f\u3066\u3082\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306a\u3089\u7701\u3044\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002\n<pre>proxy_connect_timeout 60;\nproxy_read_timeout 60;\nproxy_send_timeout 60;\n\nlocation \/ {\nproxy_pass <span style=\"color: #ff0000;\">http:\/\/redmine.example.com<\/span>;\nproxy_set_header Host $http_host;\nproxy_set_header X-Real-IP $remote_addr;\nproxy_set_header X-Forwarded-Proto $scheme;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n}<\/pre>\n<\/li>\n<li>\uff08\u6ce8\uff09\u3082\u3057\u3001\u3053\u306e\u5f8c\u3001\u30b5\u30a4\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u969b\u306b\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u51e6\u7406\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u30a8\u30e9\u30fc\u304c\u8fd4\u3055\u308c\u308b\u5834\u5408\u306f\u3001\u300c\u30ab\u30b9\u30bf\u30e0\u8a2d\u5b9a\u300d\u306e\u4e00\u756a\u4e0a\u306b\u3001\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u3042\u3052\u308b\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\uff08Nginx\u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306b\u3057\u305f\u5834\u5408\u306b\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u306e\u30b5\u30a4\u30ba\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u898f\u5b9a\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3092\u8d8a\u3048\u308b\u3068\u3001\u30a8\u30e9\u30fc\u3092\u8fd4\u3057\u307e\u3059\u3002\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001\u5024\u3092\u5927\u304d\u304f\u3057\u3066\u304a\u304d\u307e\u3059\u3002\uff09\n<pre>client_body_buffer_size     32k;\nclient_header_buffer_size   8k;\nlarge_client_header_buffers 8 64k;<\/pre>\n<p>\u53c2\u8003\uff1a<a href=\"http:\/\/qiita.com\/cubicdaiya\/items\/0678396f11982e537e2d\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/qiita.com\/cubicdaiya\/items\/0678396f11982e537e2d<\/a><\/p><\/li>\n<li>Unicorn\u3068Nginx\u3092\u30bd\u30b1\u30c3\u30c8\u3067\u7e4b\u3050unicorn.rb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br>\n\u30d5\u30a1\u30a4\u30eb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u3001\/var\/www\/<span style=\"color: #ff0000;\">redmine.example.com<\/span>\/html\/config\/ \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3001\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3001unicorn.rb\u3068\u3044\u3046\u540d\u79f0\u3067\u4fdd\u5b58\u3057\u307e\u3059\u3002<br>\n\u4fdd\u5b58\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u3001\u30e1\u30e2\u5e33\u3067\u958b\u304d\u3001\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<p><\/p>\n<pre><span style=\"color: #999999;\">#\/var\/www\/redmine.example.com\/html\/config\/unicorn.rb<\/span>\n\nworker_processes 2\n\napp_path = \"\/var\/www\/redmine.example.com\/html\"\n\nlisten File.expand_path('tmp\/unicorn.sock', app_path)\npid File.expand_path('tmp\/unicorn.pid', app_path)\nstderr_path File.expand_path('log\/unicorn.stderr.log', app_path)\nstdout_path File.expand_path('log\/unicorn.stdout.log', app_path)\n\npreload_app true\n\ntimeout 30\n\nif GC.respond_to?(:copy_on_write_friendly=)\nGC.copy_on_write_friendly = true\nend\n\nbefore_fork do |server, worker|\ndefined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!\n\nold_pid = \"#{server.config[:pid]}.oldbin\"\nif old_pid != server.pid\nbegin\nsig = (worker.nr + 1) &gt;= server.worker_processes ? :QUIT : :TTOU\nProcess.kill(sig, File.read(old_pid).to_i)\nrescue Errno::ENOENT, Errno::ESRCH\nend\nend\nend\n\nafter_fork do |server, worker|\ndefined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection\nend\n<\/pre>\n<\/li>\n<\/ol>\n<h3>Redmine\u3092\u30c7\u30fc\u30e2\u30f3\u30d7\u30ed\u30bb\u30b9\u3067\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/h3>\n<pre>sudo -u www-data bundle exec unicorn -c config\/unicorn.rb -E production -D<\/pre>\n<p>Nginx\u3068Unicorn\u3092\u518d\u8d77\u52d5\u3057\u3001http:\/\/redmine.example.com \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u3066\u3001\u5148\u307b\u3069\u30013000\u756a\u30dd\u30fc\u30c8\u3067\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3044\u305f\u3001Redmine\u306e\u521d\u671f\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u3001OK\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u306b\u3066\u3001Redfmine\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002<\/p>\n<p>\u53c2\u8003\uff1a<br>\n<a href=\"https:\/\/jyn.jp\/ubuntu-redmine\/\" target=\"_blank\" rel=\"noopener\">https:\/\/jyn.jp\/ubuntu-redmine\/<\/a><br>\n<a href=\"https:\/\/www.crunchtimer.jp\/blog\/technology\/linux\/5638\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.crunchtimer.jp\/blog\/technology\/linux\/5638\/<\/a><br>\n<a href=\"http:\/\/www.torutk.com\/projects\/swe\/wiki\/Redmine%E3%82%92CentOS_7%E4%B8%8A%E3%81%A7%E5%8B%95%E3%81%8B%E3%81%99%E3%83%BCUnicorn%E3%81%A8Nginx%E7%B7%A8\" target=\"_blank\" rel=\"noopener\">http:\/\/www.torutk.com\/projects\/swe\/wiki\/Redmine%E3%82%92CentOS_7%E4%B8%8A%E3%81%A7%E5%8B%95%E3%81%8B%E3%81%99%E3%83%BCUnicorn%E3%81%A8Nginx%E7%B7%A8<\/a><br>\n<a href=\"https:\/\/wiki.archlinux.org\/index.php\/redmine\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.archlinux.org\/index.php\/redmine<\/a><br>\n<a href=\"http:\/\/www.seirios.org\/seirios\/dokuwiki\/doku.php?id=tweet:2016:0212_03\" target=\"_blank\" rel=\"noopener\">http:\/\/www.seirios.org\/seirios\/dokuwiki\/doku.php?id=tweet:2016:0212_03<\/a><\/p>\n<p><a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=2TGK61+JNBQQ+50+4YSWE9\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><br>\n<img loading=\"lazy\" src=\"https:\/\/www20.a8.net\/svt\/bgt?aid=170413849033&amp;wid=001&amp;eno=01&amp;mid=s00000000018030032000&amp;mc=1\" alt=\"\" width=\"336\" height=\"280\" border=\"0\"><\/a><br>\n<img loading=\"lazy\" src=\"https:\/\/www19.a8.net\/0.gif?a8mat=2TGK61+JNBQQ+50+4YSWE9\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"><br>\n<a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=2TVKLK+941V3M+3GRY+69HA9\" target=\"_blank\" rel=\"nofollow noopener\"><br>\n<img loading=\"lazy\" border=\"0\" width=\"468\" height=\"60\" alt=\"\" src=\"https:\/\/www20.a8.net\/svt\/bgt?aid=171114248551&amp;wid=001&amp;eno=01&amp;mid=s00000016171001052000&amp;mc=1\"><\/a><br>\n<img loading=\"lazy\" border=\"0\" width=\"1\" height=\"1\" src=\"https:\/\/www13.a8.net\/0.gif?a8mat=2TVKLK+941V3M+3GRY+69HA9\" alt=\"\"><\/p>\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/www23.a8.net\/svt\/bgt?aid=220412351693&amp;wid=001&amp;eno=01&amp;mid=s00000001642009004000&amp;mc=1\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/px.a8.net\/svt\/ejp?a8mat=3N879B+BGLF02+CO4+1HLVB5\"><\/a><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3061\u3089\u306f\u3001\u524d\u56de\u306eConoHa\u306eubuntu\u306bnginx\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30db\u30b9\u30c8\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u3068\u3053\u308d\u306b\u3001Ajenti\u3067\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u3092\u884c\u3046\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u305f\u8a18\u4e8b\u306e\u7d9a\u304d\u306b\u306a\u308a\u307e\u3059\u3002 Redmine\u3092\u52d5\u304b\u3059\u306b\u5f53\u305f\u3063\u3066\u3001nginx\u306f\u3001\u4eca\u56de\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[235,218,174,186],"tags":[],"_links":{"self":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts\/1990"}],"collection":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1990"}],"version-history":[{"count":16,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts\/1990\/revisions"}],"predecessor-version":[{"id":2068,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts\/1990\/revisions\/2068"}],"wp:attachment":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}