国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Nginx > 正文

Nginx下Redmine2.6配置

2024-08-30 12:27:34
字體:
供稿:網(wǎng)友
Nginx下Redmine2.6配置

Apache下Redmine2.6配置,請(qǐng)參考:http://blog.linuxeye.com/405.htmlCentOS6.6下安裝Redmine2.6+MySQL5.6+Nginx,教程如下:1. 初始環(huán)境系統(tǒng)版本:CentOS-6.6-x86_64-minimal.iso安裝LNMP,參考《lnmp一鍵安裝包》;修改options.conf,home_dir=/data/wwwroot

2. ruby安裝

cd lnmp/srcwget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gztar xzf ruby-2.1.5.tar.gzcd ruby-2.1.5./configure --PRefix=/usr/local/rubymake && make installcd ..

添加到環(huán)境變量

vi /etc/profileexport PATH=/usr/local/ruby/bin:$PATH. /etc/profile

查看ruby版本號(hào)

# ruby -vruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]

3. 安裝rails

#安裝gemwget http://production.cf.rubygems.org/rubygems/rubygems-2.4.5.tgztar xzf rubygems-2.4.5.tgzcd rubygems-2.4.5ruby setup.rbcd ..

提示:gem是一種文件組織的包,一般的ruby的很多插件都有由這種各種的包提供。

# gem -v2.4.5# which gem/usr/local/ruby/bin/gem

由于國(guó)內(nèi)網(wǎng)絡(luò)原因(你懂的),導(dǎo)致rubygems.org存放 Amazon S3上面的資源文件間歇性連接失敗。所以你會(huì)與遇到gem install rack或bundle install的時(shí)候半天沒有響應(yīng),具體可以用gem install rails -V來查看執(zhí)行過程。下面替換成淘寶的GEM鏡像站:

# gem sources -l*** CURRENT SOURCES ***https://rubygems.org/# gem sources --remove https://rubygems.org/https://rubygems.org/ removed from sources# gem sources -a https://ruby.taobao.org/https://ruby.taobao.org/ added to sources# gem sources -l*** CURRENT SOURCES ***https://ruby.taobao.org/

Redmine需要考慮Ruby版本兼容性問題,請(qǐng)參考:Installing Redmine

Redmine versionSupported Ruby versionsRails version used
current trunkruby 1.9.3, 2.0.0, 2.1, jruby-1.7.6Rails 4.1
trunk < r13482ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, jruby-1.7.6Rails 3.2
2.5, 2.6ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, 2.1, jruby-1.7.6Rails 3.2
2.4ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, jruby-1.7.6Rails 3.2

Redmine選擇安裝2.6版本,因此rails安裝3.2版本

gem install rails -v=3.2# rails -vRails 3.2.19

4. 安裝redmine2.6

wget http://www.redmine.org/releases/redmine-2.6.1.tar.gztar xzf redmine-2.6.1.tar.gz -C /data/wwwrootmv /data/wwwroot/redmine{-2.6.1,}

創(chuàng)建redmine數(shù)據(jù)庫(kù)

cd /data/wwwroot/redmine# mysql -uroot -pmysql> create database redmine;

make sure to install the C bindings for Ruby that dramatically improve performance. You can get them by running gem install mysql2.

配置Redmine的database.yml

cd /data/wwwroot/redmine/configcp database.yml.example database.ymlcat database.yum #修改對(duì)應(yīng)數(shù)據(jù)庫(kù)連接信息production: adapter: mysql2 database: redmine host: localhost username: root passWord: "linuxeye" encoding: utf8

安裝redmine依賴的所有ruby包

cd ..gem install bundler #注意是在網(wǎng)站根目錄下執(zhí)行bundle install --without development test rmagick #完成redmine依賴包的安裝

bundler是用來管理ruby的包依賴的工具

為Rails生成cookies秘鑰

rake generate_secret_token

創(chuàng)建數(shù)據(jù)庫(kù)結(jié)構(gòu)

RAILS_ENV=production rake db:migrate

生成缺省數(shù)據(jù)

RAILS_ENV=production REDMINE_LANG=zh rake redmine:load_default_data

調(diào)整文件系統(tǒng)權(quán)限

cd /data/wwwroot/redminemkdir -p tmp tmp/pdf public/plugin_assetschown -R www.www /data/wwwroot/redmine

tmp和tmp/pdf (若不存在則創(chuàng)建該路徑,用于生成 PDF 文件);public/plugin_assets (若不存在則創(chuàng)建該路徑,plugins資源)

5. 在WEBrick服務(wù)上測(cè)試Redmine是否安裝成功

# vi /etc/passwd #使www用戶有bash權(quán)限,lnmp腳本安裝www用戶沒有bash權(quán)限www:x:501:501::/home/www:/bin/bash# su www -c "ruby script/rails server webrick -e production -d"

地址:http://IP:3000 (注意:打開iptables 3000端口號(hào))缺省管理員用戶:

  • login: admin
  • password: admin

如果驗(yàn)證成功,則繼續(xù)下面的步驟來使Redmine運(yùn)行在Apache服務(wù)上

6. 配置Redmine在Nginx上運(yùn)行結(jié)束webrick服務(wù)

cd /data/wwwroot/redmine/public/cp dispatch.fcgi.example dispatch.fcgicp htaccess.fcgi.example .htaccesschown -R www.www ./*

安裝Passenger(用于整合Nginx)

gem install passengerpassenger-install-nginx-module

重新編譯Nginx

cd ~/lnmp/srccd nginx-1.6.2/usr/local/nginx/sbin/nginx -V #查看已經(jīng)編譯參數(shù)#在其后加上--add-module=/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.57/ext/nginx參數(shù),我的編譯參數(shù)如下./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module /--with-http_spdy_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module /--with-http_flv_module --with-ld-opt=-ljemalloc /--add-module=/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.57/ext/nginxmakemv /usr/local/nginx/sbin/nginx{,_`date +%m%d`}cp objscp objs/nginx /usr/local/nginx/sbin/

配置Nginxvi /usr/local/nginx/conf/nginx.conf#在http {}直接添加

passenger_root /usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.57;passenger_ruby /usr/local/ruby/bin/ruby;

添加虛擬主機(jī)(/usr/local/nginx/conf/vhost/bugs.linuxeye.com.conf)如下:

server {listen 80;server_name bugs.linuxeye.com;access_log /data/wwwlogs/bugs.linuxeye.com_nginx.log combined;index index.html index.htm index.jsp index.php;include none.conf;root /data/wwwroot/redmine/public;passenger_enabled on;}

原文:http://blog.linuxeye.com/407.html


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 漳浦县| 隆德县| 奉化市| 皮山县| 舞阳县| 张北县| 鹤山市| 孟村| 吉安县| 长垣县| 锦州市| 尚义县| 南江县| 潜山县| 宁河县| 德江县| 大洼县| 巫溪县| 洛隆县| 静海县| 东辽县| 谷城县| 元朗区| 社旗县| 延川县| 正定县| 扶绥县| 阳春市| 南昌县| 舞钢市| 宿州市| 西城区| 内江市| 平谷区| 台州市| 连平县| 滕州市| 芜湖县| 和林格尔县| 霍城县| 名山县|