Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This is a couple of years old, so it might need to be updated for a current Catalyst.
#!/bin/bash # APP_NAME is the Catalyst-normalized name of your app (lowercased, # +s/::/_/g) # i.e. the portion before "_create.pl" in scripts/*_create.pl APP_NAME=myapp APP_PATH=/var/www/MyApp APP_USER=apache FCGI_CONNECTION=/var/www/run/myapp.sock PID_PATH=/var/www/run/myapp.pid LOG_FILE=/var/log/httpd/myapp_error.log NPROC=4 case $1 in start) if [ -r "$PID_PATH" ] && kill -0 $(cat "$PID_PATH") >/dev/null 2>& +1 then echo "$APP_NAME is already running" exit 0 fi echo -n "Starting $APP_NAME (${APP_NAME}_fastcgi.pl)..." touch "$PID_PATH" chown "$APP_USER" "$PID_PATH" cd "$APP_PATH" su -c "\"script/${APP_NAME}_fastcgi.pl\"\\ --listen $FCGI_CONNECTION\\ --pidfile \"$PID_PATH\"\\ --nproc $NPROC\\ --daemon" "$APP_USER" 2>>"$LOG_FILE" # --keeperr\\ # Wait for the app to start TIMEOUT=10; while [ ! -r "$PID_PATH" ] && ! kill -0 $(cat "$PID_PA +TH") do echo -n '.'; sleep 1; TIMEOUT=$((TIMEOUT - 1)) if [ $TIMEOUT = 0 ]; then echo " ERROR: TIMED OUT"; exit 0 fi done echo " started." ;; stop) echo -n "Stopping PROD $APP_NAME: " if [ -r "$PID_PATH" ] && kill -0 $(cat "$PID_PATH") >/dev/null 2>& +1 then PID=`cat $PID_PATH` echo -n "killing $PID... "; kill $PID echo -n "OK. Waiting for the FastCGI server to release the soc +ket..." TIMEOUT=60 while netstat -xnl | grep -q $FCGI_CONNECTION; do echo -n "."; sleep 1; TIMEOUT=$((TIMEOUT - 1)) if [ $TIMEOUT = 0 ]; then echo " ERROR: TIMED OUT"; exit 0 fi done echo " OK." else echo "$APP_NAME not running." fi ;; restart|force-reload) $0 stop echo -n "Wait two... "; sleep 2; echo "done." $0 start ;; *) echo "Usage: $0 { stop | start | restart }" exit 1 ;; esac
FastCGIExternalServer /var/www/run/myapp.fcgi -socket /var/www/run/mya +pp.sock # start it with: /etc/init.d/MyApp start # better, configure under monit <VirtualHost *:80> ServerAdmin me@mydomain.com ServerName virthostname.org ServerAlias www.virthostname.org ErrorLog /var/log/httpd/myapp_error_log TransferLog /var/log/httpd/myapp_access_log DocumentRoot /var/www/MyApp Alias /static /var/www/MyApp/root/static Alias / /var/www/run/myapp.fcgi/ <Directory /var/www/MyApp> Options Indexes FollowSymLinks ExecCGI AllowOverride All </Directory> <Directory /var/www/MyApp/root/static> allow from all </Directory> <Location /static> SetHandler default-handler </Location> RewriteEngine On # Rewrite known static files to /static/ RewriteRule ^/favicon.ico /static/favicon.ico [L,R] RewriteRule ^/robots.txt /static/robots.txt [L,R] </VirtualHost>

In reply to Re: Deploy Catalyst application. by keszler
in thread Deploy Catalyst application. by code-ninja

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-23 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found