This forum is no longer active. Please post your questions to our new community site
problem working with stylesheets
|
|
Hello, |
|
|
Hi edgo, You may try configuring Apache so it takes care of sending any application static files (the ones in public/*) directly. Adding something similar to this in apache configuration: Alias /appname "${rails_application_dir}/public"
<Directory "${rails_application_dir}/public">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Paths inside public directory that can be served directly by Apache
ProxyPass /appname/stylesheets !
ProxyPass /appname/javascripts !
ProxyPass /appname/images !
# ...
ProxyPass /appname balancer://appcluster
ProxyPassReverse /appname balancer://appcluster
<Proxy balancer://appcluster>
# Proxy entries for each of mongrel
BalancerMember http://127.0.0.1:3001/appname
BalancerMember http://127.0.0.1:3002/appname
# ...
</Proxy>
You can find more details in this tutorial where we describe different ways to deploy your application on top of RubyStack using Mongrel, Thin or Passenger. I hope it helps |
|
|
Hi carlos, |
|
|
Hi edgo, The configuration I posted before is intended to make your application run with a prefix. In this case the urls will take the form: http ://host:8080/appname/:controller/:action/:id.:format where appname is the prefix used in apache and mongrels configuration. This is the approach we follow with our modules so you are able to have multiple applications running. In this case, you have to start the mongrels with “—prefix appname” option: mongrel_rails cluster::configure -e production -p 3001 -N 5 -C ${rails_application_dir}/config/mongrel_cluster.yml --prefix appname
You can find more details about this command in the tutorial I posted before If you want to have your application in the root directory and have urls like: http ://host:8080/:controller/:action/:id.:format Then you should use a different approach:
After this, you should have something similar to this: DocumentRoot "${rails_application_dir}/public"
<Directory "${rails_application_dir}/public">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Paths inside "public" directory that can be served directly by Apache
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass /images !
# ...
ProxyPass / balancer://appcluster/
ProxyPassReverse / balancer://appcluster/
<Proxy balancer://appcluster/>
# Proxy entries for each of mongrel
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
# ...
</Proxy>
Let us know if you find any issues |

