安装redmine依赖的所有ruby包

cd ..

gem install bundler #注意是在网站根目录下执行

bundle install --without development test rmagick #完成redmine依赖包的安装

bundler是用来管理ruby的包依赖的工具

为Rails生成cookies秘钥

rake generate_secret_token

创建数据库结构

RAILS_ENV=production rake db:migrate

生成缺省数据

RAILS_ENV=production REDMINE_LANG=zh rake redmine:load_default_data

调整文件系统权限

cd /data/wwwroot/redmine

mkdir -p tmp tmp/pdf public/plugin_assets

chown -R www.www /data/wwwroot/redmine

tmp和tmp/pdf (若不存在则创建该路径,用于生成 PDF 文件);public/plugin_assets (若不存在则创建该路径,plugins资源)

在WEBrick服务上测试 Redmine 是否安装成功

# vi /etc/passwd #使www用户有bash权限,lnmp脚本安装www用户没有bash权限

www:x:501:501::/home/www:/bin/bash

# su www -c "ruby script/rails server webrick -e production -d"

地址:http://IP:3000 (注意:打开iptables 3000端口号)

缺省管理员用户:

login: admin

password: admin

如果验证成功,则继续下面的步骤来使 Redmine 运行在Apache服务上

配置 Redmine 在Nginx上运行

结束webrick服务

cd /data/wwwroot/redmine/public/

cp dispatch.fcgi.example dispatch.fcgi

cp htaccess.fcgi.example .htaccess

chown -R www.www ./*

安装Passenger(用于整合Nginx)

gem install passenger

passenger-install-nginx-module

重新编译Nginx

cd ~/lnmp/src

cd nginx-1.6.2

/usr/local/nginx/sbin/nginx -V #查看已经编译参数

#在其后加上--add-module=/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-4.0.57/src/nginx_module参数,我的编译参数如下

./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/
src/nginx_module
make mv /usr/local/nginx/sbin/nginx{,_`date +%m%d`} cp objscp objs/nginx /usr/local/nginx/sbin/

配置Nginx

vi /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;

添加虚拟主机(/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;

}

upstream redmine{
  server 127.0.0.1:8000;
}
server {
l  isten 80;
  server_name redmine.happycity777.com;

  root /home/www/redmine/public;

  index index.html index.htm index.php;
  location / {
    try_files $uri @redmine;
  }
  location @redmine {
    proxy_pass http://redmine;
    proxy_redirect off;
    proxy_set_header Host $host; #注:这个不传进去,会暴露端口号,且会影响速度
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    # 如果找不到真实存在的文件,把请求分发至 index.php
    # try_files $uri $uri/ /index.php?$args;
  }

}

 

Nginx下Redmine配置的更多相关文章

  1. nginx下如何配置 ssl证书?腾讯云ssl证书为例!

    nginx下如何配置 ssl证书?腾讯云ssl证书为例! 目前为止,https已经成为一种趋势,想要开启https就需要ssl证书. 首先,为域名注册ssl证书. 腾讯云注册地址:https://cl ...

  2. 【转】Nginx 学习笔记(十一)nginx下安装配置naxsi waf防火墙(附完整编译、配置)

    原文地址:http://f2ex.cn/nginx-installed-configuration-naxsi-waf/ Naxsi 是第三方 nginx 模块 ,它和 Modsecurity 都是开 ...

  3. thinkphp3.2在nginx下的配置

    最近一直没用nginx 昨天将tp3.2的项目部署到Ubuntu下的nginx下,发现忘记怎么配置的了 特将配置方式记录下来,以方便日后查找 服务器nignx 配置文件 server { listen ...

  4. CodeIgniter框架——nginx下的配置

    odeigniter(CI)是一个轻量型的PHP优秀框架,但是它是在apache服务器下开发的,在nginx下需要特别的配置才可以使用. 对nginx的配置如下: server { listen 80 ...

  5. nginx 下 location 配置解释

    当我们在使用负载均衡和反向代理的时候 我们会考到虚拟主机下面有着个配置 现在我们看一下反向代理的location 下面的配置实例: server { listen 80 ;    监听的端口号 ser ...

  6. 应用八:Vue之在nginx下的部署实践

    最近有时间研究了下前端项目如何在nginx服务器下进行部署,折腾了两天总算有所收获,汗~~ 所以就想着写篇文章来总结一下,主要包括以下三个方面: 1.打包好的vue项目如何进行部署. 2.如何反向代理 ...

  7. 如何在Nginx下配置PHP程序环境

    1.nginx与PHP的关系 首先来看nginx与php的关系, FastCGI的关系(而不是像apache那样安装成nginx的模块) FastCGI的意思是, 快速的通用网关接口:CGI Comm ...

  8. windows下nginx安装、配置与使用(转载)

    目前国内各大门户网站已经部署了Nginx,如新浪.网易.腾讯等:国内几个重要的视频分享网站也部署了Nginx,如六房间.酷6等.新近发现Nginx 技术在国内日趋火热,越来越多的网站开始部署Nginx ...

  9. nginx下目录浏览及其验证功能配置记录

    工作中常常有写不能有网页下载东西的需求,在Apache下搭建完成后直接导入文件即可达到下载/显示文件的效果;而Nginx的目录列表功能默认是关闭的,如果需要打开Nginx的目录列表功能,需要手动配置, ...

随机推荐

  1. R语言画图布局摆放(layout)

    require(ggplot2) require(Cairo) require(grid) p = ggplot(iris,aes(x = Species,y = Sepal.Length,colou ...

  2. MySQL常用技巧

    1.查看MySQL版本信息: 1,登上 mysql>status; 2,登上 mysql>select version(); 3,登上 mysql> select @@version ...

  3. Scribefire离线编写博客的方法

    用Firefox下载Scribefire next插件www.scribefire.com cnblogs添加方法: URL:http://www.cnblogs.com/[你的博客名] API为ht ...

  4. Neo4j 高可用集群安装

    安装neo4j高可用集群,抓图安装过程 http://www.ibm.com/developerworks/cn/java/j-lo-neo4j/ Step1.下载neo4j商业版并解压,复制为neo ...

  5. 数据库系统概论(第5版) P262 例8.12

    #include <iostream> #include <stdlib.h> #include <stdio.h> #include <Windows.h& ...

  6. LeetCode题解-----Majority Element II 摩尔投票法

    题目描述: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The a ...

  7. mysql查询语句包含有关键字

    查询mysql的时候,有时候mysql表名或者列名会有关键字.这时候查询会有错误.例如表名是order,查询时候会出错. 简单的办法是sql语句里表名或者列名加上`[tab键上面]来加以区别,例如se ...

  8. 每日一语:What is he getting at?

    What is he getting at? 他讲这话是什么意思? 2015-1-12

  9. 【mybatis】1、入门CURD基本操作(环境搭建)

    #1.基本环境 环境 版本 jdk 1.7.0_10 ide eclipse-jee-luna-SR2-win32-x86_64 maven 3.3.3 mybatis 3.2.7 mysql 5.1 ...

  10. 导航(NavanavigationController)push和pop

    //跳转到指定的控制器 for (UIViewController *Vc in self.navigationController.viewControllers) { if ([Vc isKind ...