亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

How To Deploy on Bluehost

系統 2177 0

I’ve noticed a lot of people asking about this one (probable because Bluehost is so cheap :) Its pretty similar to many others, but there are a few tricks.

SSH Access, and installing the gem

Because Bluehost doesn’t allow shell access by default, you have to request it. See this article . You will need to have shell access to install the radiant gem and to run the rake tasks that will get your mysql database ready for action.

Once you have access, set up your bash profile so that it knows where gems go. Open up your root directory via ssh or ftp, and edit your .bashrc file to look like this (you might want to make a backup copy just in case):

    
      
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

export PATH="$PATH:$HOME/packages/bin:$HOME/.gems/bin"
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
export GEM_CACHE="$GEM_HOME/cache"

Then, create a file in that same root directory called .gemrc , and give it the following contents, replacing [YOUR_USERNAME] with… your username (the one that is your domain name, or at least the first seven letters of it).

    
      
gemhome: /home/[YOUR_USERNAME]/ruby/gems
gempath:
- /home/[YOUR_USERNAME]/ruby/gems
- /usr/lib/ruby/gems/1.8

Now you should be ready to install the Radiant gem. Log in via SSH. ( more on SSH + Bluehost ) (if you are on a mac, just type ssh yourusername@yourdomain.com into terminal) Once logged in, you can type gem list to see which gems are already installed, and make sure RubyGems is functioning properly. Then do:

    
      
% gem install radiant

This will install the gem on your account so that it can power your app once you put it on there.

Making your Radiant project

Since Bluehost has restrictions on what you can do with your ssh connection, it’s easiest to create your Radiant project locally and then move the files over manually. If you don’t have Radiant installed on your machine, install it with RubyGems by running the shell command % gem install radiant or % sudo gem install radiant (some linux machines restrict access to certain folders if you aren’t the root user, and sudo temporarily gives you that status.

Then create your app by doing:

    
      
$ radiant --database mysql WebsiteName

This will create a folder called WebsiteName (call it whatever you want) that contains all of the files for your app.

Edit the proper files within your app, then upload it

1. database.yml (in the config folder)

Put your newly created database name, username, and password into database.yml for the Production database.

2. environments.rb (in the config folder)

Uncomment the line ENV['RAILS_ENV'] ||= 'production'

3. .htaccess (in the public folder)

Replace the first four lines with this code: (notice that it says fcgid-script , not fastcgi-script or fcgi-script )

    
      
# General Apache options
AddHandler fcgid-script .fcgi
#AddHandler cgi-script .cgi
# Options +FollowSymLinks +ExecFCGI

(if you get the “Rails application failed..” when we get to that point, you can also try enabling this handler within cPanel under “Apache handlers.”)

4. dispatch.fcgi (in the config folder)

Change the first line (shebang) to #!/ramdisk/bin/ruby (note: this is not what is listed in their help section for the path to ruby. If you want to be sure you are using the right one, enter which ruby at your ssh prompt.) Then put the following before the require statements, replacing [USER_NAME] with your account user name:

    
      
ENV['RAILS_ENV'] = 'production'
ENV["GEM_HOME"]= "/home/[USER_NAME]/ruby/gems"
ENV["GEM_PATH"]= "/home/[USER_NAME]/ruby/gems:/usr/lib/ruby/gems/1.8"

Use your ftp client to transfer the folder that contains your Radiant app into your root directory on Bluehost (NOT in public_html—we don’t want people to see all of these files, especially database.yml).

Create your MySql database

Go to the “MySql Databases” tab in cPanel, and create a new database. Then create a user and password (with all permissions), and assign it to that database. Note that Bluehost appends your username to these, so you will end up with username_database and username_user. In the past I was only able to access MySql databases with my account username and password, but this appears to be fixed.

Run the rake task

With your ssh connection, navigate into the main directory of your app, and then run:

    
      
% rake production db:bootstrap

Follow the simple steps to create the first Radiant user and it will deal with creating all of the database tables for you. You can choose to create an empty site or a blog (if you are new to radiant, looking at the default code for the blog is a great way to see how clever you can be with radius tags )

Create a symlink

In the same ssh window, while in your account’s root directory, do

    
      
% ln -s ~/radiant_app_folder_name/public ~/public_html/website_name

This will place a folder in your public_html folder that will appear to contain what your app’s “public” folder contains. You should now be able to navigate to yourdomain.com/website_name and see your brand new Radiant install.

note: If this doesn’t work, let me know: nevin dot freeman at g_mail. It was a headache of trial and error for me, and I want this article to save time for future radiant users.

?

?原文: http://wiki.radiantcms.org/How_To_Deploy_on_Bluehost

How To Deploy on Bluehost


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美国产精品一区二区免费 | 午夜影院操一 | 日韩 欧美 中文字幕 不卡 | 香蕉网伊在线中文慕大全 | 亚洲国产日韩a在线亚洲 | 九久久 | 激情 婷婷 | 欧美成人交tv免费观看 | 国产高清国产精品国产k | 97精品国产91久久久久久 | 国产尤物精品视频 | 精品欧美一区手机在线观看 | 久久久久久久性 | 亚洲精品人成在线观看 | 久草在线观看资源 | 国产国语对白一级毛片 | 国产一区二区精品久久凹凸 | 免费网站看v片在线成人国产系列 | 久草综合在线视频 | 日本免费不卡视频一区二区三区 | 精品一区二区视频在线观看 | 五月伊人 | 日韩亚洲成a人片在线观看 日韩亚洲第一页 | 亚洲爽爽| 国内精品免费视频 | 天天综合天天综合色在线 | 一区二区在线不卡 | 超激情碰碰碰啪在线视频 | 国产成人啪午夜精品网站男同 | 成熟热自由日本语亚洲人 | 国产精品久久久久久久9999 | 四虎永久在线精品视频播放 | c看欧美激情毛片 | 91精品国产91久久久久久青草 | 毛片特级 | 成人午夜精品久久久久久久小说 | 欧美日韩一区二区三区麻豆 | 亚洲七七久久综合桃花 | 久久久全国免费视频 | 在线欧美v日韩v国产精品v | 久久国产精品影院 |