{"id":473987,"date":"2008-07-11T18:51:46","date_gmt":"2008-07-11T22:51:46","guid":{"rendered":"https:\/\/segue.middlebury.edu\/view\/html\/node\/473987"},"modified":"2008-07-11T18:51:46","modified_gmt":"2008-07-11T22:51:46","slug":"installation","status":"publish","type":"page","link":"https:\/\/segueproject.org\/segue-documentation\/segue-v2\/documentation\/for-administrators\/installation\/","title":{"rendered":"Installation"},"content":{"rendered":"<h3>Requirements:<\/h3>\n<div>\n<ul>\n<li>Apache Web Server<\/li>\n<li>One of the following database servers:\n<ul>\n<li>MySQL &#8211; version 5.0 or later<\/li>\n<li>PostgreSQL &#8211; needs testing but should work.<\/li>\n<\/ul>\n<\/li>\n<li>PHP 5.2 or later with the following compile options\/extensions:\n<ul>\n<li><font face=\"Courier New\">&#8211;with-mysql<font face=\"Arial\"> or <font face=\"Courier New\">&#8211;with-postgresql<font face=\"Arial\"> depending on your database<\/font><\/font><\/font><\/font><\/li>\n<li><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\">&#8211;with-zlib<\/font><\/font><\/font><\/font><\/font><\/li>\n<li><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\">&#8211;enable-mbstring&nbsp; <\/font><\/font><\/font><\/font><\/font>(Required as of Segue 2.0-beta 24)<\/li>\n<li><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\">&#8211;with-xsl&nbsp; <\/font><\/font><\/font><\/font><\/font>(Required as of Segue 2.0-beta 25)<\/li>\n<li><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\">&#8211;with-gettext<font face=\"Arial\"> <strong>Optional<\/strong>: Needed to enable user-interface language switching.<\/font><\/font><\/font><\/font><\/font><\/font><\/li>\n<li><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\"><font face=\"Arial\"><font face=\"Courier New\">&#8211;with-ldap<font face=\"Arial\"> <strong>Optional<\/strong>: Needed if you wish to use an LDAP authentication source<\/font><\/font><\/font><\/font><\/font><\/font><\/li>\n<li><font face=\"Courier New\">&#8211;with-pdo-mysql<font face=\"Arial\"> or <font face=\"Courier New\">&#8211;with-pdo-postgresql<font face=\"Arial\"> depending on your database, and the appropriate driver &#8212; installed with <font face=\"Courier New\">$ pecl install pdo; pecl install pdo_mysql<font face=\"Arial\"> if you use <font face=\"Courier New\">&#8211;with-pdo-mysql=shared<\/font><\/font><\/font>. <strong>Optional<\/strong>: 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.<\/font><\/font><\/font><\/font><\/li>\n<li><font face=\"Courier New\">&#8211;with-gd<\/font> and <font face=\"Courier New\">&#8211;enable-gd-native-ttf<\/font> or one of the other TTF-enabling options. <strong>Optional<\/strong>: Needed for usage-statistics graph.<\/li>\n<\/ul>\n<\/li>\n<li>ImageMagick: ImageMagick is a command-line program for manipulating images. Segue uses ImageMagick to generate image thumbnails and resized versions of images.<\/li>\n<\/ul>\n<\/div>\n<h3>Suggested php.ini settings<\/h3>\n<div>\n<p><strong>Longer Session Time-out:<\/strong><br \/>\nIf 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.<\/p>\n<ul>\n<li>session.gc_maxlifetime = 36000 &nbsp;&nbsp; # (10 hours)<\/li>\n<\/ul>\n<p>\n<strong>Larger Uploads:<\/strong><br \/>\nTo 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:<\/p>\n<ul>\n<li>upload_max_filesize = 150M<\/li>\n<li>post_max_size = 150M<\/li>\n<li>memory_limit = 150M<\/li>\n<\/ul>\n<p>Note:&nbsp; It may also be necessary to edit the Apache LimitRequestBody = 104857600 (for 100MB) <strong>Time-out issues:<\/strong><br \/>\nWhile most pages should load in just a few seconds,&nbsp; 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.<\/p>\n<ul>\n<li>max_execution_time = 90<\/li>\n<li>max_input_time = 90<\/li>\n<\/ul>\n<p><strong>Upload location and Safe Mode<\/strong><br \/>\nSee the notes on <a href=\"https:\/\/segue.middlebury.edu\/view\/html\/node\/474165\">Safe Mode<\/a> below for settings related to:<\/p>\n<ul>\n<li>upload_tmp_dir<\/li>\n<\/ul>\n<\/div>\n<h3>Installation<\/h3>\n<div>\n<ol style=\"font-size: 12px\">\n<li>Download a Segue source package from Sourceforge.net<\/li>\n<p style=\"font-size: 12px\"><a href=\"http:\/\/sourceforge.net\/project\/showfiles.php?group_id=82171&amp;package_id=246956\">http:\/\/sourceforge.net\/projects\/segue<\/a><\/p>\n<li>Unzip into a web-accessible directory (see this <a href=\"http:\/\/harmoni.sourceforge.net\/wiki\/index.php\/Security_Best_Practices\">Harmoni page<\/a> for details on a more secure &#8212; and complex &#8212; installation)<\/li>\n<li>Create a MySQL or PostgreSQL database for Segue to use.\n<ol type=\"A\" style=\"font-size: 12px\">\n<li>create the database<\/li>\n<li>give a database user full permission to that database.<\/li>\n<\/ol>\n<p>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.<\/p>\n<\/li>\n<li>Create your database config\n<ol type=\"A\" style=\"font-size: 12px\">\n<li>copy <br \/>\n        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; segue\/config\/database_default.conf.php<br \/>\n        to<br \/>\n        &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; segue\/config\/database.conf.php<\/li>\n<li>Modify your database config and change the database connection entry in the config to reflect the database that you just created.<\/li>\n<li>If you enabled PDO support in PHP you can uncomment the &#8216;Harmoni_Db&#8217; database setup lines in the database config.<\/li>\n<\/ol>\n<\/li>\n<li>Create your Image Processor config\n<ol type=\"A\">\n<li>copy <br \/>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; segue\/config\/imageprocessor_default.conf.php<br \/>\n        to<br \/>\n        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; segue\/config\/imageprocessor.conf.php<\/li>\n<li>Modify the &#8216;imagemagick_path&#8217; property in the Image Processor config to be the location in which ImageMagick is installed<\/li>\n<\/ol>\n<\/li>\n<li>(Optional) Set up LDAP authentication\n<ol type=\"A\">\n<li>&nbsp;copy <br \/>\n        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; segue\/config\/authentication_default.conf.php<br \/>\n        to<br \/>\n        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; segue\/config\/authentication.conf.php<\/li>\n<li>comment-in and modify the LDAP authentication piece in<br \/>\n        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; segue\/config\/authentication.conf<br \/>\n        to fit your envirnment.<\/li>\n<\/ol>\n<\/li>\n<li>Go to Segue in your browser. The default administrator account is:<br \/>\n    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Username: jadministrator<br \/>\n    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Password: password<br \/>\n    &nbsp;Use the Segue Admin tools to create a new admin account and delete<br \/>\n    &nbsp;the default one.<\/li>\n<\/ol>\n<\/div>\n<h3>Hiding index.php from the URL and using PATH_INFO URLs<\/h3>\n<div>\n<p>Usage of the following Apache2 rewrite rule will allow you to hide the Segue2 index.php file:<\/p>\n<pre>&lt;Directory &quot;\/path\/to\/segue\/&quot;&gt;<br \/>   &lt;IfModule mod_rewrite.c&gt;<br \/>\t\tRewriteEngine On<br \/>\t\tRewriteBase \/<br \/>\t\tRewriteCond %{REQUEST_FILENAME} !-f<br \/>\t\tRewriteCond %{REQUEST_FILENAME} !-d<br \/>\t\tRewriteRule (.*) \/index.php\/$1<br \/>\t&lt;\/IfModule&gt;<br \/>&lt;\/Directory&gt;<\/pre>\n<p>This works best if you are using PATH_INFO-based urls. To configure this:<\/p>\n<ol>\n<li>Copy <code>action_default.conf.php<\/code> to <code>action.conf.php<\/code><\/li>\n<li>Edit <code>action.conf.php<\/code> and uncomment the following lines (or add them if using Segue &lt; 2.0-beta 21.3):\n<pre>require_once(HARMONI.&quot;\/architecture\/request\/PathInfoRequestHandler.class.php&quot;);<br \/>$harmoni-&gt;request-&gt;assignRequestHandler( new PathInfoRequestHandler() );<\/pre>\n<\/li>\n<li>Copy <code>url_default.conf.php<\/code> to <code>url.conf.php<\/code><\/li>\n<li>Edit <code>url.conf.php<\/code> and change the define statement from\n<pre>define(&quot;MYURL&quot;, trim(MYPATH, '\/').&quot;\/index.php&quot;);<\/pre>\n<p>    to<\/p>\n<pre>define(&quot;MYURL&quot;, trim(MYPATH, '\/'));<\/pre>\n<\/li>\n<\/ol>\n<\/div>\n<h3>Dealing with Safe Mode<\/h3>\n<div>\n<p><a href=\"http:\/\/us2.php.net\/manual\/en\/features.safe-mode.php\">Safe Mode<\/a> is a configurable mode in PHP &lt; 6 that restricts the usage of certain PHP functions to lower the risk of system compromise through malicious use of these functions.<\/p>\n<p>Segue will run just fine under safe mode, but&nbsp; there are a few things to look out for:<\/p>\n<ul>\n<li>Safe mode will restrict execution of PHP scripts to those files owned by the webserver user (default configuration) or webserver group (<em>safe_mode_gid<\/em> set to &quot;On&quot;). You must set the ownership of all Segue PHP files so that they are owned by the appropriate user or group.<\/li>\n<li>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:\n<ol>\n<li>Create a temporary directory for Segue to use, for instance \/var\/segue_temp\/<\/li>\n<li>change the ownership of that directory to be the user and group that the webserver runs at:\n<p>ex: chown wwwrun:www \/var\/segue_temp\/<br \/>\n        ex: chown nobody:nobody \/var\/segue_temp\/<\/p>\n<\/li>\n<li>&nbsp;Set the &quot;imagemagick_temp_dir&quot; property in your imageprocessor.conf.php to be the path of your new temp directory.<\/li>\n<li>Set the &quot;DATAPORT_TMP_DIR&quot; constant in your dataport.conf.php to be the path of your new temp directory<\/li>\n<\/ol>\n<\/li>\n<li>&nbsp;Lastly, set the <em>upload_tmp_dir<\/em> php.ini value to use this same temporary directory for uploads as the file-upload wizard component currently uses this same directory.<\/li>\n<li>Safe-Mode will likely restrict access to the system fonts directory, preventing usage graph generation. Copy the system&#8217;s truetype font directory to a location readable by PHP, make it owned by your webserver user, and then define the <code>TTF_DIR<\/code> constant in <code>segue\/config\/libraries.conf.php<\/code>.<\/li>\n<\/ul>\n<\/div>\n<h3>Installing Segue in a non-web-accessible location<\/h3>\n<div>\n<div>\n<div style='float: right;margin-top: 12px'>\n\t\t<img src='https:\/\/segue.middlebury.edu\/\/images\/downarrow.gif' align='top' width='15' height='15' alt='download' \/><br \/>\n\t\t\t<a href='https:\/\/segue.middlebury.edu\/repository\/viewfile\/polyphony-repository___repository_id\/edu.middlebury.segue.sites_repository\/polyphony-repository___asset_id\/474211\/polyphony-repository___record_id\/474212\/polyphony-repository___file_name\/segue-example-layout.tar.gz'><strong>Download<\/strong><\/a><br \/>\n\t\t<span style='font-size: 90%'>(28.30 kB)<\/span>\n\t<\/div>\n<div style='float: left'>\n\t<a href='https:\/\/segue.middlebury.edu\/repository\/viewfile\/polyphony-repository___repository_id\/edu.middlebury.segue.sites_repository\/polyphony-repository___asset_id\/474211\/polyphony-repository___record_id\/474212\/polyphony-repository___file_name\/segue-example-layout.tar.gz'><br \/>\n\t\t<img src='https:\/\/segue.middlebury.edu\/repository\/viewthumbnail\/polyphony-repository___repository_id\/edu.middlebury.segue.sites_repository\/polyphony-repository___asset_id\/474211\/polyphony-repository___record_id\/474212\/polyphony-repository___file_name\/segue-example-layout.tar-thumbnail.png' align='bottom' border='0' width='32' height='32' alt=\"Download ''\" \/><br \/>\n\t<\/a>\n<\/div>\n<div style='clear: both;margin-bottom: 6px'>\n<\/div>\n<\/div>\n<div style='margin-top: 10px'><strong>&nbsp;About<\/strong><\/p>\n<p>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.<\/p>\n<p>Additionally, the layout in this example provides a straight-forward process of upgrading by:<\/p>\n<ul>\n<li>keeping web-accessible links pointed at a single &#8216;current&#8217; folder which is itsself a link<\/li>\n<li>keeping custom configuration files, themes, and templates outside of the segue source, where they can easily be linked into the appropriate locations.<\/li>\n<\/ul>\n<p>\n<strong>Setting up a new version<br \/>\n<\/strong><br \/>\n&#8211; cd to the segue-code\/ directory:<br \/>\n&nbsp;&nbsp;&nbsp; <font face=\"Courier New\">cd segue-code\/<\/font><\/p>\n<p>&#8211; unzip a new Segue version into the segue-code\/ directory<\/p>\n<p>&#8211; create a symbolic link to the new version for setup and testing:<br \/>\n&nbsp;&nbsp;&nbsp; <font face=\"Courier New\">ln -s segue-XXX.XXX.XXX new_version<\/font><\/p>\n<p>&#8211; make symbolic links to all custom configs in the segue-code\/configuration\/ directory:<br \/>\n<font face=\"Courier New\">&nbsp;&nbsp;&nbsp; cd new_version\/config\/<br \/>\n&nbsp;&nbsp;&nbsp; ls ..\/..\/configuration\/*.conf.php | awk &#8216;{print &quot;ln -s &quot; $1}&#8217; | sh -x<\/font><\/p>\n<p>&#8211; make symbolic links to all local themes in the segue-code\/themes-local\/ directory:<br \/>\n<font face=\"Courier New\">&nbsp;&nbsp;&nbsp; cd ..\/themes-local\/<br \/>\n&nbsp;&nbsp;&nbsp; ls ..\/..\/themes-local\/ | awk &#8216;{print &quot;ln -s &quot; $1}&#8217; | sh -x<\/font><\/p>\n<p>&#8211; make symbolic links to all local templates in the segue-code\/templates-local\/ directory:<br \/>\n<font face=\"Courier New\">&nbsp;&nbsp;&nbsp; cd ..\/templates-local\/<br \/>\n&nbsp;&nbsp;&nbsp; ls ..\/..\/templates-local\/ | awk &#8216;{print &quot;ln -s &quot; $1}&#8217; | sh -x<\/font><\/p>\n<p>&#8211; view the new version in your browser to confirm that it is operational. Point browser at:<br \/>\n&nbsp;&nbsp;&nbsp; http:\/\/segue.example.com\/new_version\/<br \/>\nor<br \/>\n&nbsp;&nbsp;&nbsp; http:\/\/www.example.com\/path\/to\/segue\/new_version\/<br \/>\nas applicable.<\/p>\n<p>&#8211; cd to the segue-code\/ directory and update the &#8216;current&#8217; symbolic link to point to the new version:<br \/>\n<font face=\"Courier New\">&nbsp;&nbsp;&nbsp; cd ..\/..\/<br \/>\n&nbsp;&nbsp;&nbsp; rm current; ln -s segue-new_versin_number current<\/font><\/p>\n<p>&#8211; remove the &#8216;new_version&#8217; symbolic link so that all access goes through &#8216;current&#8217;<br \/>\n<font face=\"Courier New\">&nbsp;&nbsp;&nbsp; rm new_version<\/font><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Requirements: Apache Web Server One of the following database servers: MySQL &#8211; version 5.0 or later PostgreSQL &#8211; needs testing but should work. PHP 5.2 or later with the following compile options\/extensions: &#8211;with-mysql or &#8211;with-postgresql depending on your database &#8211;with-zlib&hellip; <a href=\"https:\/\/segueproject.org\/segue-documentation\/segue-v2\/documentation\/for-administrators\/installation\/\" class=\"continue-reading\">More &rarr;<\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"parent":480958,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-473987","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/473987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/comments?post=473987"}],"version-history":[{"count":0,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/473987\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/pages\/480958"}],"wp:attachment":[{"href":"https:\/\/segueproject.org\/segue-documentation\/wp-json\/wp\/v2\/media?parent=473987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}