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@googlegroups.com.
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.

Search Discussions

  • Frederick Cheung at Nov 15, 2011 at 1:20 pm

    On Nov 15, 7:37 am, Erwin 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@googlegroups.com.
    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 at Nov 15, 2011 at 7:06 pm
    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 wrote:
    On Nov 15, 7:37 am, Erwin 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@googlegroups.com.
    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 at Nov 16, 2011 at 6:25 am

    2011/11/15 Erwin <yves_dufour@mac.com>:
    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@googlegroups.com.
    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 at Nov 16, 2011 at 7:38 am
    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 wrote:
    2011/11/15 Erwin <yves_duf...@mac.com>:
    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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 15, '11 at 7:37a
activeNov 16, '11 at 7:38a
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase