Difference between revisions of "Installing Pier on Ubuntu"

From Organic Design wiki
(start Pier manually)
m
Line 30: Line 30:
 
cd /var/www/domains/Pier.app
 
cd /var/www/domains/Pier.app
 
./Pier.sh
 
./Pier.sh
 +
}}
 +
 +
Set Up a Pier Image
 +
 +
    * Download Pier-2.0-OneClick.zip from http://www.piercms.com/download
 +
    * Unzip into any directory, but probably /var/www/domains/Pier.app for an OD install
 +
    * Change organicdesign.co.nz (below) to whatever your hostname is, localhost for a local setup
 +
    * As root, change ownership to www-data:
 +
 +
chown -R www-data:www-data Pier.app
 +
 +
    * Edit /etc/rc.local and add the following BASH script just before exit 0 (note you will need to change paths if you unzipped into a directory other than /var/www/domains)
 +
 +
#!/bin/bash
 +
# settings
 +
USER="www-data"
 +
VM="/var/www/domains/Pier.app/Contents/Linux/squeakvm"
 +
VM_PARAMS="-mmap 256m -vm-sound-null -vm-display-null"
 +
IMAGE="/var/www/domains/Pier.app/Contents/Resources/Pier.image"
 +
# start the vm
 +
exec \
 +
setuidgid "$USER" \
 +
"$VM" $VM_PARAMS "$IMAGE"
 +
 +
    * Restart
 +
    * Navigate to http://organicdesign.co.nz:8080
 +
    * To start Pier manually, as root:
 +
 +
cd /var/www/domains/Pier.app
 +
 +
./Pier.sh
 +
 +
 +
==Enable Pier Content Alongside Apache==
 +
 +
This is assuming an OD server, as above.
 +
 +
* Add pier.organicdesign.co.nz to /etc/hosts
 +
* As root, enable proxy:
 +
{{code |
 +
a2enmod proxy proxy_http
 +
}}
 +
* Then edit /etc/apache2/mods-enabled/proxy.conf, by adding Allow from organicdesign.co.nz as below:
 +
{{code |
 +
<nowiki>
 +
<IfModule mod_proxy.c>
 +
 +
# If you want to use apache2 as a forward proxy, uncomment the
 +
# 'ProxyRequests On' line and the <Proxy *> block below.
 +
# WARNING: Be careful to restrict access inside the <Proxy *> block.
 +
# Open proxy servers are dangerous both to your network and to the
 +
# Internet at large.
 +
#
 +
# If you only want to use apache2 as a reverse proxy/gateway in
 +
# front of some web application server, you DON'T need
 +
# 'ProxyRequests On'.
 +
 +
<Proxy *>
 +
        AddDefaultCharset off
 +
        Order deny,allow
 +
#        Deny from all
 +
#        Allow from .example.com
 +
        Allow from organicdesign.co.nz
 +
</Proxy>
 +
 +
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
 +
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
 +
# Set to one of: Off | On | Full | Block
 +
ProxyVia On
 +
 +
</IfModule>
 +
</nowiki>
 +
 +
}}
 +
 +
* Finally add, at the top of the mod_rewrite in /etc/apache2/sites-available/default, directly under RewriteEngine On:
 +
{{code |
 +
<nowiki>ProxyPreserveHost On
 +
RewriteCond %{HTTP_HOST} ^pier\.organicdesign.co.nz RewriteRule (.*) http://organicdesign.co.nz:8080/$1 [P,L] </nowiki>
 
}}
 
}}

Revision as of 23:54, 17 March 2011

Procedure.svg Installing Pier on Ubuntu
Organic Design procedure



Simple Setup of a Pier Image on a Webserver

  • Download Pier-2.0-OneClick.zip from http://www.piercms.com/download
  • Unzip into any directory, but probably /var/www/domains/Pier.app for an OD install
  • As root, change ownership to www-data:
chown -R www-data:www-data Pier.app
  • Edit /etc/rc.local and add the following BASH script just before exit 0 (note you will need to change paths if you unzipped into a directory other than /var/www/domains)
#!/bin/bash
# settings
USER="www-data"
VM="/var/www/domains/Pier.app/Contents/Linux/squeakvm"
VM_PARAMS="-mmap 256m -vm-sound-null -vm-display-null"
IMAGE="/var/www/domains/Pier.app/Contents/Resources/Pier.image"
# start the vm
exec \
setuidgid "$USER" \
"$VM" $VM_PARAMS "$IMAGE"
cd /var/www/domains/Pier.app

./Pier.sh

Set Up a Pier Image

   * Download Pier-2.0-OneClick.zip from http://www.piercms.com/download
   * Unzip into any directory, but probably /var/www/domains/Pier.app for an OD install
   * Change organicdesign.co.nz (below) to whatever your hostname is, localhost for a local setup
   * As root, change ownership to www-data: 

chown -R www-data:www-data Pier.app

   * Edit /etc/rc.local and add the following BASH script just before exit 0 (note you will need to change paths if you unzipped into a directory other than /var/www/domains) 
  1. !/bin/bash
  2. settings

USER="www-data" VM="/var/www/domains/Pier.app/Contents/Linux/squeakvm" VM_PARAMS="-mmap 256m -vm-sound-null -vm-display-null" IMAGE="/var/www/domains/Pier.app/Contents/Resources/Pier.image"

  1. start the vm

exec \ setuidgid "$USER" \ "$VM" $VM_PARAMS "$IMAGE"

   * Restart
   * Navigate to http://organicdesign.co.nz:8080
   * To start Pier manually, as root: 

cd /var/www/domains/Pier.app

./Pier.sh


Enable Pier Content Alongside Apache

This is assuming an OD server, as above.

  • Add pier.organicdesign.co.nz to /etc/hosts
  • As root, enable proxy:
a2enmod proxy proxy_http
  • Then edit /etc/apache2/mods-enabled/proxy.conf, by adding Allow from organicdesign.co.nz as below:
<IfModule mod_proxy.c> # If you want to use apache2 as a forward proxy, uncomment the # 'ProxyRequests On' line and the <Proxy *> block below. # WARNING: Be careful to restrict access inside the <Proxy *> block. # Open proxy servers are dangerous both to your network and to the # Internet at large. # # If you only want to use apache2 as a reverse proxy/gateway in # front of some web application server, you DON'T need # 'ProxyRequests On'. <Proxy *> AddDefaultCharset off Order deny,allow # Deny from all # Allow from .example.com Allow from organicdesign.co.nz </Proxy> # Enable/disable the handling of HTTP/1.1 "Via:" headers. # ("Full" adds the server version; "Block" removes all outgoing Via: headers) # Set to one of: Off | On | Full | Block ProxyVia On </IfModule>
  • Finally add, at the top of the mod_rewrite in /etc/apache2/sites-available/default, directly under RewriteEngine On:
ProxyPreserveHost On RewriteCond %{HTTP_HOST} ^pier\.organicdesign.co.nz RewriteRule (.*) http://organicdesign.co.nz:8080/$1 [P,L]