Installing and configuring Turkopticon on BlueHost or HostMonster M. Six Silberman 26 Jul 2013 Turkopticon is a Rails 2.1.2 application. To set it up on BlueHost or HostMonster, do the following (details below). 1. Install Rails 2.1.2. 2. Create a new Rails application. 3. Configure the new Rails application to work on the server. 3.1. Create a new subdomain. 3.2. Remove the subdirectory of ~/public_html/ corresponding to the subdomain and replace it with a symbolic link to the public/ subdirectory of the Rails application. 3.3. Create a new MySQL database and user and grant the user appropriate privileges. 3.4. Edit config/database.yml to add the appropriate database and user details. 3.5. Add an appropriate .htaccess file to the public/ subdirectory of the Rails application. 3.6. Add GEM_HOME, GEM_PATH, and GEM_CACHE to the environment, and update PATH. 3.7. Remove public/index.html. 3.8. Add a simple controller, action, and route to test the application. 4. Install the annotate_models plugin (for convenience). 5. Install HAML. 6. Install ferret and acts_as_ferret. 7. Change line 1 of config/initializers/log.rb as appropriate. 8. Copy the codebase. 9. Edit config/database.yml again. 10. Edit config/environment.rb to include HAML. 11. Load the database. 12. Rebuild the index. 13. Restart the server and test the application. 14. Add cron jobs. 15. Configure and test email. 1. Install Rails 2.1.2. $ gem install rails --version=2.1.2 --verbose --no-rdoc --no-ri 2. Create a new Rails application. $ cd $ rails _2.1.2_ turkopticon 3. Configure the new Rails application to work on the server. 3.1. Create a new subdomain (e.g., via cPanel). 3.2. Remove the subdirectory of ~/public_html/ corresponding to the subdomain and replace it with a symbolic link to the public/ subdirectory of the Rails application. $ cd ~/public_html $ rm -rf turkopticon $ ln -s ../turkopticon/public turkopticon 3.3. Create a new MySQL database and user and grant the user appropriate privileges (e.g., via cPanel). 3.4. Edit config/database.yml to add the appropriate database and user details. For example: development: adapter: mysql database: turkopticon_devel host: localhost username: turkopticon_devel_user password: p00tp00t production: adapter: mysql database: turkopticon_prod host: localhost username: turkopticon_prod_user password: p00tp00tp00t 3.5. Add an appropriate .htaccess file to the public/ subdirectory of the Rails application. For example, for Passenger: Options -MultiViews PassengerResolveSymlinksInDocumentRoot on RailsEnv development RailsBaseURI / SetEnv GEM_HOME /home/user/ruby/gems or for FastCGI: AddHandler fcgid-script .fcgi Options +SymLinksIfOwnerMatch +ExecCGI RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] ErrorDocument 500 "