Saturday, December 29, 2012

Deploying a Catalyst application with Starman and Apache on Linux

Go to your application directory and run this command, to run the server.

starman -I./lib --workers 1 --port 3000 myapp.psgi --log log/myapp.log --pid run/ --daemonize

Confirm that the PSGI server is running on the server by visiting http://localhost:3000.

Add this to your Apache configuration file. On centOS, you will find it at /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
    DocumentRoot /var/www/vhosts/myapp
    ErrorLog /var/log/httpd/error_log-myapp
    CustomLog /var/log/httpd/access_log-myapp common

    ProxyPreserveHost On
    ProxyPass / http://0:3000/
    ProxyPassReverse / http://0:3000/

Now, you should be able to visit from any browser.

No comments: