<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<pre> <br>Bruce: thanks for the info.&nbsp; I'm wondering about the sqlalchemy issue, and the fact that it's not found is causing an error right away.&nbsp; Can you try, as a cgi script:<br> <br>#!/Python27/python -u<br> <br>import os<br>import sqlalchemy<br> <br>print 'Content-type:text/plain\n\n'<br> <br>for k,v in os.environ.iteritems():<br>&nbsp;&nbsp;&nbsp; print '%s -&gt; %s' %(k,v)<br> <br>This should run fine assuming sqlalchemy can be found in your environment in IIS, and we can see what environment variables IIS is working with at runtime.<br> <br>I don't have an IIS environment, so if you can try, that would be great.&nbsp; We can then figure out a way to patch the IIS environment variables in the codebase.<br> <br>Thanks<br> <br>..Tom<br> <br> <br>Date: Wed, 14 Mar 2012 12:47:35 -0700<br>From: bgodfrey@uidaho.edu<br>To: gcpp.kalxas@gmail.com<br>CC: pycsw-devel@lists.sourceforge.net<br>Subject: Re: [pycsw-devel] Running on Windows 2008 Server IIS7<br> <br> <br> <br> <br>.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal<br>{margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";color:black;}<br>.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink<br>{color:blue;text-decoration:underline;}<br>.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed<br>{color:purple;text-decoration:underline;}<br>.ExternalClass pre<br>{margin-bottom:.0001pt;font-size:10.0pt;font-family:"Courier New";color:black;}<br>.ExternalClass span.ecxHTMLPreformattedChar<br>{font-family:Consolas;color:black;}<br>.ExternalClass span.ecxEmailStyle19<br>{font-family:"Calibri","sans-serif";color:windowtext;}<br>.ExternalClass span.ecxEmailStyle20<br>{font-family:"Calibri","sans-serif";color:#1F497D;}<br>.ExternalClass span.ecxEmailStyle21<br>{font-family:"Calibri","sans-serif";color:#1F497D;}<br>.ExternalClass .ecxMsoChpDefault<br>{font-size:10.0pt;}<br>@page WordSection1<br>{size:8.5in 11.0in;}<br>.ExternalClass div.ecxWordSection1<br>{page:WordSection1;}<br> <br>&nbsp;I added system added environment variable for 'HTTP_HOST' and 'REQUEST_URI'.&nbsp; That appears to have gotten me further along.&nbsp; But, I have another hurdle to clear it appears.&nbsp; See below.&nbsp;I’ve got simple test python scripts working in the same web directory as cws.py.&nbsp; They can be seen here:<a href="http://dev.insideidaho.org/pycsw/test.py" target="_blank">http://dev.insideidaho.org/pycsw/test.py</a> and <a href="http://dev.insideidaho.org/pycsw/test2.py" target="_blank">http://dev.insideidaho.org/pycsw/test2.py</a>.&nbsp; So, I think (fingers crossed) that I have the web server configured correctly but maybe I am overlooking something.&nbsp;When I use the pycsw tester to try make a GetCapabilities request I get a 502 error.&nbsp; &nbsp;Pycsw tester is here: <a href="http://dev.insideidaho.org/pycsw/tester/index.html" target="_blank">http://dev.insideidaho.org/pycsw/tester/index.html</a>&nbsp;When I run pycsw on the localhost machine I get this response with more details:&nbsp;#############################BEGIN RESPONSE#################################&nbsp;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"&gt; &lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>"&gt; &lt;head&gt; &lt;title&gt;IIS 7.0 Detailed Error - 502.2 - Bad Gateway&lt;/title&gt; &lt;style type="text/css"&gt; &lt;!-- body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 40px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px; &nbsp;border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696; &nbsp;border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;font-size:1em;} a:link,a:visited{color:#007EFF;font-weight:bold;} a:hover{text-decoration:none;} h1{font-size:2.4em;margin:0;color:#FFF;} h2{font-size:1.7em;margin:0;color:#CC0000;} h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;} h4{font-size:1.2em;margin:10px 0 5px 0; }#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif; &nbsp;color:#FFF;background-color:#5C87B2; }#content{margin:0 0 0 2%;position:relative;} .summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;} .config_source{background:#fff5c4;} .content-container p{margin:0 0 10px 0; }#details-left{width:35%;float:left;margin-right:2%; }#details-right{width:63%;float:left; }#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF; &nbsp;background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal; &nbsp;font-size:1em;color:#FFF;text-align:right; }#server_version p{margin:5px 0;} table{margin:4px 0 4px 0;width:100%;border:none;} td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:bold;border:none;} th{width:30%;text-align:right;padding-right:2%;font-weight:normal;} thead th{background-color:#ebebeb;width:25%; }#details-right th{width:20%;} table tr.alt td,table tr.alt th{background-color:#ebebeb;} .highlight-code{color:#CC0000;font-weight:bold;font-style:italic;} .clear{clear:both;} .preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;} --&gt; &lt;/style&gt; &nbsp;&lt;/head&gt; &lt;body&gt; &lt;div id="header"&gt;&lt;h1&gt;Server Error in Application "DEFAULT WEB SITE/PYCSW"&lt;/h1&gt;&lt;/div&gt; &lt;div id="server_version"&gt;Internet Information Services 7.0&lt;BR&gt;&lt;/div&gt; &lt;div id="content"&gt; &lt;div class="content-container"&gt; &nbsp;&lt;fieldset&gt;&lt;legend&gt;Error Summary&lt;/legend&gt; &nbsp;&nbsp;&lt;h2&gt;HTTP Error 502.2 - Bad Gateway&lt;/h2&gt; &nbsp;&nbsp;&lt;h3&gt;The specified CGI application misbehaved by not returning a complete set of HTTP headers.&nbsp; The headers it did return are &amp;quot;Traceback (most recent call last):&nbsp; File &amp;quot;C:\criticalApplications\console\pycsw\pycsw-1.0.0\csw.py&amp;quot;, line 34, in &amp;lt;module&amp;gt;&nbsp;&nbsp;&nbsp; from server import server&nbsp; File &amp;quot;C:\criticalApplications\console\pycsw\pycsw-1.0.0\server\server.py&amp;quot;, line 40, in &amp;lt;module&amp;gt;&nbsp;&nbsp;&nbsp; import config, fes, log, profile, repository, util&nbsp; File &amp;quot;C:\criticalApplications\console\pycsw\pycsw-1.0.0\server\repository.py&amp;quot;, line 33, in &amp;lt;module&amp;gt;&nbsp;&nbsp; &nbsp;from sqlalchemy import create_engine, desc, funcImportError: No module named sqlalchemy&amp;quot;.&lt;/h3&gt; &nbsp;&lt;/fieldset&gt; &lt;/div&gt; &lt;div class="content-container"&gt; &nbsp;&lt;fieldset&gt;&lt;legend&gt;Detailed Error Information&lt;/legend&gt; &nbsp;&nbsp;&lt;div id="details-left"&gt; &nbsp;&nbsp;&nbsp;&lt;table border="0" cellpadding="0" cellspacing="0"&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class="alt"&gt;&lt;th&gt;Module&lt;/th&gt;&lt;td&gt;CgiModule&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;th&gt;Notification&lt;/th&gt;&lt;td&gt;ExecuteRequestHandler&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class="alt"&gt;&lt;th&gt;Handler&lt;/th&gt;&lt;td&gt;Python&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;th&gt;Error Code&lt;/th&gt;&lt;td&gt;0x00000001&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt; &nbsp;&nbsp;&lt;/div&gt; &nbsp;&nbsp;&lt;div id="details-right"&gt; &nbsp;&nbsp;&nbsp;&lt;table border="0" cellpadding="0" cellspacing="0"&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class="alt"&gt;&lt;th&gt;Requested URL&lt;/th&gt;&lt;td&gt;<a href="http://dev.insideidaho.org:80/pycsw/csw.py" target="_blank">http://dev.insideidaho.org:80/pycsw/csw.py</a>&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;th&gt;Physical Path&lt;/th&gt;&lt;td&gt;C:\criticalApplications\console\pycsw\pycsw-1.0.0\csw.py&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class="alt"&gt;&lt;th&gt;Logon Method&lt;/th&gt;&lt;td&gt;Anonymous&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;&lt;th&gt;Logon User&lt;/th&gt;&lt;td&gt;Anonymous&lt;/td&gt;&lt;/tr&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/table&gt; &nbsp;&nbsp;&nbsp;&lt;div class="clear"&gt;&lt;/div&gt; &nbsp;&nbsp;&lt;/div&gt; &nbsp;&lt;/fieldset&gt; &lt;/div&gt; &lt;div class="content-container"&gt; &nbsp;&lt;fieldset&gt;&lt;legend&gt;Most likely causes:&lt;/legend&gt; &nbsp;&nbsp;&lt;ul&gt; &nbsp;&nbsp;&nbsp; &lt;li&gt;The CGI process was shut down or terminated unexpectedly before it finished processing the request.&lt;/li&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;The CGI process has a flaw and does not return a complete set of HTTP headers.&lt;/li&gt; &lt;/ul&gt; &nbsp;&lt;/fieldset&gt; &lt;/div&gt; &lt;div class="content-container"&gt; &nbsp;&lt;fieldset&gt;&lt;legend&gt;Things you can try:&lt;/legend&gt; &nbsp;&nbsp;&lt;ul&gt; &nbsp;&nbsp;&nbsp; &lt;li&gt;Check the event logs on the system to see whether the CGI process is shutting down unexpectedly.&lt;/li&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;Troubleshoot the CGI application to determine why it is not sending a complete set of HTTP headers.&lt;/li&gt; &lt;/ul&gt; &nbsp;&lt;/fieldset&gt; &lt;/div&gt; &nbsp;&nbsp;&lt;div class="content-container"&gt; &nbsp;&lt;fieldset&gt;&lt;legend&gt;Links and More Information&lt;/legend&gt; &nbsp;&nbsp;This error occurs when the CGI process handling the request exits before it finishes sending the response to IIS. &nbsp;&nbsp;&lt;a href="<a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=502,2,0x00000001,6002" target="_blank">http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=502,2,0x00000001,6002</a>"&gt;View more information &amp;raquo;&lt;/a&gt;&lt;BR&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/fieldset&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;&nbsp;#############################END RESPONSE#################################&nbsp;&nbsp;Note that “sqlalchemy’ show up in the list when I use “help(‘modules’)” &nbsp;It seems like the crux of the issue is that IIS7 doesn’t like the way the HTTP headers being returned by the pycsw script(s).&nbsp; Maybe a syntax issue?&nbsp; I’m not sure.&nbsp; I’m definitely no expert.&nbsp; Since I can run the test.py scripts I’m hoping that the web server is configured properly.&nbsp; If not I’m not quite sure where to look at this point.&nbsp; But, maybe it is still an IIS7 configuration issue.&nbsp;Ideas on how to troubleshoot this or get it working? &nbsp;Thanks much!&nbsp;-Bruce&nbsp;&nbsp;From: Angelos Tzotsos [mailto:gcpp.kalxas@gmail.com] <br>Sent: Tuesday, March 13, 2012 6:08 PM<br>To: Godfrey, Bruce<br>Cc: pycsw-devel@lists.sourceforge.net<br>Subject: Re: [pycsw-devel] Running on Windows 2008 Server IIS7&nbsp;Hi Bruce,<br> <br>Yes, it seems that this issue is Windows specific. The "HTTP_HOST" variable is not set in the environment variables.<br> <br>Please try this from a Python console:<br> <br>import os<br>os.environ<br> <br>and send the output.<br> <br>Thanks,<br>Angelos<br> <br>On 03/14/2012 01:29 AM, Godfrey, Bruce wrote: Hi Angelos,&nbsp;Yes, thank you, I was able to get it working using the syntax C:\\www\\pycsw&nbsp;I’ve run into this issue now:&nbsp;Traceback (most recent call last):&nbsp; File "C:\criticalApplications\console\pycsw\pycsw-1.0.0\csw.py", line 40, in &lt;module&gt;&nbsp;&nbsp;&nbsp; CSW.dispatch()&nbsp; File "C:\criticalApplications\console\pycsw\pycsw-1.0.0\server\server.py", line 161, in dispatch&nbsp;&nbsp;&nbsp; (os.environ['HTTP_HOST'], os.environ['REQUEST_URI'])&nbsp; File "C:\Python27\lib\os.py", line 423, in __getitem__&nbsp;&nbsp;&nbsp; return self.data[key.upper()]KeyError: 'HTTP_HOST'&gt;&gt;&gt;&nbsp;&nbsp;I think I’m close but I’m not sure where to look to try to track this down.&nbsp; I wonder if it is an IIS7 issue?&nbsp;-Bruce&nbsp;From: Angelos Tzotsos [mailto:gcpp.kalxas@gmail.com] <br>Sent: Tuesday, March 13, 2012 4:22 PM<br>To: pycsw-devel@lists.sourceforge.net<br>Subject: Re: [pycsw-devel] Running on Windows 2008 Server IIS7&nbsp;Hello Bruce,<br> <br>Did you try the windows path like c:\path\to\pycsw ?<br> <br>Regards,<br>Angelos<br> <br>On 03/13/2012 04:44 AM, Godfrey, Bruce wrote: Hello,&nbsp;I’m attempting to get pycsw running on a Windows 2008 box with IIS7.&nbsp; I have all the supporting libraries installed and I have SQLite3.&nbsp; I’ll preface this by saying I have pretty limited experience with python.&nbsp; &nbsp;I’ve changed the first line of csw.py to: #!/Python27/python -u&nbsp;At this point I need edit default.cfg, correct?&nbsp;What is the correct syntax for:&nbsp; home=/var/www/pycsw on Windows?&nbsp; Is it like: c:\path\to\defaul.cfg?&nbsp;Thank you for any assistance in getting this running on my Windows box.&nbsp; I really appreciate it.&nbsp; &nbsp;-Bruce&nbsp;&nbsp;<br> <br> <br> <br>------------------------------------------------------------------------------Keep Your Developer Skills Current with LearnDevNow!The most comprehensive online learning library for Microsoft developersis just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,Metro Style Apps, more. Free future releases when you subscribe now!<a href="http://p.sf.net/sfu/learndevnow-d2d" target="_blank">http://p.sf.net/sfu/learndevnow-d2d</a><br> <br> <br> <br>_______________________________________________pycsw-devel mailing listpycsw-devel@lists.sourceforge.net<a href="https://lists.sourceforge.net/lists/listinfo/pycsw-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/pycsw-devel</a><br> <br> <br> <br>-- Angelos TzotsosRemote Sensing LaboratoryNational Technical University of Athens<a href="http://users.ntua.gr/tzotsos" target="_blank">http://users.ntua.gr/tzotsos</a><br> <br> <br>-- Angelos TzotsosRemote Sensing LaboratoryNational Technical University of Athens<a href="http://users.ntua.gr/tzotsos" target="_blank">http://users.ntua.gr/tzotsos</a><br>------------------------------------------------------------------------------<br>Virtualization &amp; Cloud Management Using Capacity Planning<br>Cloud computing makes use of virtualization - but cloud computing <br>also focuses on allowing computing to be delivered as a service.<br><a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</a><br>_______________________________________________<br>pycsw-devel mailing list<br>pycsw-devel@lists.sourceforge.net<br><a href="https://lists.sourceforge.net/lists/listinfo/pycsw-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/pycsw-devel</a><br></pre>                                               </div></body>
</html>