Ubuntu Server Guide Changes, errors and bugs
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
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: 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. 302 |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling