{"id":43434,"date":"2024-10-05T16:56:31","date_gmt":"2024-10-05T08:56:31","guid":{"rendered":"https:\/\/server.hk\/cnblog\/43434\/"},"modified":"2024-10-05T16:56:31","modified_gmt":"2024-10-05T08:56:31","slug":"centos-8-%e4%b8%ad%e9%83%a8%e7%bd%b2-redmine-%e9%a0%85%e7%9b%ae%e7%ae%a1%e7%90%86%e5%92%8c%e7%bc%ba%e9%99%b7%e8%b7%9f%e8%b9%a4%e7%b3%bb%e7%b5%b1","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/43434\/","title":{"rendered":"CentOS 8 \u4e2d\u90e8\u7f72 Redmine \u9805\u76ee\u7ba1\u7406\u548c\u7f3a\u9677\u8ddf\u8e64\u7cfb\u7d71"},"content":{"rendered":"<h1 id=\"centos-8-%e4%b8%ad%e9%83%a8%e7%bd%b2-redmine-%e9%a0%85%e7%9b%ae%e7%ae%a1%e7%90%86%e5%92%8c%e7%bc%ba%e9%99%b7%e8%b7%9f%e8%b9%a4%e7%b3%bb%e7%b5%b1-gOvkxVfvbN\">CentOS 8 \u4e2d\u90e8\u7f72 Redmine \u9805\u76ee\u7ba1\u7406\u548c\u7f3a\u9677\u8ddf\u8e64\u7cfb\u7d71<\/h1>\n<p>Redmine \u662f\u4e00\u500b\u958b\u6e90\u7684\u9805\u76ee\u7ba1\u7406\u548c\u7f3a\u9677\u8ddf\u8e64\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u8edf\u4ef6\u958b\u767c\u548c\u5176\u4ed6\u9805\u76ee\u7ba1\u7406\u9818\u57df\u3002\u5b83\u652f\u6301\u591a\u7a2e\u7248\u672c\u63a7\u5236\u7cfb\u7d71\uff0c\u4e26\u63d0\u4f9b\u8c50\u5bcc\u7684\u529f\u80fd\uff0c\u5982\u65e5\u8a8c\u3001\u65e5\u66c6\u3001\u4efb\u52d9\u5206\u914d\u548c\u5831\u544a\u7b49\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 CentOS 8 \u4e0a\u90e8\u7f72 Redmine\uff0c\u5e6b\u52a9\u7528\u6236\u66f4\u6709\u6548\u5730\u7ba1\u7406\u9805\u76ee\u548c\u8ddf\u8e64\u7f3a\u9677\u3002<\/p>\n<h2 id=\"%e7%b3%bb%e7%b5%b1%e9%9c%80%e6%b1%82-gOvkxVfvbN\">\u7cfb\u7d71\u9700\u6c42<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u78ba\u4fdd\u60a8\u7684 CentOS 8 \u7cfb\u7d71\u6eff\u8db3\u4ee5\u4e0b\u9700\u6c42\uff1a<\/p>\n<ul>\n<li>\u81f3\u5c11 1 GB \u7684 RAM\uff08\u5efa\u8b70 2 GB \u6216\u66f4\u591a\uff09<\/li>\n<li>\u81f3\u5c11 1 GB \u7684\u53ef\u7528\u78c1\u789f\u7a7a\u9593<\/li>\n<li>\u5b89\u88dd\u4e86 Ruby\u3001Rails \u548c MySQL \u6216 PostgreSQL \u6578\u64da\u5eab<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-gOvkxVfvbN\">\u5b89\u88dd\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-gOvkxVfvbN\">1. \u66f4\u65b0\u7cfb\u7d71<\/h3>\n<pre><code>sudo dnf update -y<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d%e5%bf%85%e8%a6%81%e7%9a%84%e4%be%9d%e8%b3%b4%e5%8c%85-gOvkxVfvbN\">2. \u5b89\u88dd\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305<\/h3>\n<p>\u5728\u5b89\u88dd Redmine \u4e4b\u524d\uff0c\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff1a<\/p>\n<pre><code>sudo dnf install -y gcc make mariadb-server mariadb-devel ruby ruby-devel rubygems<\/code><\/pre>\n<h3 id=\"3-%e5%ae%89%e8%a3%9d-rails-%e5%92%8c-bundler-gOvkxVfvbN\">3. \u5b89\u88dd Rails \u548c Bundler<\/h3>\n<p>\u63a5\u4e0b\u4f86\uff0c\u5b89\u88dd Rails \u548c Bundler\uff1a<\/p>\n<pre><code>gem install rails bundler<\/code><\/pre>\n<h3 id=\"4-%e5%89%b5%e5%bb%ba%e6%95%b8%e6%93%9a%e5%ba%ab-gOvkxVfvbN\">4. \u5275\u5efa\u6578\u64da\u5eab<\/h3>\n<p>\u555f\u52d5 MariaDB \u670d\u52d9\u4e26\u5275\u5efa\u4e00\u500b\u65b0\u7684\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>sudo systemctl start mariadb\nsudo mysql_secure_installation<\/code><\/pre>\n<p>\u7136\u5f8c\u767b\u9304 MariaDB \u4e26\u5275\u5efa\u6578\u64da\u5eab\u548c\u7528\u6236\uff1a<\/p>\n<pre><code>mysql -u root -p\nCREATE DATABASE redmine CHARACTER SET utf8mb4;\nCREATE USER 'redmineuser'@'localhost' IDENTIFIED BY 'your_password';\nGRANT ALL PRIVILEGES ON redmine.* TO 'redmineuser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<h3 id=\"5-%e4%b8%8b%e8%bc%89-redmine-gOvkxVfvbN\">5. \u4e0b\u8f09 Redmine<\/h3>\n<p>\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684 Redmine\uff1a<\/p>\n<pre><code>wget http:\/\/www.redmine.org\/releases\/redmine-4.2.3.tar.gz\ntar -xzf redmine-4.2.3.tar.gz\nsudo mv redmine-4.2.3 \/opt\/redmine<\/code><\/pre>\n<h3 id=\"6-%e9%85%8d%e7%bd%ae-redmine-gOvkxVfvbN\">6. \u914d\u7f6e Redmine<\/h3>\n<p>\u9032\u5165 Redmine \u76ee\u9304\u4e26\u8907\u88fd\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>cd \/opt\/redmine\ncp config\/database.yml.example config\/database.yml<\/code><\/pre>\n<p>\u7de8\u8f2f <code>database.yml<\/code> \u6587\u4ef6\uff0c\u586b\u5165\u6578\u64da\u5eab\u4fe1\u606f\uff1a<\/p>\n<pre><code>nano config\/database.yml<\/code><\/pre>\n<p>\u5c07 <code>production<\/code> \u90e8\u5206\u4fee\u6539\u70ba\uff1a<\/p>\n<pre><code>production:\n  adapter: mysql2\n  database: redmine\n  host: localhost\n  username: redmineuser\n  password: \"your_password\"\n  encoding: utf8mb4<\/code><\/pre>\n<h3 id=\"7-%e5%ae%89%e8%a3%9d-gems-gOvkxVfvbN\">7. \u5b89\u88dd Gems<\/h3>\n<p>\u4f7f\u7528 Bundler \u5b89\u88dd\u6240\u9700\u7684 Gems\uff1a<\/p>\n<pre><code>bundle install --without development test<\/code><\/pre>\n<h3 id=\"8-%e5%88%9d%e5%a7%8b%e5%8c%96%e6%95%b8%e6%93%9a%e5%ba%ab-gOvkxVfvbN\">8. \u521d\u59cb\u5316\u6578\u64da\u5eab<\/h3>\n<p>\u521d\u59cb\u5316\u6578\u64da\u5eab\u4e26\u5275\u5efa\u5fc5\u8981\u7684\u8868\uff1a<\/p>\n<pre><code>RAILS_ENV=production bundle exec rake db:migrate\nRAILS_ENV=production bundle exec rake redmine:load_default_data<\/code><\/pre>\n<h3 id=\"9-%e5%95%9f%e5%8b%95-redmine-gOvkxVfvbN\">9. \u555f\u52d5 Redmine<\/h3>\n<p>\u6700\u5f8c\uff0c\u555f\u52d5 Redmine \u670d\u52d9\uff1a<\/p>\n<pre><code>RAILS_ENV=production bundle exec rails server -b 0.0.0.0<\/code><\/pre>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f <code>http:\/\/your_server_ip:3000<\/code> \u4f86\u8a2a\u554f Redmine\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-gOvkxVfvbN\">\u7e3d\u7d50<\/h2>\n<p>\u5728 CentOS 8 \u4e0a\u90e8\u7f72 Redmine \u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\uff0c\u901a\u904e\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u60a8\u53ef\u4ee5\u5feb\u901f\u642d\u5efa\u4e00\u500b\u529f\u80fd\u5f37\u5927\u7684\u9805\u76ee\u7ba1\u7406\u548c\u7f3a\u9677\u8ddf\u8e64\u7cfb\u7d71\u3002\u7121\u8ad6\u662f\u5c0f\u578b\u5718\u968a\u9084\u662f\u5927\u578b\u4f01\u696d\uff0cRedmine \u90fd\u80fd\u5e6b\u52a9\u60a8\u66f4\u597d\u5730\u7ba1\u7406\u9805\u76ee\u548c\u8ddf\u8e64\u554f\u984c\u3002\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u74b0\u5883\u4f86\u904b\u884c Redmine\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u4ee5\u78ba\u4fdd\u9ad8\u6548\u7684\u6027\u80fd\u548c\u53ef\u9760\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 CentOS 8 \u4e0a\u90e8\u7f72 Redmine \u9805\u76ee\u7ba1\u7406\u548c\u7f3a\u9677\u8ddf\u8e64\u7cfb\u7d71\uff0c\u8f15\u9b06\u7ba1\u7406\u9805\u76ee\u3001\u4efb\u52d9\u548c\u7f3a\u9677\uff0c\u63d0\u5347\u5718\u968a\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-43434","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=43434"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43434\/revisions"}],"predecessor-version":[{"id":43435,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/43434\/revisions\/43435"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=43434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=43434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=43434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}