<?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>Bennyland &#187; server</title>
	<atom:link href="http://blog.bennyland.com/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bennyland.com</link>
	<description>this server is running in my bedroom - benny’s learning how to run a linux server</description>
	<lastBuildDate>Thu, 06 Jan 2011 16:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Serving ASP.NET pages in Apache on CentOS 5</title>
		<link>http://blog.bennyland.com/2010/02/06/serving-asp-net-pages-in-apache-on-centos-5/</link>
		<comments>http://blog.bennyland.com/2010/02/06/serving-asp-net-pages-in-apache-on-centos-5/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:59:32 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=78</guid>
		<description><![CDATA[I'm starting to love ASP.NET and the ability to do everything in C# (I'm currently working on an internal silverlight app at work and creating a RESTful API is more fun in C#). Anyway, you can do a yum install mod_mono, but it's a pretty old version so I did some research and found a [...]]]></description>
			<content:encoded><![CDATA[<p>I'm starting to love ASP.NET and the ability to do everything in C# (I'm currently working on an internal silverlight app at work and creating a RESTful API is more fun in C#).  Anyway, you can do a yum install mod_mono, but it's a pretty old version so I did some research and found a <a href="http://poormanstech.blogspot.com/2007/05/installing-mono.html">guide on building it yourself</a> along with two other guides that were roughly the same, but not as good... (<a href="http://blog.rubypdf.com/2009/10/23/how-to-install-mono-2-4-2-3-on-centos-5/">1</a>, <a href="http://init.sh/?p=74">2</a>) and somehow ended up with a working server.  This is a companion to that guide with more up to date versions of things. (it took me SEVERAL trial and error attempts to get things working :/ so hopefully i didn't miss any steps)</p>
<p>Let me preface this with the fact that if you're running one of the already supported OSs (debian or unbuntu for instance) you shouldn't follow this guide - instead you should just look on the mono website for information.<br />
<span id="more-78"></span><br />
First thing I did was grab the most up-to-date mono and xst sources (i matched versions)</p>
<pre class="brush: bash; title: ;">cd /tmp
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.6.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.6.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.6.tar.bz2</pre>
<p>Then unpack everything</p>
<pre class="brush: bash; title: ;">tar -jxvf mono-2.6.tar.bz2
 tar -jxvf xsp-2.6.tar.bz2
 tar -jxvf mod_mono-2.6.tar.bz2</pre>
<p>then build mono first (change anything on the ./configure line to your liking, I do suggest picking a place to put mono, letting it install wherever it wants to makes the rest of the process very painful!):</p>
<pre class="brush: bash; title: ;">cd /tmp/mono-2.6
./configure --prefix=/opt/mono
make ; make install
echo export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig:$PKG_CONFIG_PATH&gt;&gt;~/.bash_profile
echo export PATH=/opt/mono/bin:$PATH&gt;&gt;~/.bash_profile
source ~/.bash_profile</pre>
<p>after a bit you'll have mono installed <img src='http://blog.bennyland.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now build xsp (i had to add pkgconfig to an environment variable to get it to work)</p>
<pre class="brush: bash; title: ;">cd /tmp/xsp-2.6
./configure --prefix=/opt/mono
make ; make install</pre>
<p>Finally build mod_mono, you'll probably need to tell it where apache's apr-config is... it took a while for me to find it.. heh</p>
<pre class="brush: bash; title: ;">find / -iname apr*config
cd /tmp/mod_mono-2.6
./configure --prefix=/opt/mono --with-mono-prefix=/opt/mono --with-apr-config=/usr/bin/apr-1-config
make ; make install</pre>
<p>you should now find mod_mono in your apache modules dir (in my case /usr/lib64/httpd/modules/)</p>
<pre class="brush: bash; title: ;">ls /usr/lib64/httpd/modules/mod_mono*
17 Feb  5 22:54 /usr/lib64/httpd/modules/mod_mono.so -&gt; mod_mono.so.0.0.0
145511 Feb  5 22:54 /usr/lib64/httpd/modules/mod_mono.so.0.0.0
</pre>
<p>the mod_mono install seems to have automatically created mod_mono.conf in my httpd/conf folder, but you may want to make sure it's there</p>
<pre class="brush: bash; title: ;">vim /etc/httpd/conf/mod_mono.conf</pre>
<pre class="brush: plain; title: ;"># mod_mono.conf

# Achtung! This file may be overwritten
# Use 'include mod_mono.conf' from other configuration file
# to load mod_mono module.

&lt;IfModule !mod_mono.c&gt;
    LoadModule mono_module /usr/lib64/httpd/modules/mod_mono.so
&lt;/IfModule&gt;

&lt;IfModule mod_headers.c&gt;
    Header set X-Powered-By &quot;Mono&quot;
&lt;/IfModule&gt;

AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .vb
AddType application/x-asp-net .master
AddType application/x-asp-net .sitemap
AddType application/x-asp-net .resources
AddType application/x-asp-net .skin
AddType application/x-asp-net .browser
AddType application/x-asp-net .webinfo
AddType application/x-asp-net .resx
AddType application/x-asp-net .licx
AddType application/x-asp-net .csproj
AddType application/x-asp-net .vbproj
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
</pre>
<p>Now, you need to get this to work with ISPConfig3, since if you've followed my other tutorials, that's what you have running things on the back end.</p>
<p>Modify your httpd.conf file to include mod_mono.conf.  You want to do this at the very bottom, just before the NameVirtualHost directives (ISPConfig puts 3 directives at the very bottom of httpd.conf, you want to place this line just before them:</p>
<pre class="brush: bash; title: ;">vim /etc/httpd/conf/httpd.conf</pre>
<pre class="brush: plain; title: ;">Include /etc/httpd/conf/mod_mono.conf
# this is where ISPConfig's stuff is, don't modify it, this comment is so you know where to put the line above the comment <img src='http://blog.bennyland.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />
NameVirtualHost *:80
NameVirtualHost *:443
Include /etc/httpd/conf/sites-enabled/
</pre>
<p>now, restart apache</p>
<pre class="brush: bash; title: ;">service httpd restart</pre>
<p>and open up ISPConfig.  go to sites > website > Select the website you want to add a mono enabled directory to, then click on the "Options" tab for that site.  Enter the following into the Apache Directives (<strong>replace /var/www/path/to/the/web/folder with the path to that site's web folder</strong>)</p>
<pre class="brush: plain; title: ;">MonoPath default &quot;/opt/mono/lib/mono/2.0&quot;
MonoServerPath default /opt/mono/bin/mod-mono-server
AddMonoApplications default &quot;/test:/var/www/path/to/the/web/folder/test&quot;
&lt;location /test&gt;
	MonoSetServerAlias default
	SetHandler mono
&lt;/location&gt;
</pre>
<p>and finally restart httpd</p>
<pre class="brush: bash; title: ;">service httpd restart</pre>
<p>here's a test page, create it in your /var/www/path/to/the/web/folder/test directory and set the permissions to whatever the other site's permissions are, or apache.apache</p>
<pre class="brush: xml; title: ;">&lt;html&gt;
&lt;body&gt;
&lt;% Response.Write(&quot;Hello World!&quot;); %&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>now, once ISPConfig restarts apache (sometimes this is instant but i've seen it take up to 5 minutes) you'll see Hello World! displayed</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/02/06/serving-asp-net-pages-in-apache-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dynamic DNS support for WHM using ddclient</title>
		<link>http://blog.bennyland.com/2010/01/20/dynamic-dns-support-for-whm-using-ddclient/</link>
		<comments>http://blog.bennyland.com/2010/01/20/dynamic-dns-support-for-whm-using-ddclient/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 23:11:01 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dynamic dns]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[whm]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=36</guid>
		<description><![CDATA[The server which I use to use to host my websites is now primarily used as my DNS and also a backup ftp space for this server to store backups (that way I don't have to buy some sort of tape backup thing). This is great except for the fact that my IP changes a [...]]]></description>
			<content:encoded><![CDATA[<p>The server which I use to use to host my websites is now primarily used as my DNS and also a backup ftp space for this server to store backups (that way I don't have to buy some sort of tape backup thing).  This is great except for the fact that my IP changes a couple of times a year.  Up until now I was pushing requests from the webhost's DNS to <a title="dyndns" href="http://dyndns.org" target="_blank">dyndns</a> and then to my home server running <a title="ddclient" href="http://ddclient.sourceforge.net/" target="_blank">ddclient</a> to update dyndns.  Of course I could have paid around $30 a year per domain but I'm cheap.</p>
<p>So I modified ddclient so that it would update my host's DNS server.  My host uses <a title="cpanel and whm" href="http://www.cpanel.net/" target="_blank">cpanel/WHM</a> which luckily has a JSON API!</p>
<p>Here's how you can make the same modifications:<span id="more-36"></span></p>
<p>Install ddclient on your server - this is easy</p>
<pre class="brush: bash; title: ;">yum install ddclient</pre>
<p>You're also going to need some perl mods:</p>
<pre class="brush: bash; title: ;">cpan</pre>
<p>note: don't just copy and paste these 4 lines at once, some of the installs may have you type "yes" at some point.  In the case of WWW::Mechanize, it forced me to type "yes" at least 4 times.</p>
<pre class="brush: plain; title: ;">
install JSON
install JSON::XS
install WWW::Mechanize
exit
</pre>
<p>Now, make sure you have version 3.7.3 of ddclient and then patch it with this <a href='http://blog.bennyland.com/wp-content/uploads/2010/01/ddclient.tar.gz'>ddclient 3.7.3 patch file</a></p>
<pre class="brush: bash; title: ;">
cd /tmp
wget http://blog.bennyland.com/wp-content/uploads/2010/01/ddclient.tar.gz
tar -zxvf ddclient.tar.gz
cd ddclient patch -p0 /usr/sbin/ddclient &lt; ddclient.patch
</pre>
<p>Alternatively you can follow these directions:</p>
<pre class="brush: bash; title: ;">vim /usr/sbin/ddclient</pre>
<div style="border-top: black 2px dotted">
replace this:</p>
<pre class="brush: perl; first-line: 14; title: ;">
require 5.004;
use strict;
use Getopt::Long;
use Sys::Hostname;
use IO::Socket;
</pre>
<p>with:</p>
<pre class="brush: perl; first-line: 14; highlight: [19]; title: ;">
require 5.004;
use strict;
use Getopt::Long;
use Sys::Hostname;
use IO::Socket;
use WWW::Mechanize;
use JSON -support_by_pp;
</pre>
</div>
<div style="border-top: black 2px dotted">
replace this:</p>
<pre class="brush: perl; first-line: 474; title: ;">
    'sitelutions' =&gt; {
        'updateable' =&gt; undef,
        'update'     =&gt; \&amp;nic_sitelutions_update,
        'examples'   =&gt; \&amp;nic_sitelutions_examples,
        'variables'  =&gt; merge(
                          { 'server'       =&gt; setv(T_FQDNP,  1, 0, 1, 'www.sitelutions.com',   undef)    },
                          { 'min-interval' =&gt; setv(T_DELAY,  0, 0, 1, 0, interval('5m')),},
                          $variables{'service-common-defaults'},
                        ),
    },
</pre>
<p>with:</p>
<pre class="brush: perl; first-line: 474; highlight: [484]; title: ;">
    'sitelutions' =&gt; {
        'updateable' =&gt; undef,
        'update'     =&gt; \&amp;nic_sitelutions_update,
        'examples'   =&gt; \&amp;nic_sitelutions_examples,
        'variables'  =&gt; merge(
                          { 'server'       =&gt; setv(T_FQDNP,  1, 0, 1, 'www.sitelutions.com',   undef)    },
                          { 'min-interval' =&gt; setv(T_DELAY,  0, 0, 1, 0, interval('5m')),},
                          $variables{'service-common-defaults'},
                        ),
    },
    'whm' =&gt; {
        'updateable' =&gt; undef,
        'update'     =&gt; \&amp;nic_whm_update,
        'examples'   =&gt; \&amp;nic_whm_examples,
        'variables'  =&gt; merge(
                          { 'min-interval' =&gt; setv(T_DELAY,  0, 0, 1, interval('5m'), 0),},
                          $variables{'service-common-defaults'},
                        ),
    },
</pre>
</div>
<div style="border-top: black 2px dotted">
replace this:</p>
<pre class="brush: perl; first-line: 1410; title: ;">
sub split_by_comma {
    my $string = shift;

    return split /\s*[, ]\s*/, $string if defined $string;
    return ();
}
</pre>
<p>with:</p>
<pre class="brush: perl; first-line: 1410; highlight: [1416]; title: ;">
sub split_by_comma {
    my $string = shift;

    return split /\s*[, ]\s*/, $string if defined $string;
    return ();
}
sub split_by_semi {
    my $string = shift;

    return split /\s*[; ]\s*/, $string if defined $string;
    return ();
}
</pre>
</div>
<div style="border-top: black 2px dotted">
and at the very bottom of the file replace this:</p>
<pre class="brush: perl; first-line: 3185; title: ;">
######################################################################
# vim: ai ts=4 sw=4 tw=78 :
</pre>
<p>with:</p>
<pre class="brush: perl; first-line: 3185; highlight: [3185,3354]; title: ;">
######################################################################

######################################################################
## nic_whm_examples
######################################################################
sub nic_whm_examples {
    return &lt;&lt;EoEXAMPLE;

o 'whm'

The 'whm' protocol is an API provided by the cpanel/WHM system.

Configuration variables applicable to the 'whm' protocol are:
  protocol=whm                                   ##
  server=ip.of.your.whm.login  ## defaults to sitelutions.com
  login=service-login          ## login name and password  registered with the service
  password=service-password    ## whm hash used for API (not your whm password)
  host.to.update;host.to.update. #

Example ${program}.conf file entries:
  ## single host update
  protocol=whm,                                                                                                                                 \\
  login=my-whm-login,                                                                                                           \\
  password=a-really-long-hash-string                                            \\
  myhost.com;myhost.com.;subdomain1.myhost.com.;subdomain2.myhost.com.,myotherhost.com;subdomain2.myotherhost.com.

EoEXAMPLE
}
######################################################################
## nic_whm_update
##
## written by Benny Raymond
##
######################################################################
sub nic_whm_update {
    debug(&quot;\nnic_whm_update -------------------&quot;);
                my $has_failed = 0;
    ## update each configured host
    foreach my $h (@_) {
        my @host_and_names = split_by_semi($h);
        my $host_to_update = $host_and_names[0];
        my %hosts_names;
        undef %hosts_names;
        my $i = 0;
                for (@host_and_names) {
                        if ($i==0) {
                                $i++;
                        } else {
                                $hosts_names{$_} = 1;
                        }
                }
        info(&quot;setting IP address to %s for %s&quot;, $ip, $host_to_update);
        verbose(&quot;UPDATE:&quot;,&quot;updating %s&quot;, $host_to_update);

        my $url_lookup;
        $url_lookup     = &quot;http://$config{$h}{'server'}/json-api/dumpzone&quot;;
        $url_lookup .= &quot;?domain=$host_to_update&quot;;

        my $api_output = json_whm_fetch($config{$h}{'login'},$config{$h}{'password'},$url_lookup);
        if (!defined($api_output) || !$api_output) {
            failed(&quot;updating %s: Could not connect to %s.&quot;, $h, $url_lookup);
            last;
        }
        if (json_whm_status($api_output) != 1)
        {
                failed(&quot;updating %s: %s - %s&quot;, $h, json_whm_status_msg($api_output),  $url_lookup);
        }

        # loop through names and update
        # get the A records
        my(@a_records) = @{(json_whm_a_records($api_output))};
        # and update the DNS table
        foreach (@a_records)
        {
                my(%record) = %{($_)};
                if ($hosts_names{$record{name}})
                {
                    if ($record{address} eq $ip)
                    {
                        success(&quot;updating '%s' - '%s': good: IP already set to %s&quot;, $host_to_update, $record{name}, $ip);
                    }
                    else
                    {
                                # update this line
                    #    print $record{Line} . &quot;&gt;&quot; . $record{name};
                        $url_lookup     = &quot;http://$config{$h}{'server'}/json-api/editzonerecord&quot;;
                        $url_lookup .= &quot;?domain=$host_to_update&quot;;
                        $url_lookup .= &quot;&amp;Line=$record{Line}&quot;;
                        $url_lookup .= &quot;&amp;address=$ip&quot;;
                        my $api_update_output = json_whm_fetch($config{$h}{'login'},$config{$h}{'password'},$url_lookup);

                        if (json_whm_status($api_update_output) != 1)
                        {
                                failed(&quot;updating '%s' - '%s': %s %s&quot;, $host_to_update, $record{name}, json_whm_status_msg($api_update_output), $url_lookup);
                                $has_failed = 1;
                                $config{$h}{'status'} = 'failed';
                        } else {
                                success(&quot;updating '%s' - '%s': good: IP address set to %s&quot;, $host_to_update, $record{name}, $ip);
                        }
                     }
                } else {
                        # warning(&quot;name '%s' not found for host '%s'&quot;, $record{name}, $host_to_update);
                }
        }

        if ($has_failed == 0)
        {
          $config{$h}{'ip'}     = $ip;
          $config{$h}{'mtime'}  = $now;
          $config{$h}{'status'} = 'good';
        }
    }
}
sub json_whm_a_records
{
        my(%json) = %{(shift)};
        my(@records) = @{($json{result}[0]{record})};
        my(@a_records);
        foreach (@records)
        {
                my(%record) = %{($_)};
                if ($record{type} eq &quot;A&quot;)
                {
                        push(@a_records, \%record);
                }
        }
        return \@a_records;
}
sub json_whm_status
{
        my(%json) = %{(shift)};
        my $status = $json{result}[0]{status};
        return $status;
}
sub json_whm_status_msg
{
        my(%json) = %{(shift)};
        my $status = $json{result}[0]{statusmsg};
        return $status;
}
sub json_whm_fetch
{
        my ($whm_api_login) = $_[0];
        my ($whm_api_key) = $_[1];
        my ($json_url) = $_[2];
        my $browser = WWW::Mechanize-&gt;new();
        my @args = (
                Authorization =&gt; &quot;WHM &quot; . $whm_api_login . &quot;:&quot; . $whm_api_key
        );
        my $json_text = &quot;&quot;;
        eval{
                # download the json page:
                # print &quot;Getting json $json_url\n&quot;;
                $browser-&gt;get( $json_url, @args );
                my $content = $browser-&gt;content();
                my $json = new JSON;

                # these are some nice json options to relax restrictions a bit:
                $json_text = $json-&gt;allow_nonref-&gt;utf8-&gt;relaxed-&gt;escape_slash-&gt;loose-&gt;allow_singlequote-&gt;allow_barekey-&gt;decode($content);
        };
        # catch crashes:
        if($@){
                print STDERR &quot;[[JSON ERROR]] JSON parser crashed! $@\n&quot;;
                return &quot;&quot;;
        } else {
                return $json_text;
        }
}

######################################################################
# vim: ai ts=4 sw=4 tw=78 :
</pre>
</div>
<p>Save and close ddclient</p>
<pre class="brush: plain; title: ;">:wq</pre>
<p>Now, edit ddclient.conf.</p>
<pre class="brush: bash; title: ;">vim /etc/ddclient/ddclient.conf</pre>
<p>Here's a simple version (note: you need to log into WHM and get your API key or none of this is going to work.  You'll be entering your API key as one line - in WHM it is copied as several lines, just remove the carriage returns and enter it in one huge line as your password).  Notice how my domain looks, it's my domain name, followed by a colon, followed by colon seperated hostnames to update - they all have periods after them!</p>
<pre class="brush: perl; title: ;">
daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient.pid               # record PID in file.
ssl=yes                                 # use ssl-support.  Works with
                                        # ssl-library
## To obtain an IP address from Web status page (using the proxy if defined)
use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address

##
## WHM
##
server=host.or.ip.of.your.whm.maybe.with.port,       \
protocol=whm,                   \
login=your-whm-username,                 \
password=crazy-long-api-key-as-one-long-line               \
hostname.com;hostname.com.;subdomain.hostname.com.
</pre>
<p>Save and close ddclient.conf</p>
<pre class="brush: plain; title: ;">:wq</pre>
<p>And finally run it and tell it to run every time the server reboots:</p>
<pre class="brush: bash; title: ;">
/sbin/chkconfig ddclient on
/sbin/service ddclient start
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/20/dynamic-dns-support-for-whm-using-ddclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forwarding all mail to your ISP&#8217;s smtp server with postfix and CentOS 5.4</title>
		<link>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/</link>
		<comments>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 19:01:44 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=13</guid>
		<description><![CDATA[I needed to forward all server mails to external email addresses and I had to use my ISP's smtp to do it. This is because everything is blocked by my ISP to combat spammers just making their own smtp server at home and then running it all hours of the day. To do this, you should have postfix installed and running already.

This tutorial will show you how to set up postfix to use your ISP's smtp, and also how to forward internal emails to external accounts.]]></description>
			<content:encoded><![CDATA[<p>I needed to forward all server mails to external email addresses and I had to use my ISP's smtp to do it.  This is because everything is blocked by my ISP to combat spammers just making their own smtp server at home and then running it all hours of the day.  To do this, you should have postfix installed and running already.<span id="more-13"></span></p>
<h3>Setting up Postfix to use your ISP's smtp</h3>
<p>Note: if your ISP requires authentication for smtp, you'll have to do some googleing.  If they don't (mine doesn't) then this will work fine for you.</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/main.cf</pre>
<p>Next, you need to add the relayhost variable, you may have to enclose the domain in brackets, I didn't have to but I've read everywhere that you should:</p>
<pre class="brush: plain; title: ;">relayhost = [your.isps.smtp.com]</pre>
<p>Other items to potentially edit:</p>
<pre class="brush: plain; title: ;">myhostname = your.host.name
mydomain = your.domain
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
relay_domains = $mydestination</pre>
<p>Now, restart postfix</p>
<pre class="brush: bash; title: ;">service postfix reload</pre>
<h3>Forwarding name@yourdomain.com to a real e-mail address</h3>
<p>First things first, you need to edit main.cf</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/main.cf</pre>
<p>Next, either add or edit the following lines.  You can add as many domains as you want.  If you followed the <a href="http://www.howtoforge.com/perfect-server-centos-5.4-x86_64-ispconfig-3">Perfect Server</a> tutorial, you'll have all sorts of junk in these variables, just replace them.</p>
<pre class="brush: plain; title: ;">virtual_alias_domains = yourdomain.com yourotherdomain.com.
virtual_alias_maps = hash:/etc/postfix/virtual</pre>
<p>Now, edit the /etc/postfix/virtual file to add your forward rules:</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/virtual</pre>
<p>forward all mail sent to *@yourdomain.com to your@email.com and name@yourotherdomain.com to your@email.com:</p>
<pre class="brush: plain; title: ;">@yourdomain.com your@email.com
name@yourotherdomain.com your@email.com</pre>
<p>Now, restart postfix</p>
<pre class="brush: bash; title: ;">postmap /etc/postfix/virtual
service postfix reload</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing P5KPL-CM network drivers on CentOS 5.4</title>
		<link>http://blog.bennyland.com/2010/01/18/installing-p5kpl-cm-network-drivers-on-centos-5-4/</link>
		<comments>http://blog.bennyland.com/2010/01/18/installing-p5kpl-cm-network-drivers-on-centos-5-4/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 18:43:15 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[linux drivers]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=9</guid>
		<description><![CDATA[Once CentOS was installed, the first thing I had to do to make the server useful was to build and install the network drivers for myASUS P5KPL-CM Motherboard.  Here's how to do it: First, you're going to need the LinuxDrivers zip file.  You'll need to unzip and then unrar l1e-l2e-linux-v1.0.0.4.rar (found in the LinuxDrivers/L1e_Lan directory in [...]]]></description>
			<content:encoded><![CDATA[<p>Once CentOS was installed, the first thing I had to do to make the server useful was to build and install the network drivers for my<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813131288" target="_blank">ASUS P5KPL-CM Motherboard</a>.  Here's how to do it:</p>
<p>First, you're going to need the <a href="http://blog.bennyland.com/wp-content/uploads/2010/01/LinuxDrivers.zip">LinuxDrivers</a> zip file.  You'll need to unzip and then unrar l1e-l2e-linux-v1.0.0.4.rar (found in the LinuxDrivers/L1e_Lan directory in the zip).  I had to do this on my Windows PC since I couldn't install unrar on the server (no network, remember?)</p>
<p>Once you're transfered the contents of l1e-l2e-linux-v1.0.0.4.rar to the server, follow these steps:<span id="more-9"></span></p>
<pre class="brush: bash; title: ;">
su -
cd /path/to/LinuxDrivers/src/
make clean
KBUILD_NOPEDANTIC=1 make clean
KBUILD_NOPEDANTIC=1 make
KBUILD_NOPEDANTIC=1 make install
cd /lib/modules/2.6.18-92.el5xen/kernel/drivers/net/atl1e/
mv atl1e.ko atl1e.ko.old
mv /path/to/LinuxDrivers/src/atl1e.ko atl1e.ko
insmod ./atl1e.ko
</pre>
<p>Once that is done, reboot your server and then configure your network however you need to.  If all goes well, you should have eth0.  I remember the first time I set this server up I attempted to install an incorrect driver that was on the installation disc.  This caused me a lot of headaches when it came to installing the correct driver.  This time I ignored network all together during setup and I was pleasantly surprised how easy it was to build and install the drivers this time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/18/installing-p5kpl-cm-network-drivers-on-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Specs</title>
		<link>http://blog.bennyland.com/2010/01/18/server-specs/</link>
		<comments>http://blog.bennyland.com/2010/01/18/server-specs/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 18:26:01 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=6</guid>
		<description><![CDATA[This a post from the old setup... but the server is still the same.  There was a note about forgetting how I installed ReviewBoard, and how much of a pain in the ass it was - I havn't done that yet... OH BOY! Here's the original post, minus the ReviewBoard comment: Someone asked me last [...]]]></description>
			<content:encoded><![CDATA[<p>This a post from the old setup... but the server is still the same.  There was a note about forgetting how I installed ReviewBoard, and how much of a pain in the ass it was - I havn't done that yet... OH BOY!</p>
<p>Here's the original post, minus the ReviewBoard comment:</p>
<p>Someone asked me last week what the specs of the server I put together were.  Here’s the low down <span id="more-6"></span></p>
<p><strong>OS:</strong> <a href="http://isoredirect.centos.org/centos/5/isos/x86_64/" target="_blank">CentOS 5.2 64 bit </a><br />
<strong>Installed:</strong> Apache2 (pre installed), <a href="http://subversion.tigris.org/" target="_blank">Subversion</a>, <a href="http://trac.edgewall.org/" target="_blank">Trac</a>, <a href="http://www.review-board.org/" target="_blank">ReviewBoard</a>, <a href="http://wordpress.org/" target="_blank">WordPress</a></p>
<p>Server Specs (my main goals included low price and low noise):</p>
<ul>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811129034" target="_blank">Antec NSK2480 Case</a> (highly recommended… this case is awesome)</li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813131288" target="_blank">ASUS P5KPL-CM Motherboard</a> (originally purchased <a name="CART_ITEM"></a> but had to return it… I’ll never buy an MSI again)</li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819116074" target="_blank">Pentium E5300 2.6GHz</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820227199" target="_blank">OCZ Gold 2×2GB DDR2 800 RAM</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822152112" target="_blank">Samsung SPinpoint 7200 RPM SATA 500GB hard drive</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16827129031" target="_blank">DVD±R burner</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/18/server-specs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

