-
Notifications
You must be signed in to change notification settings - Fork 12
Installation
There are many different ways to install Elation, depending on the needs of your situation and what your existing environment looks like. Elation can be run from any web directory which has permissions to execute PHP scripts, issue redirects, and follow symlinks. It is suitable for running anything from the smallest personal websites to large multi-server/multi-datacenter/cloud operations managing multiple domains and capable of serving millions of daily web and API requests.
- Server Prerequisites
- Installation Methods
- Common Configurations
Elation should work with both Apache 2.x and 1.3, but if you're still running 1.3 it's highly recommended that you upgrade.
The only module Elation requires to run is mod_rewrite. If it is not yet enabled, on many systems you can do so by running a2enmod rewrite
Elation has not yet been tested with Lighttpd or nginx. There may be some modifications necessary to run in a FastCGI environment. If you try Elation with one of these alternate webservers, we'd love to hear about it!
Currently, Elation will probably not work in a Windows environment regardless of which server software you choose. Portions of the Elation code which perform disk access (ConfigManager, DiskCache, Logger...) could probably be modified to be more platform-agnostic, and the symlink structure in the htdocs/css htdocs/scripts and htdocs/images directories may need rethinking. There are currently no plans to make these modifications, but if you decide you're up to the task I'll gladly accept contributions.
Elation can be checked out into any directory. For security reasons, it's recommended that the directory you choose should not be web-accessible. In this example, we check out into our homedir:
~$ git clone git://github.com/jbaicoianu/elation.git
~$ cd elation
~/elation$ ./elation web init
The next branch contains control files and a script for generating Debian/Ubuntu packages automatically, for system-level installation in your PHP path. Once Elation starts versioned releases, these will be made available here, or through a custom repository. For now, if you want to build your own Debian package, check out using GitHub and then run:
$ ./elation system package <version>
The recommended format for version numbers is three dot-separated digits (eg, 0.9.1, 1.0.0, etc). This should generate a file named, for example, elation-0.9.1.deb
This method allows you to run the Elation framework in a subdirectory of your domain (eg, http://yourdomain.com/stuff/ or http://yourdomain.com/~user/elation/). It does not require root access, and is good for jumping in and getting started.
Let's say you run http://yourdomain.com/ out of /var/www/
, which you have write access to, and you wish to run Elation as http://yourdomain.com/stuff/. You only need to expose the htdocs directory to the web, so if you checked out from GitHub into ~/elation/ just run the following command, and the rest is handled by the framework:
$ ln -s ~/elation/htdocs /var/www/stuff
If you wanted to install elation in your ~/public_html directory, making it reachable via http://yourdomain.com/~user/elation/, the process is similar:
$ ln -s ~/elation/htdocs ~/public_html/elation
NOTE: the default included .htaccess file currently also requires you to add RewriteBase /~user/elation to make it work. There seems to be an odd interaction between mod_rewrite and mod_userdir in Apache which I still hope can be handled with rewrite magic...
This method uses the Elation framework to control one or more top-level domains (eg, http://yourdomain.com/). It does not require root access, but it is recommended for best performance. This is the recommended way to run your website.
Another way to use Elation is to allow it to assume control for an entire domain name, or multiple domain names (vhosting). Similar to the subdirectory approach all we need to do is make the htdocs directory accessible to the webserver, which we can do either with symlinks or by modifying your httpd's config files and setting up a vhost whose DocumentRoot points to your ~/elation/htdocs directory. This approach is generally preferred for high-volume sites, since it allows you to specify various optimizations and configuration options at the server level, bypassing the need for the included .htaccess file.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /data/elation/htdocs
RewriteEngine On
; If the requested file exists, let Apache handle it directly - otherwise pass off to the framework
RewriteCond %{REQUEST_URI} !-f
RewriteRule .* /go.php [QSA]
</VirtualHost>
This method allows multiple instances of Elation to run from a single machine, and allows each developer to have multiple working copies accessible from the web (eg, http://frank.dev.yourdomain.com/ http://susan.dev.yourdomain.com http://experimental.susan.dev.yourdomain.com/ etc). This method requires root access to install Apache configuration files, and the ability to add wildcard DNS entries for your domain servers.
// FIXME - fill in details