During execution in my Rails web app, I need to create a virtual host config on my Linux server, but I don''t know what would be the best way to do it , here are the steps ( my_domain.com is fixed, only my_subdomain is changing dynamically 1- create: /var/www/vhosts/my_domain.com/subdomains/my_subdomain/conf/ vhost.conf ServerName mysubdomain.mydomain.com .. content is always the same... 2 - run : sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain my_domain.com .. always the same command 3 - run : sudo /etc/init.d/apache2 reload What could be the best option to set/execute such script from my Rails web app ? any links ? thanks for your feedback and guidances [Running Rails 3.1.1/Ruby 1.9.3/ Debian 6 Squeeze] -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Nov-15 13:20 UTC
Re: Need some guidance on running shell commands from my app..
On Nov 15, 7:37 am, Erwin <yves_duf...-ee4meeAH724@public.gmane.org> wrote:> During execution in my Rails web app, I need to create a virtual host > config on my Linux server, but I don''t know what would be the best way > to do it , here are the steps ( my_domain.com is fixed, only > my_subdomain is changing dynamically >Not answering your question, but have you considered having a single wildcard virtual host (i.e. ServerName *.mydomain.com) rather than reconfiguring apache on the fly all the time? Fred> 1- create: /var/www/vhosts/my_domain.com/subdomains/my_subdomain/conf/ > vhost.conf > > ServerName mysubdomain.mydomain.com > .. content is always the same... > > 2 - run : sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain > my_domain.com > .. always the same command > > 3 - run : sudo /etc/init.d/apache2 reload > > What could be the best option to set/execute such script from my Rails > web app ? any links ? > thanks for your feedback and guidances > > [Running Rails 3.1.1/Ruby 1.9.3/ Debian 6 Squeeze]-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin
2011-Nov-15 18:54 UTC
Re: Need some guidance on running shell commands from my app..
thanks Fred , will give a try, I am using Apache behind Plesk ( to manage many subscription) , need to check if I can bypass it ... On Nov 15, 2:20 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 15, 7:37 am, Erwin <yves_duf...-ee4meeAH724@public.gmane.org> wrote:> During execution in my Rails web app, I need to create a virtual host > > config on my Linux server, but I don''t know what would be the best way > > to do it , here are the steps ( my_domain.com is fixed, only > > my_subdomain is changing dynamically > > Not answering your question, but have you considered having a single > wildcard virtual host (i.e. ServerName *.mydomain.com) rather than > reconfiguring apache on the fly all the time? > > Fred > > > > > > > > > 1- create: /var/www/vhosts/my_domain.com/subdomains/my_subdomain/conf/ > > vhost.conf > > > ServerName mysubdomain.mydomain.com > > .. content is always the same... > > > 2 - run : sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain > > my_domain.com > > .. always the same command > > > 3 - run : sudo /etc/init.d/apache2 reload > > > What could be the best option to set/execute such script from my Rails > > web app ? any links ? > > thanks for your feedback and guidances > > > [Running Rails 3.1.1/Ruby 1.9.3/ Debian 6 Squeeze]-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Norbert Melzer
2011-Nov-16 06:24 UTC
Re: Need some guidance on running shell commands from my app..
2011/11/15 Erwin <yves_dufour-ee4meeAH724@public.gmane.org>:> During execution in my Rails web app, I need to create a virtual host > config on my Linux server, but I don''t know what would be the best way > to do it , here are the steps ( my_domain.com is fixed, only > my_subdomain is changing dynamicallyI tried something similar in my PHP-days. You really should not do that! 1.) Plesk would not be aware of that subdomain 2.) Plesk could overwrite or delete the manually added configs when trying to add the subdomain in Plesk That are the main problems I stumbled upon that time. The way with wild card domains all going to your rails app are much better. But I cant remember how to set them up in Plesk. But with the Railspart <http://railscasts.com/episodes/123-subdomains> could help. HTH Norbert -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin
2011-Nov-16 07:29 UTC
Re: Need some guidance on running shell commands from my app..
Thanks Norbert I intended to use the Plesk API to add the new subdomain and the new subdomain ghost.conf, then exec reconfig domain and reload Apache... ( the way we use to do manually in Plesk console) but it''s quite heavy work... I found how to setup wild card w Plesk ... : http://kb.parallels.com/2239 (quite weird..) and it''s running fine .... can access any sub-domain.... Thanks a lot for your feedback ! On Nov 16, 7:24 am, Norbert Melzer <timmel...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2011/11/15 Erwin <yves_duf...-ee4meeAH724@public.gmane.org>: > > > During execution in my Rails web app, I need to create a virtual host > > config on my Linux server, but I don''t know what would be the best way > > to do it , here are the steps ( my_domain.com is fixed, only > > my_subdomain is changing dynamically > > I tried something similar in my PHP-days. > > You really should not do that! > > 1.) Plesk would not be aware of that subdomain > 2.) Plesk could overwrite or delete the manually added configs when > trying to add the subdomain in Plesk > > That are the main problems I stumbled upon that time. > > The way with wild card domains all going to your rails app are much > better. But I cant remember how to set them up in Plesk. > > But with the Railspart <http://railscasts.com/episodes/123-subdomains> > could help. > > HTH > Norbert-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.