Ubuntu Server Guide
Download 1.23 Mb. Pdf ko'rish
|
ubuntu-server-guide (1)
Configuration
Web Server Modify the /etc/apache2/sites−available/000−default.conf configuration file to setup your domains. The first thing to change is the DocumentRoot directive: 285 DocumentRoot / path / t o / r a i l s / a p p l i c a t i o n / p u b l i c Next, change the Options I n d e x e s FollowSymLinks MultiViews ExecCGI A l l o w O v e r r i d e A l l Order a l l o w , deny a l l o w from a l l AddHandler c g i −s c r i p t . c g i You should also enable the mod_rewrite module for Apache. To enable mod_rewrite module, please enter the following command in a terminal prompt: sudo a2enmod r e w r i t e Finally you will need to change the ownership of the /path/to/rails/application/public and /path/to/rails/ application/tmp directories to the user used to run the Apache process: sudo chown −R www−data :www−data / path / t o / r a i l s / a p p l i c a t i o n / p u b l i c sudo chown −R www−data :www−data / path / t o / r a i l s / a p p l i c a t i o n /tmp If you need to compile your application assets run the following command in your application directory: RAILS_ENV=p r o d u c t i o n r a k e a s s e t s : p r e c o m p i l e Database With your database service in place you need to make sure your app database configuration is also correct. For example, if you are using MySQL your config/database.yml should look like this: # Mysql p r o d u c t i o n : a d a p t e r : mysql2 username : u s e r password : password h o s t : 1 2 7 . 0 . 0 . 1 d a t a b a s e : app To finally create your application database and apply its migrations you can run the following commands from your app directory: RAILS_ENV=p r o d u c t i o n r a k e db : c r e a t e RAILS_ENV=p r o d u c t i o n r a k e db : m i g r a t e That’s it! Now you have your Server ready for your Ruby on Rails application. You can daemonize your application as you want. References • See the Ruby on Rails website for more information. • Also Agile Development with Rails is a great resource. 286 Backups There are many ways to backup an Ubuntu installation. The most important thing about backups is to develop a backup plan consisting of what to backup, where to back it up to, and how to restore it. It is good practice to take backup media off-site in case of a disaster. For backup plans involving physical tape or removable hard drives, the tapes or drives can be manually taken off-site, but in other cases this may not be practical and the archives will need copied over a WAN link to a server in another location. Download 1.23 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling