<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Coffee|Code : Dan Scott - Evergreen</title>
    <link>http://www.coffeecode.net/</link>
    <description>Caffeinated Librarian Geek</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Making the Evergreen catalogue mobile-friendly via responsive CSS</title>
    <link>http://www.coffeecode.net/archives/265-Making-the-Evergreen-catalogue-mobile-friendly-via-responsive-CSS.html</link>
            <category>Coding</category>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/265-Making-the-Evergreen-catalogue-mobile-friendly-via-responsive-CSS.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=265</wfw:comment>

    <slash:comments>3</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=265</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;Back in November the Evergreen community was discussing the desire for a mobile catalogue, and &lt;a href=&quot;http://markmail.org/message/tdvihpd63lu6ksbs&quot;&gt;expressed a strong opinion&lt;/a&gt; that the right way forward would be to teach the current catalogue to be mobile-friendly by applying principles of responsive design. In fact, I stated:&lt;/p&gt;
&lt;blockquote&gt;
Almost all of this can be achieved via CSS, possibly with some changes to the underlying HTML (e.g. tables to divs or whatever so that &quot;Place Hold&quot; appears under the bib info instead of way over to the right).
&lt;/blockquote&gt;
&lt;p&gt;I have this bad habit of talking more than doing. So when I saw the Beanstalk mobile catalogue resurrected again at the Evergreen 2013 lightning talks, it bugged me that I still hadn&#039;t put any effort into a proof of concept of what was possible with &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/CSS/Media_queries&quot;&gt;CSS media queries&lt;/a&gt;. Thus, today, on the last day of my holidays, I spent a few hours trying things out on our development server and came up with &lt;a href=&quot;http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/responsive_tpac&quot;&gt;this &lt;em&gt;rough&lt;/em&gt; branch&lt;/a&gt; to work towards making the exact same HTML that we serve up for desktops provide an experience similar to that of the Beanstalk generation of catalogues for mobile, just via CSS.&lt;/p&gt;
&lt;p&gt;As you can see from the commits, I made one change to the HTML to define a viewport, and added one set of CSS rules wrapped in a media query; in essence:&lt;/p&gt;
&lt;pre&gt;
...
&amp;lt;head&amp;gt;
...
&amp;lt;meta content=&quot;initial-scale=1.0,width=device-width&quot; name=&quot;viewport&quot;&amp;gt;
&amp;lt;style&amp;gt;
@media only screen and (max-width: 600px) {
    #header {
        padding: 0px;
        margin: 0px;
    }
    .facet_sidebar {
        display: none;
    }
    ...
}
&amp;lt;/style&amp;gt;
&amp;lt;head&amp;gt;
...
&lt;/pre&gt;
&lt;h4&gt;Results and trade-offs&lt;/h4&gt;
&lt;p&gt;Here are a few example URLs from our test server (which is slow, and might get wiped any day, so test them quickly if you have a mobile device around!):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://laurentian-test.concat.ca/eg/opac/results?query=open+source&amp;qtype=keyword&amp;locg=103&amp;detail_record_view=1&quot;&gt;Search results&lt;/a&gt; - sacrificed facets, per-item actions, and the language picker&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://laurentian-test.concat.ca/eg/opac/record/729926?query=open%20source;qtype=keyword;locg=103;detail_record_view=1&quot;&gt;Record details&lt;/a&gt; - sacrificed per-item actions, flattened the item table vertically&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In general, I removed a lot of the frippery from the header, while trying to retain the most valuable pieces. However, some bits are broken: &lt;strong&gt;Another Search&lt;/strong&gt; doesn&#039;t actually let you do another search because the search bar is totally hidden. Other bits haven&#039;t been touched (&lt;strong&gt;Advanced search&lt;/strong&gt; is still overwhelming, and &lt;strong&gt;My Account&lt;/strong&gt;, while functional, could be much prettier.&lt;/p&gt;
&lt;p&gt;What I&#039;ve done so far is oriented towards our 2.3-ish lightly customized Laurentian skin (we force full details in search results, for example) but the principles should be applicable to an out-of-the-box Evergreen catalogue. In working through some of the challenges, I&#039;ve determined that I was pretty much on target back in November; with a few HTML tweaks that would improve the layout for desktops as well, we could keep the per-item actions and facets around, but just move them to a different location.&lt;/p&gt;
&lt;h4&gt;Less talk, more action&lt;/h4&gt;
&lt;p&gt;So who&#039;s with me? What we have to gain is a single set of HTML to support for TPAC, and a single set of CSS, all available from the same URL, rather than trying to maintain overlays and monkeying about with mobile-vs-desktop URLs and the like. Feel free to dig in and start pushing branches with improvements over my rough attempts and let&#039;s make this thing happen for Evergreen 2.5.&lt;/p&gt;
&lt;h4&gt;With thanks to Firefox...&lt;/h4&gt;
&lt;p&gt;I would be remiss if I did not mention the marvellous &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Tools/Responsive_Design_View&quot;&gt;Responsive Design View&lt;/a&gt; introduced in Firefox 15, along with the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Tools/Style_Editor&quot;&gt;Style Editor&lt;/a&gt;; together, these tools (built into Firefox) made my developing and testing work &lt;em&gt;so&lt;/em&gt; much easier.&lt;/p&gt;
&lt;p&gt;If you want to live on the cutting edge of Firefox, you want Aurora - go and get it &lt;img src=&quot;http://www.coffeecode.net/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://affiliates.mozilla.org/link/banner/36536&quot;&gt;&lt;img src=&quot;http://affiliates.mozilla.org/media/uploads/banners/6f0132062588b248d44968734668226f9c19d994.png&quot; alt=&quot;Download Aurora&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 21 Apr 2013 22:48:40 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/265-guid.html</guid>
    <category>coding</category>
<category>evergreen</category>

</item>
<item>
    <title>Structured data: making metadata matter for machines</title>
    <link>http://www.coffeecode.net/archives/264-Structured-data-making-metadata-matter-for-machines.html</link>
            <category>Coding</category>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/264-Structured-data-making-metadata-matter-for-machines.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=264</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=264</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;&lt;strong&gt;Update 2013-04-18:&lt;/strong&gt; Now with &lt;a href=&quot;https://archive.org/details/Microdata&quot;&gt;video of the presentation&lt;/a&gt;, thanks to the awesome #egcon2013 volunteers!&lt;/p&gt;
&lt;p&gt;I&#039;ve been attending the &lt;a href=&quot;http://eg2013.evergreen-ils.org&quot;&gt;Evergreen 2013 Conference&lt;/a&gt; in beautiful Vancouver. This morning, I was honoured to be able to give a presentation on some of the work I&#039;ve been doing on implementing linked data via &lt;a href=&quot;http://schema.org&quot;&gt;schema.org&lt;/a&gt; in Evergreen. I &lt;em&gt;think&lt;/em&gt; I did a good job of explaining the potential value of linked data and arguing for improving Evergreen&#039;s schema.org publishing ninja skills.&lt;/p&gt;
&lt;p&gt;My slides, with a reasonable number of useful speaker notes to provide context, are available in &lt;a href=&quot;http://www.coffeecode.net/uploads/talks/2013/structured_data_matters.odp&quot; title=&quot;structured_data_matters.odp&quot; target=&quot;_blank&quot;&gt;LibreOffice format&lt;/a&gt;.&lt;a href=&quot;#fn1&quot;&gt;[1]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In addition, the amazing organizers of the conference also streamed most&lt;a href=&quot;#fn2&quot;&gt;[2]&lt;/a&gt; of the talk and the recording will be available on the &lt;a href=&quot;http://eg2013.evergreen-ils.org&quot;&gt;conference web site&lt;/a&gt; in a week or two.&lt;/p&gt;
&lt;h4&gt;Footnotes&lt;/h4&gt;
&lt;ol&gt;
&lt;li id=&quot;fn1&quot;&gt;I felt pretty dirty not using HTML5 + RDFa Lite to actually mark the whole thing up; there was some question close to the time of the conference as to whether anything but PPT or perhaps PDF would be an acceptable format... a concern that was subsequently removed, but a little too late to be worthwhile changing course.&lt;/li&gt;
&lt;li id=&quot;fn2&quot;&gt;The room was standing-room only (well, sitting-on-the-floor-room only), and one of the organizers accidentally sat on and unplugged the Ethernet cable, so something like ten minutes were lost. Heh!&lt;/li&gt;
&lt;/ol&gt; 
    </content:encoded>

    <pubDate>Fri, 12 Apr 2013 15:11:47 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/264-guid.html</guid>
    <category>coding</category>
<category>evergreen</category>

</item>
<item>
    <title>Introducing SQL to Evergreen administrators, round two</title>
    <link>http://www.coffeecode.net/archives/263-Introducing-SQL-to-Evergreen-administrators,-round-two.html</link>
            <category>Evergreen</category>
            <category>PostgreSQL</category>
    
    <comments>http://www.coffeecode.net/archives/263-Introducing-SQL-to-Evergreen-administrators,-round-two.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=263</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=263</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;
&lt;a href=&quot;http://coffeecode.net/archives/212-Introduction-to-SQL-for-Evergreen-administrators.html&quot;&gt;Three years ago&lt;/a&gt; I was asked to create and deliver a two-day course introducing
SQL to Evergreen users. Things went well and I was able to share the resulting
materials with the Evergreen and PostgreSQL community. Perhaps one of my
happiest moments at the Evergreen conference last year was when one of the
participants in that course, told me that many of his fellow participants were
still successfully writing SQL queries and getting work done.  Huzzah!
&lt;/p&gt;
&lt;p&gt;
Time goes by and another group, &lt;a href=&quot;http://www.ohionet.org&quot;&gt;OHIONET&lt;/a&gt;, was running into difficulties getting
started with PostgreSQL and Evergreen. They asked me if I would be
willing to give the same sort of training I had given a few years back. &quot;Sure&quot;,
I said, thinking it would be a great opportunity to polish the materials and
add some updates to cover new features in PostgreSQL and Evergreen. We also
opted to skip the travel and do an entirely virtual training session via
Google Hangouts, which worked out rather nicely (but that&#039;s a different story).
&lt;/p&gt;
&lt;p&gt;
As it turned out, I probably ended up putting about four days worth of effort
(crammed into lots of late nights, weekends, and vacation days) into
overhauling the instruction materials. But the results were worth it, in my
opinion; I&#039;m rather proud of the content, and while I believe it stands up on
its own, the guidance that I was able to provide during the live instruction
sessions was well-received by the participants.
&lt;/p&gt;
&lt;p&gt;
Thus, I am pleased to be able to offer to the broader community the latest
version of the Introduction to SQL for Evergreen Administrators, under a
Creative Commons Attribution-ShareAlike 3.0 (Unported) license.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Reference documentation--30 pages introducing SQL with examples drawn from the Evergreen schema:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.html&quot;&gt;HTML&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.pdf&quot;&gt;PDF&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/introduction_to_sql.epub&quot;&gt;ePub&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/introduction_to_sql.epub&quot;&gt;AsciiDoc&lt;/a&gt;)
&lt;/li&gt;
&lt;li&gt;Presentation:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/SQL_instruction.odp&quot;&gt;LibreOffice Impress&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/v2/SQL_instruction.pdf&quot;&gt;PDF&lt;/a&gt;)
&lt;/li&gt;
&lt;li&gt;Solutions to exercises:
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/solutions_day_1.txt&quot;&gt;Day 1&lt;/a&gt;)
(&lt;a href=&quot;http://bzr.coffeecode.net/intro_to_sql/solutions_day_2.txt&quot;&gt;Day 2&lt;/a&gt;)
&lt;/ul&gt;
&lt;p&gt;
So, a huge thanks to OHIONET for giving me the impetus to overhaul this
material, and for giving me a chance to introduce them to the wonders of
SQL with PostgreSQL, and to the inner workings of the Evergreen schema. It
was a blast! And thanks for agreeing to let me share these materials with the
broader community.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 15 Feb 2013 21:32:08 -0500</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/263-guid.html</guid>
    <category>evergreen</category>
<category>postgresql</category>

</item>
<item>
    <title>Leaving SELinux in enforcing mode with Evergreen on Fedora 17</title>
    <link>http://www.coffeecode.net/archives/259-Leaving-SELinux-in-enforcing-mode-with-Evergreen-on-Fedora-17.html</link>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/259-Leaving-SELinux-in-enforcing-mode-with-Evergreen-on-Fedora-17.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=259</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=259</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;Ever since I switched over to Fedora a few years back (hi Fedora 13!), I&#039;ve been guilty of a dirty secret: to run Evergreen, I&#039;ve had to run &lt;tt&gt;setenforce 0&lt;/tt&gt; to disable the most excellent SELinux security policies before I could start up the Apache web server to serve up the Evergreen goodness. This worked for development purposes, but tonight something snapped and I decided that it was no longer acceptable to throw away a great layer of operating system security simply for the sake of hacking on Evergreen. So... I stepped into the world of what had formerly seemed to be inscrutable SELinux concepts, and came out with something that seems to work (at least for my fairly limited purposes thus far of searching the TPAC catalogue).&lt;/p&gt;
&lt;p&gt;This was a pretty iterative process that involved trying to start the &lt;strong&gt;httpd.service&lt;/strong&gt;, then checking &lt;tt&gt;/var/log/messages&lt;/tt&gt; and &lt;tt&gt;/var/log/audit/audit.log&lt;/tt&gt; for clues as to why httpd.service was either not starting, or (once I passed that hurdle) was simply returning internal server errors.&lt;/p&gt;
&lt;p&gt;First, due to my recent experience with running a web.py script under Fedora, I had learned that the httpd SELinux policy had a number of booleans for enforcing or allowing particular behaviours, so I immediately ran the following command to enable httpd to connect to the network:&lt;/p&gt;
&lt;pre&gt;setsebool httpd_can_network_connect on&lt;/pre&gt;
&lt;p&gt;I then needed to change the labels on many of the OpenSRF and Evergreen files that were installed and which Fedora gave a default type of &lt;tt&gt;unconfined_t&lt;/tt&gt;, which is understandably restrictive:&lt;/p&gt;
&lt;pre&gt;# Mark web content as, well, web content
chcon -R --type=httpd_sys_content_t /openils/lib/javascript
chcon -R --type=httpd_sys_content_t /openils/var/web
chcon -R --type=httpd_sys_content_t /openils/var/templates*
chcon -R --type=httpd_sys_content_t /openils/var/data
chcon -R --type=httpd_sys_content_t /openils/var/xsl
chcon --type=httpd_sys_content_t /openils/conf/opensrf_core.xml
chcon --type=httpd_sys_content_t /openils/conf/fm_IDL.xml 

# Mark the custom Apache modules 
chcon --user=system_u --type=httpd_modules_t /usr/lib64/httpd/modules/mod_xmlent.so 
chcon --user=system_u --type=httpd_modules_t /usr/lib64/httpd/modules/osrf_*

# Mark the dynamic libraries we need to load
# &quot;-h&quot; changes the context of symlinks as well as files
chcon -h --type=lib_t /openils/lib/*

# Mark executable scripts
chcon -t httpd_sys_script_exec_t /openils/bin/openurl_map.pl 
chcon -t httpd_sys_script_exec_t /openils/bin/offline-blocked-list.pl 

# Might not have been necessary
chcon -R --user=system_u /usr/local/share/perl5/
chcon --user=system_u /etc/httpd/conf.d/eg.conf 
chcon --user=system_u /etc/httpd/startup.pl 
chcon --user=system_u /etc/httpd/eg_vhost.conf 
chcon -R --user=system_u /etc/httpd/ssl/
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt; I&#039;m aware that simply running &lt;tt&gt;chcon&lt;/tt&gt; won&#039;t survive a relabelling of the files. We really need to turn this into a policy, or alternately use &lt;tt&gt;semanage&lt;/tt&gt; to make the changes permanent...&lt;/p&gt;
&lt;p&gt;Next, I opted to finally start running Apache as the stock apache:apache user/group rather than as the &lt;tt&gt;opensrf&lt;/tt&gt; user. This turned out to require only a few steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change the &lt;tt&gt;User&lt;/tt&gt; setting in &lt;tt&gt;/etc/httpd/conf/httpd.conf&lt;/tt&gt; back to &lt;tt&gt;apache&lt;/tt&gt;, reverting the change we made following the default install documentation.&lt;/li&gt;
&lt;li&gt;To avoid errors writing to the &lt;tt&gt;/openils/var/log&lt;/tt&gt; directory, cut over to using syslog - which, on Fedora, is provided by &lt;strong&gt;rsyslogd&lt;/strong&gt;.
&lt;ol&gt;&lt;li&gt;Copy the very handy &lt;tt&gt;Open-ILS/examples/evergreen-rsyslog.conf&lt;/tt&gt; file that Bill Erickson created into &lt;tt&gt;/etc/rsyslog.d/&lt;/tt&gt;&lt;/li&gt;
  &lt;li&gt;Restart the &lt;tt&gt;rsyslogd&lt;/tt&gt; service with &lt;tt&gt;systemctl restart rsyslog.service&lt;/tt&gt;.&lt;/li&gt;
  &lt;li&gt;Edit &lt;tt&gt;/etc/httpd/eg_vhost.conf&lt;/tt&gt; and &lt;tt&gt;/openils/conf/opensrf_core.xml&lt;/tt&gt; to use syslog instead of writing to log files.&lt;/li&gt;
  &lt;li&gt;Restart the OpenSRF services.&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;One more restart of the httpd service and I was in business.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So this is a start. I think this has broader implications than for just Fedora; we should stop using the &lt;tt&gt;opensrf&lt;/tt&gt; user to run the Apache service in the default configuration on all distributions (we&#039;ve discussed this several times in the past, but never really done anything about it).&lt;/p&gt;
&lt;p&gt;I hope to update the README accordingly, and I also hope to take the SELinux work a step further to provide a modified policy so that Fedora and Red Hat (and derivative) distributions can offer a more secure environment for running Evergreen.&lt;/p&gt;
&lt;p&gt;Oh, and some handy resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.centos.org/HowTos/SELinux&quot;&gt;CentOS SELinux HOWTO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.centos.org/TipsAndTricks/SelinuxBooleans&quot;&gt;CentOS SELinux Booleans&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/&quot;&gt;Fedora SELinux FAQ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Sun, 02 Sep 2012 01:26:59 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/259-guid.html</guid>
    <category>evergreen</category>

</item>
<item>
    <title>Enabling mod_wsgi with LDAP access under Fedora 17</title>
    <link>http://www.coffeecode.net/archives/257-Enabling-mod_wsgi-with-LDAP-access-under-Fedora-17.html</link>
            <category>Evergreen</category>
    
    <comments>http://www.coffeecode.net/archives/257-Enabling-mod_wsgi-with-LDAP-access-under-Fedora-17.html#comments</comments>
    <wfw:comment>http://www.coffeecode.net/wfwcomment.php?cid=257</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.coffeecode.net/rss.php?version=2.0&amp;type=comments&amp;cid=257</wfw:commentRss>
    

    <author>dan@coffeecode.net (Dan Scott)</author>
    <content:encoded>
    &lt;p&gt;Continuing my path of &lt;em&gt;new problem to solve = opportunity to try something new&lt;/em&gt;, I opted to give &lt;a href=&quot;http://webpy.org&quot;&gt;web.py&lt;/a&gt; a shot as a Web front-end for an existing script I had put together to &lt;a href=&quot;http://git.evergreen-ils.org/?p=contrib/Conifer.git;a=blob;f=tools/patron-load/ldap_osrf_sync&quot;&gt;provision users in our Evergreen library system based on their LDAP entry&lt;/a&gt;. The goal was to provide access to the functionality of the script, without having me as a single point of failure... something I have intended to put in place for a long time, but which jumped up in priority once I went on vacation and received a few requests (surprise, surprise).&lt;/p&gt;
&lt;p&gt;Creating a web.py front end was easy enough. It was a bit more challenging to put it into production, because my production box for this task runs Fedora 17, and that means SELinux. In the past, my knee-jerk reaction during development would be to &lt;tt&gt;setenforce 0&lt;/tt&gt; and be done with it, but exposing it to more than just me at the terminal means taking some care. So, fortunately, it was pretty easy to sort out (thanks largely to the assistance gleaned from &lt;a href=&quot;http://www.packtpub.com/article/selinux-secured-web-hosting-python-based-web-applications&quot;&gt;this Packtpub.com article&lt;/a&gt;, minus the compiling mod_wsgi from source bits).&lt;/p&gt;
&lt;p&gt;The pertinent bits for my case were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install mod_wsgi and web.py: &lt;tt&gt;yum install mod_wsgi python-webpy&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;Configure &lt;tt&gt;/etc/httpd/conf/httpd.conf&lt;/tt&gt; to include the appropriate &lt;tt&gt;WSGIScriptAlias&lt;/tt&gt; line&lt;/li&gt;
&lt;li&gt;Fix the SELinux label on the WSGI files: &lt;tt&gt;chcon -R httpd_user_content_t patron-load&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;Allow Apache to connect to an LDAP server: &lt;tt&gt;setsebool -P httpd_can_connect_ldap=1&lt;/tt&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;And poof: my server still has the protection of SELinux, and my desired functionality works. Yay!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 11 Jul 2012 10:23:47 -0400</pubDate>
    <guid isPermaLink="false">http://www.coffeecode.net/archives/257-guid.html</guid>
    <category>evergreen</category>

</item>

</channel>
</rss>