Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7721631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:58:21+00:00 2026-06-01T03:58:21+00:00

I have just created my first Rightscale ServerTemplate and Deployment using a bunch of

  • 0

I have just created my first Rightscale ServerTemplate and Deployment using a bunch of Rightscripts. One of the scripts I created was to add a virtual host to apache.

#!/bin/bash -e

if [ $RS_DISTRO = ubuntu ]; then 
  export apache=apache2
  export apache_extra_conf_dir=/etc/apache2/conf.d
elif [ $RS_DISTRO = centos ]; then
  export apache=httpd
  export apache_extra_conf_dir=/etc/httpd/conf.d
fi
server_name=$SERVER_NAME

echo "Adding virtual hosts to ${apache_extra_conf_dir}/vh-${server_name}.conf"
cat > $apache_extra_conf_dir/vh-${server_name}.conf <<EOF 

NameVirtualHost $SITE_IP:$SITE_PORT

<VirtualHost $SITE_IP:$SITE_PORT>
    ServerName $SERVER_NAME
    ServerAlias $SITE_DOMAIN *.$SITE_DOMAIN
    UseCanonicalName Off

    ServerAdmin $ADMIN_EMAIL
    DocumentRoot $APACHE_WWW_DIR
    <Directory "$APACHE_WWW_DIR">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
EOF

service $apache restart
exit 0

My question is can I use the same Rightscript twice on the ServerTemplate but set different inputs for each (IP, Port, www dir and Servername)? eg.

ServerTemplate:

Execute Rightscript vhost: *:80 /www-x/ x.com 
Execute Rightscript vhost: *:80 /www-y/ y.com

OR do I have to create a special Rightscript just for this server deployment that has both virtual hosts defined in the same script?

Execute Rightscript vhost: *:80 /www-x/ x.com | *:80 /www-y/ y.com
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:58:22+00:00Added an answer on June 1, 2026 at 3:58 am

    You can use the same RightScript with different inputs only if you put that script in the “Operational Scripts” section of your ServerTemplate. Then if you leave the inputs blank, you can execute that operational script with different inputs many times.

    If you want that behavior in the “Boot Scripts” section, you’ll have to either create a single script which handles two sets of inputs (for two vhosts) or create a clone of the RightScript with a different name and different input names.

    You might consider taking a look at the Chef based tools. You can create a Chef recipe which takes an array of vhost names as input, then executes the “apache_site” resource that sets up a vhost. You can see an example in the RightScale Chef code linked below.

    https://github.com/rightscale/cookbooks_public/blob/master/cookbooks/web_apache/recipes/setup_frontend_http_vhost.rb

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just created a report in Report Manager using a Stored Procedure which
I have just created a GIT on a folder. I now want to add
I have just created my first git repository for some software my company writes.
I have just created a mid-sized web-application using Java, a custom MVC framework, javascript.
I'm very new with iOS Development and I have just created one of my
I have an ASP.NET MVC 3 project that I just created using the project
I have just created my first WCF service. Now I would like to do
I have just started into OO PHP and have created my first class. As
I'm new to Java. I just created my first Java application using NetBeans. Here's
I'm using VS 2010 Pro. First, C doesn't have a bool type? I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.