Requirements:
- Apache Web Server
- One of the following database servers:
- MySQL – version 5.0 or later
- PostgreSQL – needs testing but should work.
- PHP 5.2 or later with the following compile options/extensions:
- –with-mysql or –with-postgresql depending on your database
- –with-zlib
- –enable-mbstring (Required as of Segue 2.0-beta 24)
- –with-xsl (Required as of Segue 2.0-beta 25)
- –with-gettext Optional: Needed to enable user-interface language switching.
- –with-ldap Optional: Needed if you wish to use an LDAP authentication source
- –with-pdo-mysql or –with-pdo-postgresql depending on your database, and the appropriate driver — installed with $ pecl install pdo; pecl install pdo_mysql if you use –with-pdo-mysql=shared. Optional: Enabling the PDO extension and driver for your database will enable Segue to make use of prepared statements, significantly enhancing performance. Segue will operate fine without PDO however, and this support can be added at a later time with no database changes needed.
- –with-gd and –enable-gd-native-ttf or one of the other TTF-enabling options. Optional: Needed for usage-statistics graph.
- ImageMagick: ImageMagick is a command-line program for manipulating images. Segue uses ImageMagick to generate image thumbnails and resized versions of images.
Suggested php.ini settings
Longer Session Time-out:
If the default session lifetime of 24 minutes is used, users will often have problems with their session timing out while they are typing an post, thereby loosing their work. Considder using a longer session lifetime of a few hourse to prevent this.
- session.gc_maxlifetime = 36000 # (10 hours)
Larger Uploads:
To enable uploads larger than the default 2MB the following options should be set to the same size or larger than your desired upload size, for example, 150MB:
- upload_max_filesize = 150M
- post_max_size = 150M
- memory_limit = 150M
Note: It may also be necessary to edit the Apache LimitRequestBody = 104857600 (for 100MB) Time-out issues:
While most pages should load in just a few seconds, some import/export and update options take significantly longer. 90 seconds seems to be a good minimum value. 300 seconds should get all situations, but you may only want to enable this longer time if necessary to avoid problems from overwhelming the server.
- max_execution_time = 90
- max_input_time = 90
Upload location and Safe Mode
See the notes on Safe Mode below for settings related to:
- upload_tmp_dir
Installation
- Download a Segue source package from Sourceforge.net
- Unzip into a web-accessible directory (see this Harmoni page for details on a more secure — and complex — installation)
- Create a MySQL or PostgreSQL database for Segue to use.
- create the database
- give a database user full permission to that database.
Note: You do not need to run any SQL or create tables manually. Tables and default data will be created automatically the first time Segue is accessed through the browser.
- Create your database config
- copy
segue/config/database_default.conf.php
to
segue/config/database.conf.php - Modify your database config and change the database connection entry in the config to reflect the database that you just created.
- If you enabled PDO support in PHP you can uncomment the ‘Harmoni_Db’ database setup lines in the database config.
- copy
- Create your Image Processor config
- copy
segue/config/imageprocessor_default.conf.php
to
segue/config/imageprocessor.conf.php - Modify the ‘imagemagick_path’ property in the Image Processor config to be the location in which ImageMagick is installed
- copy
- (Optional) Set up LDAP authentication
- copy
segue/config/authentication_default.conf.php
to
segue/config/authentication.conf.php - comment-in and modify the LDAP authentication piece in
segue/config/authentication.conf
to fit your envirnment.
- copy
- Go to Segue in your browser. The default administrator account is:
Username: jadministrator
Password: password
Use the Segue Admin tools to create a new admin account and delete
the default one.
http://sourceforge.net/projects/segue
Hiding index.php from the URL and using PATH_INFO URLs
Usage of the following Apache2 rewrite rule will allow you to hide the Segue2 index.php file:
<Directory "/path/to/segue/">
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.php/$1
</IfModule>
</Directory>
This works best if you are using PATH_INFO-based urls. To configure this:
- Copy
action_default.conf.php
toaction.conf.php
- Edit
action.conf.php
and uncomment the following lines (or add them if using Segue < 2.0-beta 21.3):require_once(HARMONI."/architecture/request/PathInfoRequestHandler.class.php");
$harmoni->request->assignRequestHandler( new PathInfoRequestHandler() ); - Copy
url_default.conf.php
tourl.conf.php
- Edit
url.conf.php
and change the define statement fromdefine("MYURL", trim(MYPATH, '/')."/index.php");
to
define("MYURL", trim(MYPATH, '/'));
Dealing with Safe Mode
Safe Mode is a configurable mode in PHP < 6 that restricts the usage of certain PHP functions to lower the risk of system compromise through malicious use of these functions.
Segue will run just fine under safe mode, but there are a few things to look out for:
- Safe mode will restrict execution of PHP scripts to those files owned by the webserver user (default configuration) or webserver group (safe_mode_gid set to "On"). You must set the ownership of all Segue PHP files so that they are owned by the appropriate user or group.
- Safe mode will restrict file reading and writing to files owned by the webserver user [or group]. This is only an issue for migration tools, file-uploads in wizards, and thumbnail generation. To get Segue working under safe mode, use the following steps:
- Create a temporary directory for Segue to use, for instance /var/segue_temp/
- change the ownership of that directory to be the user and group that the webserver runs at:
ex: chown wwwrun:www /var/segue_temp/
ex: chown nobody:nobody /var/segue_temp/ - Set the "imagemagick_temp_dir" property in your imageprocessor.conf.php to be the path of your new temp directory.
- Set the "DATAPORT_TMP_DIR" constant in your dataport.conf.php to be the path of your new temp directory
- Lastly, set the upload_tmp_dir php.ini value to use this same temporary directory for uploads as the file-upload wizard component currently uses this same directory.
- Safe-Mode will likely restrict access to the system fonts directory, preventing usage graph generation. Copy the system’s truetype font directory to a location readable by PHP, make it owned by your webserver user, and then define the
TTF_DIR
constant insegue/config/libraries.conf.php
.
Installing Segue in a non-web-accessible location
This package is an example directory layout for a segue installation where the segue source-code lives outside of the web-accessible directory. Keeping all php scripts except the index.php non-web-accessible provides increased security as it prevents entry through unexpected scripts.
Additionally, the layout in this example provides a straight-forward process of upgrading by:
- keeping web-accessible links pointed at a single ‘current’ folder which is itsself a link
- keeping custom configuration files, themes, and templates outside of the segue source, where they can easily be linked into the appropriate locations.
Setting up a new version
– cd to the segue-code/ directory:
cd segue-code/
– unzip a new Segue version into the segue-code/ directory
– create a symbolic link to the new version for setup and testing:
ln -s segue-XXX.XXX.XXX new_version
– make symbolic links to all custom configs in the segue-code/configuration/ directory:
cd new_version/config/
ls ../../configuration/*.conf.php | awk ‘{print "ln -s " $1}’ | sh -x
– make symbolic links to all local themes in the segue-code/themes-local/ directory:
cd ../themes-local/
ls ../../themes-local/ | awk ‘{print "ln -s " $1}’ | sh -x
– make symbolic links to all local templates in the segue-code/templates-local/ directory:
cd ../templates-local/
ls ../../templates-local/ | awk ‘{print "ln -s " $1}’ | sh -x
– view the new version in your browser to confirm that it is operational. Point browser at:
http://segue.example.com/new_version/
or
http://www.example.com/path/to/segue/new_version/
as applicable.
– cd to the segue-code/ directory and update the ‘current’ symbolic link to point to the new version:
cd ../../
rm current; ln -s segue-new_versin_number current
– remove the ‘new_version’ symbolic link so that all access goes through ‘current’
rm new_version