Nginx下Redmine配置
安装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 配置web服务
- linux下配置jdk+tomcat
- [转] Nginx 配置 SSL 证书 + 搭建 HTTPS 网站教程
- apache和nginx支持SSI配置
- Linux 配置静态IP
- SpringBoot2.0 基础案例(02):配置Log4j2,实现不同环境日志打印
- 菜鸟运维笔记:配置Apache二级域名及WWW訪问
- Linux 一对多配置日志服务器步骤教程
- Eureka:缓存细节以及生产环境的最佳配置
- application.properties中的list配置
- VMware提示:已将该虚拟机配置为使用 64 位客户机操作系统。但是,无法执行 64 位操作。解决方案
- Nginx 笔记与总结(3)配置虚拟主机
- Nginx 报错: nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory) 的解决方法
- Spring Boot中使用@Async的时候,千万别忘了线程池的配置!
- H3C路由器Telnet服务配置命令
- 配置获取隐私数据权限声明
- Jenkins配置报告与邮件插件
- webpack基础配置
- nginx使用ssl模块配置支持HTTPS访问【解决ssl错误】
- Nginx配置实现下载文件
- Vue路由history模式踩坑记录:nginx配置解决404问题
- python安装与配置
- Nginx之OCSP stapling配置
- Liunx下Tomcat+MYSQL+Nginx配置
- ingress nginx https配置
- 【TDA2x学习】Vision SDK 编译RTOS的配置
- 32位win7系统下配置IIS遇到php-cgi.exe - FastCGI 进程意外退出问题的解决的方法
- Nginx+Memcached+Tomcat集群配置
- ubuntu12.04 安装配置jdk1.7
- nginx基于端口的虚拟主机配置实战
- NAT反向转换基本配置详解
- Python自动化交易学习笔记(10)——1.添加卖出条件参数配置,2.交易单位大小
- Nginx反向代理配置