0 Star 0 Fork 8

村南一枝花 / blog

forked from fxhover / blog 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

#Blog演示页面

##首页

首页

##博文列表

文章列表

##写博客页面

写博客

##文章详情页面

文章详情

##设置页面

设置头像

设置博客

#Blog部署文档#

##环境 git、ruby 2.1.2、rails 4.1.5、nginx 1.2+、mysql 5.0+

##下载代码##

git clone git@github.com:fxhover/blog.git

##安装ruby依赖类库##

bundle exec bundle install

##配置文件##

cd blog

cp config/database.yml.example config/database.yml 修改数据库配置信息

cp config/secrets.yml.example config/secrets.yml

cp config/blog.yml.example config/blog.yml 修改好博客配置信息

cp config/unicorn.rb.example config/unicorn.rb 修改unicorn配置文件,配置应用目录等信息

##执行数据脚本##

RAILS_ENV=production bundle exec rake db:create  创建数据库

RAILS_ENV=production bundle exec rake db:migrate 创建表及索引

RAILS_ENV=production bundle exec rake db:seed 创建默认分类和管理员账号,编辑 db/seeds.rb可以修改默认分类和管理员账号密码,然后再执行

##预编译前端资源##

RAILS_ENV=production bundle exec rake assets:clean

RAILS_ENV=production bundle exec rake assets:precompile

##启动##

###创建服务用到的文件夹### mkdir -p tmp/pids

mkdir -p log 

###拷贝启动服务文件###

sudo cp deployment/init.d/blog /etc/init.d 编辑文件中的app目录和sudo user的配置

###启动blog服务###

sudo service blog start

sudo service blog stop/restart 停止或者重启服务

###nginx配置###

以下列出部分配置,完整配置见 deployment/nginx/nginx.conf文件

upstream blog {
    server unix:/home/fangxiang/blog/tmp/sockets/blog.socket;
}
server {
    listen 80;
    server_name blog.com;
    root /home/fangxiang/blog/public;
    try_files $uri/index.html $uri.html $uri @user1;
    location @user1 {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Real-Ip $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_buffering on;
        proxy_pass http://blog;
    }
    location ~ ^(/assets) {
        access_log off;
        expires max;
    }

}

###重启nginx###

sudo service nginx restart

###绑定hosts

127.0.0.1  blog.com 

###访问###

http://blog.com
The MIT License (MIT) Copyright (c) 2014 fxhover Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个ruby on rails写的简单的开源blog程序,github查看最新代码:https://github.com/fxhover/blog 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/bruwayne/blog.git
git@gitee.com:bruwayne/blog.git
bruwayne
blog
blog
master

搜索帮助