<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Weberns Hideout &#187; Linux</title>
	<atom:link href="http://www.huug.no/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.huug.no</link>
	<description>Mitt gjemmested</description>
	<lastBuildDate>Thu, 27 Jan 2011 20:52:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>nginx as reverse proxy for OCS 2007 R2 Web Components</title>
		<link>http://www.huug.no/2010/07/26/nginx-as-reverse-proxy-for-ocs-2007-r2-web-components/</link>
		<comments>http://www.huug.no/2010/07/26/nginx-as-reverse-proxy-for-ocs-2007-r2-web-components/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 13:26:44 +0000</pubDate>
		<dc:creator>webern</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OCS]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Live Meeting]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[reverse proxy]]></category>

		<guid isPermaLink="false">http://www.huug.no/?p=139</guid>
		<description><![CDATA[Howto use nginx as reverse proxy for OCS 2007 R2 Web Components]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on this case to deploy OCS 2007 R2 in a Hosted (multi-tenant) environment to our customers and an important part of that is security.</p>
<p>Because of that we decided to use a reverse proxy in front of the web components server, and at first the software we chose was squid. After messing around and not getting it to work I gave up and went to give nginx a try.</p>
<p>With no previous nginx experience I sure as hell was excited about it, &#8220;would this actually work? how long would it take to get the configuration right? Squid took forever with scrolling through (old) configuration examples&#8221;.</p>
<p>To my enjoyment it was exremely easy to get up and running. Here&#8217;s a walkthrough:</p>
<ul>
<li> Reverse proxy DNS name (should be available in the external DNS): ocsedgeweb.fabrikam.com</li>
<li> Web components server (with a single server in my case the pool server): ocspool01.fabrikam.com</li>
<li> Now, make sure that the reverse proxy server is able to connect to ocspool01.fabrikam.com (needs the DNS lookup and open ports &#8212; 443 presumably). You can test this by typing the following in the console on the reverse proxy:<br />
telnet ocspool01.fabrikam.com 443</li>
<li>Next up is to install nginx, I won&#8217;t go into the details here since it differs from distribution to distribution, but it should be fairly easy.</li>
<li>Get some certificates, yours should have the subject name ocsedgeweb.fabrikam.com. Save the certificate and private key in /etc/nginx</li>
<li>Edit /etc/nginx/nginx.conf as follows</li>
</ul>
<pre name="code" class="cpp">
user nobody;
worker_processes 4;
events {
&#09;worker_connections 1024;
}

http {
&#09;include mime.types;
&#09;default_type application/octet-stream;

&#09;sendfile on;
&#09;keepalive_timeout 65;
&#09;server {
&#09;&#09;listen 443;
&#09;&#09;ssl on;
&#09;&#09;ssl_certificate /etc/nginx/certificate.crt;
&#09;&#09;ssl_certificate_key /etc/nginx/private.key;
&#09;&#09;ssl_session_timeout 5m;
&#09;&#09;ssl_protocols SSLv2 SSLv3 TLSv1;
&#09;&#09;ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
&#09;&#09;ssl_prefer_server_ciphers on;
&#09;&#09;server_name ocsedgeweb.fabrikam.com;
&#09;&#09;location / {
&#09;&#09;&#09;proxy_pass https://ocspool01.fabrikam.com:443;
&#09;&#09;&#09;proxy_set_header Host ocsedgeweb.fabrikam.com;
&#09;&#09;&#09;proxy_set_header X-Real-IP $remote_addr;
&#09;&#09;&#09;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
&#09;&#09;&#09;proxy_max_temp_file_size 0;
&#09;&#09;&#09;proxy_connect_timeout 30;
&#09;&#09;&#09;proxy_read_timeout 120;
&#09;&#09;}
&#09;}
}</pre>
<p>Now start nginx and try uploading a file in Live Meeting for example.</p>
<p>As a note: we&#8217;ve set authentication on /Abs/Ext/, /etc/place and /GroupExpansion/Ext to &#8216;Basic&#8217; instead of the default &#8216;Windows Integrated&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.huug.no/2010/07/26/nginx-as-reverse-proxy-for-ocs-2007-r2-web-components/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enabling URL-records in PowerDNS</title>
		<link>http://www.huug.no/2009/09/29/enabling-url-records-in-powerdns/</link>
		<comments>http://www.huug.no/2009/09/29/enabling-url-records-in-powerdns/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 08:24:23 +0000</pubDate>
		<dc:creator>webern</dc:creator>
				<category><![CDATA[PowerDNS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.huug.no/?p=6</guid>
		<description><![CDATA[Tired of setting up small web hotels just so you can redirect domains to another url? Well, so was I. Luckily we&#8217;re using PowerDNS which supports URL-type record. What it basically do, is telling your PowerDNS nameserver that you have a fancy record it should do something with. Let&#8217;s get started: First of all, you [...]]]></description>
			<content:encoded><![CDATA[<p>Tired of setting up small web hotels just so you can redirect domains to another url? Well, so was I.<br />
Luckily we&#8217;re using PowerDNS which supports URL-type record. What it basically do, is telling your PowerDNS nameserver that you have a fancy record it should do something with.</p>
<p>Let&#8217;s get started:</p>
<ul>
<li> First of all, you should enable fancy records in PowerDNS. Open up pdns.conf and paste this:
<pre>fancy-records=yes</pre>
</li>
<li>Then, you should tell it where your redirector-service is, replace 192.168.1.1 with your publically accessible redirector-service:
<pre>urlredirector=192.168.1.1</pre>
</li>
<li>Next up is to enable your webserver to redirect the requests. First, add a new virtual site. How you do this varies between different distros I&#8217;ll leave that up to the reader. Here&#8217;s my current virtual host for it:
<pre class="html">&lt;VirtualHost _default_:80&gt;
ServerAdmin hostmaster@localhost
DocumentRoot /var/www/html/urlredirect
ErrorLog logs/urlredirect-error_log
CustomLog logs/urlredirect-access_log common
&lt;/VirtualHost&gt;</pre>
</li>
<li>Next, and finally, create a simple php-page that actually does the redirecting. It will connect to the MySQL-backend of PowerDNS, read the URL-record and redirect the user to that location.
<pre class="php" name="code">index.php
&lt;?php

// Get the server name our user requested
$servername = $_SERVER["HTTP_HOST"]; 

// replace this with credentials to your powerdns database
@mysql_connect('db-host','username','password');
// replace this with the right database name
@mysql_select_db('powerdns');
$result = @mysql_query("SELECT content FROM records WHERE name = '$servername' AND type = 'URL' LIMIT 1");
// Query for our redirection
if (mysql_num_rows($result) == 1) {
// we got a result, redirect to that
$row = @mysql_fetch_object($result);
header("Location: $row-&gt;content");
} else {
// we didn't get any result for unknown reason, redirect to failsafe place
header("Location: http://www.google.com");
}
?&gt;</pre>
</li>
<li>This should be it! If you&#8217;re really brave you could also add a rewrite rule to make sure all requests get redirect, not only those to somedomain.com/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.huug.no/2009/09/29/enabling-url-records-in-powerdns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

