LabKey Support: LabKey Server Distribution and Support https://www.labkey.org LabKey Support: LabKey Server Distribution and Support This message board has been retired https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=5046&_print=1 <p>As of Wednesday, April 13th 2011, this message board will no longer be updated. LabKey now has a blog (see <a href="http://www.labkey.com/blog/">http://www.labkey.com/blog/</a>) and in the future all Administration/Operations related postings will be made there. </p> <p>If you are only interested in the Administration/Operations related postings, you can simply filter the entries and look only at thoise in the Operations category. Here is a <a href="http://www.labkey.com/blog/category/operations/">direct link</a>. </p> <p>Please note: some of the content from this message board has been moved to the new blog location. </p> Thu Apr 14 11:15:05 PDT 2011 Upgrade batch script for manually installed Windows Servers https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4842&_print=1 1 Overview **Sample Script:** [upgrade-windows-manual.bat|https://github.com/LabKey/samples/blob/master/ops/upgrade-windows-manual.bat] This sample script is used internally for upgrading a LabKey Server that was manually installed on Windows. On Windows, there are two methods to install the LabKey Server. The first is to use the [Installer|configWindows]. The second is perform a [manual install|manualInstall] This script can be used when upgrading a LabKey Server on Windows which was installed manually only. This script should never be used to upgrade a LabKey Server that was installed using the [LabKey Installer|configWindows]. This is a very simple script, but with a little customization, as described below, you should be able to quickly start using it for your LabKey Server installation. 1 How to customize the script Nearly all script customization can be done by changing the variables at the beginning of the script. Below is a description of each variable. - **labkey_home:** This is the installation directory for the LabKey Server. This directory contains the labkeywebapp and modules directory among others. For many customers this is set to /usr/local/labkey - **labkey_distdir:** This is the directory which will hold the uncompressed LabKey distribution directories. For example: -- If you downloaded the current LabKey distribution (LabKeyxx.x-xxxxx-xx-bin.zip, where "xx.x-xxxxx-xx" represents the current version number) into h:\\\labkey\\\dist -- Then uncompressed the distribution file into h:\\\labkey\\\dist\\\LabKeyxx.x-xxxxx-xx-bin using a command similar to {div:style=background-color: #edf0f1; border:1px solid #dee0e1; padding-left:5px; padding-right:5px; margin-left:25px; margin-right:25px} {code} cd h:\\\labkey\\\dist and unzip LabKeyxx.x-xxxxx-xx-bin.zip {code} {div} -- Then the labkey_distdir should be set to h:\labkey\dist - **catalina_home:** This is the installation directory for the Tomcat Server Other important information - **Tomcat Windows Service**: This script assumes that the Tomcat Windows service is called *Apache Tomcat*. If the Tomcat Windows service on your server is named something different, please make the change in the script. 1 How to use this script After you have customized this script, you can execute the script by running the following from a command prompt: {div:style=background-color: #edf0f1; border:1px solid #dee0e1; padding-left:5px; padding-right:5px; margin-left:25px; margin-right:25px} {code} upgrade-windows-manual.bat DIST {code} {div} where DIST is the directory containing the uncompressed LabKey Server distribution files. If we use the example above (in the description for *labkey_distdir* variable), then the command line should be: {div:style=background-color: #edf0f1; border:1px solid #dee0e1; padding-left:5px; padding-right:5px; margin-left:25px; margin-right:25px} {code} upgrade-windows-manual.bat LabKeyxx.x-xxxxx-xx-bin {code} {div} 1 Additional Notes **Roll back to previous version:** - This script does not keep a backup copy of the LabKey Server java files before the upgrade. In order to install a previous version, you will need to have the LabKey Distribution files available on your file system. - You can then simply execute the script again specifying the previous versions directory containing the uncompressed LabKey Server distribution files **Backup of LabKey Server database: ** - This script does not perform a backup of your LabKey Server database. -- LabKey recommends that you perform a backup of your LabKey Server database before upgrading your LabKey Server using this script. -- See [dbBackup] and [backupScenarios] for more information on backing up your database. Mon Jan 24 17:03:17 PST 2011 Important new "Administration" additions to our Documentation https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4323&_print=1 Over the past few days, our doc team has made some great additions to the Documentation pages pertaining to Installation and Administration * {link:Linux Upgrade Script|https://www.labkey.org/wiki/home/Documentation/page.view?name=upgradeLabkeyLinux} * {link:Control how internet search engines (google) index your LabKey Server|https://www.labkey.org/wiki/home/Documentation/page.view?name=robots} Please check them out. Wed Jul 28 11:27:58 PDT 2010 Information on Postgres Database Backups https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4197&_print=1 <h2 id="information_on_the_postgres_backup_implementation">Information on the Postgres Backup implementation</h2> There is a plethora of information on backup and restore of Postgres databases online. The problem is that a lot of it is old and out of date. This means it can hard to figure out how you should do something as simple as backup. So here is list of the various backup file formats. Hope this helps you. <p>There are 3 output formats for a backup of a postgres database. I am going to describe the pros and cons of each below </p> <h3 id="script_or_plain_text_format">Script or plain-text format</h3> <ul> <li>This is the default format for backup</li> <li>This is simply a text file which contains the commands necessary to rebuild the database.</li> <li>Can be restored using psql or pg<em>restore <ul> <li>As of Postgres 8.2, you can backup &#8220;large objects&#8221; using this format by specifying the -b option. (See section titled E.57.3.12. pg</em>dump Changes in <a href="http://www.postgresql.org/docs/8.4/static/release-8-1.html">http://www.postgresql.org/docs/8.4/static/release-8-1.html</a>)</li> </ul></li> <li><strong>Individual tables CANNOT be restored using the format</strong>. In order to restore an individual table, you will need to restore the entire table first. Then copy the table contents from the restored database to the working database. </li> </ul> <h3 id="custom_archive_format">Custom archive format</h3> <ul> <li>Most flexible format. </li> <li>By default this format is compressed, but compression can be disabled using the &#8212;compress option </li> <li>Must use pg_restore to restore the database</li> <li>The backup file can be opened and the contents reviewed using pg_restore</li> <li>Individual tables CAN be restored using the format.</li> <li>Backup file size(uncompressed) can be roughly 2x the size of the database. This is due overhead necessary to allow pg_restore the ability to restore individual tables, etc</li> </ul> <h3 id="tar_archive_format">tar archive format</h3> <ul> <li>Has the same features as Custom format except </li> <li>Tables cannot be larger than 8GB in size or the restore will fail.</li> <li>Output file can be opened using the tar command. </li> </ul> <p>(Much of this information was found at <a href="http://www.postgresql.org/docs/8.4/static/app-pgdump.html">http://www.postgresql.org/docs/8.4/static/app-pgdump.html</a> and <a href="http://www.postgresql.org/docs/8.4/static/app-pgrestore.html">http://www.postgresql.org/docs/8.4/static/app-pgrestore.html</a> ]</p> Thu Jul 01 19:03:29 PDT 2010 Installing LabKey server without granting the database user superuser status https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4136&_print=1 <p><strong>NOTE: The content below pertains to using the LabKey Server with a PostgreSQL database only. It does not apply when using a Microsoft SQL Server.</strong></p> <p>In our <a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=cpasxml">install documentation</a> we assume that the database user, being used by the LabKey server to communicate to the database, has <a href="http://www.postgresql.org/docs/current/static/sql-createrole.html">superuser status</a>. </p> <p>If you are uncomfortable with granting the database user superuser status, then the instructions below can help you install the LabKey server using a user without the superuser status. </p> <p>First, a little background about the privileges required of the database user used by LabKey Server. The database user only requires superuser status during the initial install. After the first installation, the LabKey Server only requires that the database user is the owner of the database. When the LabKey Server is started, if the database, specified in the configuration file, does not exist, then the LabKey Server will attempt to create the database. Thus the superuser status is only needed during the very first startup of the LabKey Server.</p> <p>In order to run the LabKey server with a non-superuser database user I recommend the following: <em>NOTE: These instructions assume you are using the postgres user (ie the database user created during the run of <a href="http://www.postgresql.org/docs/current/static/database-roles.html">initdb, this user superuser status</a>.)</em> </p> <ol> <li>Using the postgres user, create a new database role named <code>labkey</code> with a strong password</li> <li><p>Using the postgres user, create a new database named <code>labkey</code>. Make sure to specify the user <code>labkey</code> as the owner. i.e.</p> <pre><code>CREATE DATABASE labkey OWNER labkey; </code></pre></li> <li><p>open the <code>labkey.xml</code> configuration file and in the database configuration XML node: </p> <ul> <li>enter in the <code>labkey</code> as the user </li> <li>enter in password choosen in #1 </li> <li>enter in <code>labkey</code> as the database</li> </ul></li> <li>Start the LabKey server. </li> </ol> <p>The LabKey Server bootstrap process will happily install itself using the <code>labkey</code> database </p> Thu Jun 17 09:44:35 PDT 2010 Improved Access Logging for the LabKey Server https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4104&_print=1 <p>As you know, the LabKey Server runs on Apache Tomcat. The Tomcat server has the ability to perform <a href="http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html">Access Logging</a> similar the Apache web server. When configured, the Tomcat server will log each request to the server to a file on the file system. By default: </p> <ul> <li>the log file is located in the <code>$CATALINA_HOME/logs</code> directory </li> <li>the log file name will be of the form <code>localhost_access_log.YYYY-MM-DD.txt</code> <ul> <li>where <code>YYYY</code> = 4 digit year, <code>MM</code> = month and <code>DD</code> is the day of the month.</li> </ul></li> <li>the log file is rotated daily at midnight </li> </ul> <p>The Tomcat server comes with two preconfigured Access Log formats; <em>common</em> and <em>combined</em>. If I had to choose one of these format, I would recommend the <em>combined</em> format. The format of the combined format is </p> <pre><code>%h %l %u %t "%r" %s %b Referer User-Agent' </code></pre> <p>See below for a description of what each pattern code (ie %h) means. Complete documentation on the Tomcat Access Logging can be found at <a href="http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html">http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html</a></p> <p><br></p> <h3 id="recommended_labkey_server_access_log_format">Recommended LabKey Server Access Log format</h3> <p>For production installations of the LabKey server, I recommend a new format: </p> <pre><code>%h %l %u %t "%r" %s %b %D %S "%{Referer}i" "%{User-Agent}i" %{LABKEY.username}s </code></pre> <p>The difference between this format and the <em>combined</em> format is</p> <ul> <li>%D = The time taken by the server to process the request. This is valuable when debugging performance problems </li> <li>%S = Tomcat User SESSION ID</li> <li>%{LABKEY.username}s = The username of the person accessing the LabKey server. If the person is not logged in, then this will be a &#8220;-&#8220;</li> </ul> <p>There are 3 other LabKey specific fields that might be of interest in particular circumstances </p> <ul> <li>%{LABKEY.container}r = The LabKey server container being accessed during the request </li> <li>%{LABKEY.controller}r = The LabKey server controller being used during the request </li> <li>%{LABKEY.action}r = The LabKey server action being used during the request </li> </ul> <p><br></p> <h3 id="example_access_log_valve_configuration">Example Access Log Valve configuration</h3> <p>Below is an example configuration for using the pattern above </p> <pre><code>&lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern='%h %l %u %t "%r" %s %b %D %S "%{Referrer}i" "%{User-Agent}i" %{LABKEY.username}s' resolveHosts="false"/&gt; </code></pre> <p><br></p> <h3 id="pattern_code_description">Pattern Code description</h3> <p>This was taken from <a href="http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html">http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html</a></p> <ul> <li><strong>%a</strong> - Remote IP address</li> <li><strong>%A</strong> - Local IP address</li> <li><strong>%b</strong> - Bytes sent, excluding HTTP headers, or &#8216;-&#8217; if zero</li> <li><strong>%B</strong> - Bytes sent, excluding HTTP headers</li> <li><strong>%h</strong> - Remote host name (or IP address if resolveHosts is false)</li> <li><strong>%H</strong> - Request protocol</li> <li><strong>%l</strong> - Remote logical username from identd (always returns &#8216;-&#8216;)</li> <li><strong>%m</strong> - Request method (GET, POST, etc.)</li> <li><strong>%p</strong> - Local port on which this request was received</li> <li><strong>%q</strong> - Query string (prepended with a &#8216;?&#8217; if it exists)</li> <li><strong>%r</strong> - First line of the request (method and request URI)</li> <li><strong>%s</strong> - HTTP status code of the response</li> <li><strong>%S</strong> - User session ID</li> <li><strong>%t</strong> - Date and time, in Common Log Format</li> <li><strong>%u</strong> - Remote user that was authenticated (if any), else &#8216;-&#8216;</li> <li><strong>%U</strong> - Requested URL path</li> <li><strong>%v</strong> - Local server name</li> <li><strong>%D</strong> - Time taken to process the request, in millis</li> <li><strong>%T</strong> - Time taken to process the request, in seconds</li> <li><strong>%I</strong> - current request thread name (can compare later with stacktraces)</li> </ul> <p>There is also support to write information from the cookie, incoming header, outgoing response headers, the Session or something else in the ServletRequest. It is modeled after the apache syntax:</p> <ul> <li><strong>%{xxx}i</strong> for incoming request headers</li> <li><strong>%{xxx}o</strong> for outgoing response headers</li> <li><strong>%{xxx}c</strong> for a specific request cookie</li> <li><strong>%{xxx}r</strong> xxx is an attribute in the ServletRequest</li> <li><strong>%{xxx}s</strong> xxx is an attribute in the HttpSession</li> </ul> Wed Jun 02 17:08:53 PDT 2010 How to get better and more accurate results from the LabKey search engine https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=4099&_print=1 <p>Below are some tips for getting better results when using LabKey&#8217;s full-text search feature. These are from one of our Search developers, Adam. </p> <ol> <li>If your search term is a phrase then enclose it in quotes. Otherwise, you&#8217;ll get all documents that include any of the terms (though those that include more terms should appear higher in the results).</li> <li>If your search term includes special characters, try enclosing it in quotes. Or </li> <li><p>If your search term includes special characters, try escaping the special characters</p> <ul> <li><p>Our search engine supports escaping special characters that are part of the query syntax. The current list special characters are </p> <pre><code>+ - &amp;&amp; || ! ( ) { } [ ] ^ " ~ * ? : \ </code></pre></li> <li><p>To escape these character use the \ before the character. For example to search for (1+1):2 use the query: </p> <pre><code>\(1\+1\)\:2 </code></pre></li> </ul></li> <li><p>If you&#8217;re searching our Bug Tracker, then definitely use the Bug Tracker search page at <a href="https://www.labkey.org/issues/home/Developer/issues/list.view?">https://www.labkey.org/issues/home/Developer/issues/list.view?</a>. This limits results to a single type and folder.</p></li> </ol> Tue Jun 01 16:28:56 PDT 2010 Using the LabKey Server SiteDown webapp https://www.labkey.org/home/Support/Inactive%20Forums/Administration%20Forum%20%28Inactive%29/announcements-thread.view?rowId=3649&_print=1 <p>Below you will find the instructions for installing the LabKey SiteDown webapp. This webapp allows the LabKey Administrator to show a pretty SiteDown page when the LabKey server needs to be taken offline.. This SiteDown webapp is designed to be used only during certain types of outages, such as when the database server is offline due to a hardware failure, or upgrade. </p> <p>This SiteDown webApp is not meant to be used in the following cases </p> <ul> <li>during LabKey Server upgrades (ie upgrade of the LabKey Server from v9.1 to v9.2)</li> <li>during times when you want to perform maintenance on the LabKey Server by placing the server in Admin-Only mode.</li> </ul> <h2 id="how_does_the_sitedown_webapp_work">How does the SiteDown webapp work?</h2> <p>The LabKey Server currently has a very simple SiteDown functionality. When enabled, by editing the <code>&lt;LABKEY_HOME&gt;/labkeywebapp/WEB-INF/web.xml</code> file, it will show a simple message to the screen. This message contains no formatting, logo images, etc. It is just black text on the white background. I have leveraged this functionality to redirect the browser to a new webapp that allows us to show a &#8220;prettier&#8221; SiteDown page. </p> <p>When enabled, the SiteDown page will work in the following way</p> <ol> <li>When the user comes to any page within the LabKey webApp (ie http://&lt;YourServerName&gt;/labkey/Project/home/begin.view)</li> <li>The LabKey webApp will return a small blurb of javascript. The javascript tells the browser to load http://&lt;YourServerName&gt;/sitedown/index.html <ul> <li>The URL to load is configurable and can be changed.</li> </ul></li> <li>The browser then loads http://&lt;YourServerName&gt;/sitedown/index.html and shows the user the &#8220;prettier&#8221; SiteDown page</li> <li>This page contains a Meta Refresh directive which tells the browser to load http://&lt;YourServerName&gt;/labkey/Project/home/begin.view every 60 secs. <ul> <li>This insures that if a user leaves their browser open after they see the SiteDown page, they will eventually get redirected back the LabKey webApp when it is back online.</li> </ul></li> </ol> <p><br></p> <h2 id="preparations_for_using_the_site_down_page">Preparations for Using the Site Down page</h2> <ol> <li>Log in to the web server which is running your LabKey Server</li> <li>Copy/Download the attached file, labkey_sitedown.zip, to your server.</li> <li>Unzip the file into <code>&lt;LABKEY_HOME&gt;/sitedown</code> </li> </ol> <p><br></p> <h2 id="edit_the_site_down_page_to_show_the_desired_message">Edit the Site Down page to show the desired message</h2> <ol> <li>Using an editor open <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown/index.html</code></li> <li>Find the text <em>&#8220;This is the message&#8221;</em></li> <li>Replace this with the content you would like to have displayed. Note: this is an HTML page, you can add in any supported HTML tags you would like.</li> <li><p>If your LabKey webapp is configured to use a different ContextPath than <code>/labkey</code>, you will need to edit the Meta Refresh tag. i.e. the tag that begins with </p> <pre><code>&lt;meta http-equiv="refresh" content="60;url=/labkey/index.html"&gt; </code></pre></li> </ol> <p><br></p> <h2 id="enable_the_sitedown_webapp_and_test">Enable the SiteDown webapp and test</h2> <ol> <li>Using an editor open <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown.xml</code></li> <li>Change the docBase attribute from <code>CHANGETHIS</code> to <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown</code> <ul> <li>where <code>&lt;LABKEY_HOME&gt;</code> is the directory where the LabKey software is installed</li> </ul></li> <li>Copy <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown.xml</code> to <code>&lt;CATALINA_HOME&gt;/conf/Catalina/localhost/sitedown.xml</code> <ul> <li>[NOTE the tomcat server will automatically load the new SiteDown webapp. This will allow you verify the formatting of your SiteDown page]</li> </ul></li> <li>Goto http://&lt;YourServerName&gt;/labkey/sitedown/index.html and verify that the SiteDown message looks correct. If you need to fix any of the content or formatting, simply open <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown/index.html</code> with an editor and make the changes. Once you save the file, refresh your browser to review your changes.</li> </ol> <p><br></p> <h2 id="redirect_from_the_cpas_webapp_to_the_sitedown_page">Redirect from the CPAS webapp to the SiteDown page</h2> <p>When it is time to show the &#8220;SiteDown&#8221; page, do the following</p> <ol> <li>Make a backup of the <code>web.xml</code> file by copying <code>&lt;LABKEY_HOME&gt;/labkeywebapp/WEB-INF/web.xml</code> to <code>&lt;LABKEY_HOME&gt;/orig_web.xml</code></li> <li>Copy <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown_web.xml</code> to <code>&lt;LABKEY_HOME&gt;/labkeywebapp/WEB-INF/web.xml</code></li> <li>Restart the Tomcat Server </li> <li>Test by going to http://&lt;YourServerName&gt;/labkey/Project/home/begin.view</li> </ol> <p><br></p> <h2 id="bring_the_labkey_webapp_backup_online">Bring the LabKey webapp backup online</h2> <ol> <li>Copy <code>&lt;LABKEY_HOME&gt;/orig_web.xml</code> to <code>&lt;LABKEY_HOME&gt;/labkeywebapp/WEB-INF/web.xml</code></li> <li>Disable the sitedown webapp by deleting <code>&lt;LABKEY_HOME&gt;/sitedown/sitedown.xml</code></li> <li>Restart the Tomcat Server</li> <li>Test by going to http://&lt;YourServerName&gt;/labkey/Project/home/begin.view</li> </ol> <p><br></p> <h2 id="other_information">Other Information</h2> <p>The SiteDown page in the attached zip archive is a sample. By editing the <code>index.html</code> file located in the <code>sitedown</code> directory, you should be able to customize the look and feel of the page to match your server. </p> <p><br> <br> <br></p> Tue Jan 05 17:09:58 PST 2010