Total Pageviews

Monday 5 May 2014

在linux vps上搭建基于rails和mysql数据库的博客程序-publify

git clone https://github.com/publify/publify publify-site
cd publify-site


as3:~/publify-site# ls
app        config.ru  Gemfile       log          Rakefile      script  tmp
CHANGELOG  db         Gemfile.lock  MIT-LICENSE  README.md     spec    TODO.txt
config     doc        lib           public       rspec.sample  themes
as3:~/publify-site# cd config
as3:~/publify-site/config# ls
application.rb      database.yml.postgresql  filemanager.yml   routes.rb
boot.rb             database.yml.sqlite      initializers      secret.token
        environment.rb           locales           timezone.yml.jst
database.yml.mysql  environments             mail.yml.example
as3:~/publify-site/config# cp database.yml.mysql database.yml
as3:~/publify-site/config# ls
application.rb      database.yml.postgresql  filemanager.yml   routes.rb
boot.rb             database.yml.sqlite      initializers      secret.token
database.yml        environment.rb           locales           timezone.yml.jst
database.yml.mysql  environments             mail.yml.example
as3:~/publify-site/config# nano database.yml
as3:~/publify-site/config# cat database.yml
login: &login
  adapter: mysql2
  host: localhost
  username: root
  password: 此处写你的数据库密码


development:
  database: publify_dev
  <<: *login

test:
  database: publify_tests
  <<: *login

production:
  database: publify (此处写你的数据库名)
  <<: *login
as3:~/publify-site/config# cd ..
as3:~/publify-site# bundle install
as3:~/publify-site# bundle exec rake db:create
as3:~/publify-site# bundle exec rake db:migrate
as3:~/publify-site# bundle exec rake db:seed
as3:~/publify-site# nohup rails server -p 3036 > /dev/null &
然后访问http://as3.brite.biz:3036/,按页面的提示完成安装。完成安装后,就自动登录后台了,
登录后台之后,请记得修改密码,因为我也不知道初始密码。用户名为admin

DEMO SITE: http://as3.brite.biz:3036/
登录地址:http://as3.brite.biz:3036/admin
项目地址:https://github.com/publify/publify
只是不知发表后,文章的内容怎么会重复一次。
PS:知道怎么不让文章的内容重复了,
as3:~/publify-site# nano app/views/articles/_full_article_content.html.erb 
删除<%= article.html(:body) %>这行即可。