Skip to content
Browse files

A few more tweaks

  • Loading branch information...
1 parent b919bfb commit 9ee55171c747760d8e8299006be5477d1f67c198 @boutell boutell committed Apr 23, 2012
Showing with 15 additions and 5 deletions.
  1. +10 −0
  2. +2 −2 example/deployment/settings
  3. +1 −1 example/deployment/settings.staging
  4. +1 −1 sc-proxy/sc-start-all
  5. +1 −1 sc-proxy/upstart/stagecoach.conf
@@ -85,13 +85,23 @@ The most convenient way to use `sc-proxy` is to set up a wildcard DNS "A" record
If `sc-proxy` is asked to access a site that isn't part of its current configuration, it will check whether that site has been added to `/var/webapps`. In addition, once a minute `sc-proxy` scans for any modifications to `/var/webapps`, on the off chance a site has been removed or reconfigured.
+Configuring sc-proxy
To configure `sc-proxy`, copy the file `config-example.js` to `config.js` and change the `domain` setting to match your needs. Also set `ip` to the IP address you want to listen on; you can set `` to respond on all interfaces, but that will conflict if you have an Apache server on the same system, so you should probably use a separate IP address just for your node projects (ask your web host for an extra IP address). You can also change the port from port 80 for testing purposes if you don't have an extra IP yet, although there is not much point in using `sc-proxy` if you don't plan to get one eventually and switch back to port 80.
+If Apache is on the same server, you will also need to configure Apache to listen on just one IP, or at any rate to not listen on the IP set aside for `sc-proxy`.
+Then cd to the `sc-proxy` folder and run:
+ npm install
The `sc-proxy` folder also contains an `upstart` script that can start and stop the proxy and the associated apps on an Ubuntu system. By copying this script to `/etc/init` on your Ubuntu system you can arrange for your proxy and web apps to be running at all times. You can also `start stagecoach` and `stop stagecoach` at any time (as root).
+* `start` script has to be able to tell if the job is already running via 'forever', otherwise forever will keep trying to run two copies
* Clean up the way `stop` is run so that we can skip it if there is no existing deployment. Right now this spews warnings on the first deploy (but still works just fine). This is tied to the task of making the remote commands in `sc-deploy` more readable and maintainable.
* Write `sc-rollback`, which will roll back one or more deployments. (You can already do that by changing the symbolic link, and `sc-deploy` doesn't make a new deployment live if anything went obviously wrong, but a tool for doing this manually with less effort would be nice.)
4 example/deployment/settings
@@ -14,8 +14,8 @@ DIR=/opt/stagecoach/apps/$PROJECT
#ADJUST_PATH='export PATH=/opt/local/bin:$PATH'
# ... But you probably won't need to on real servers. I just find it handy for
-# testing parts of stagecoach locally on a Mac
+# testing parts of stagecoach locally on a Mac. : is an acceptable "no-op" (do-nothing) statement
# ssh port. Sensible people leave this set to 22 but it's common to do the
# "security by obscurity" thing alas
2 example/deployment/settings.staging
@@ -6,4 +6,4 @@
# the server
2 sc-proxy/sc-start-all
@@ -7,6 +7,6 @@ source /opt/stagecoach/settings
for dir in `ls "$DIR/apps"`
echo "Launching $dir"
- (su $USER -c "cd $DIR/$dir/current; bash deployment/start")
+ (su $USER -c "cd $DIR/apps/$dir/current; bash deployment/start")
2 sc-proxy/upstart/stagecoach.conf
@@ -11,7 +11,7 @@ start on startup
stop on shutdown
- source /opt/stagecoach/sc-proxy/sc-start-all-and-proxy
+ source /opt/stagecoach/sc-proxy/sc-start-all
(cd /opt/stagecoach/sc-proxy; node `pwd`/server.js)
end script

0 comments on commit 9ee5517

Please sign in to comment.
Something went wrong with that request. Please try again.