<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">Blog</title>
    <subtitle type="text">Blog:</subtitle>
    <link rel="alternate" type="text/html" href="http://www.4elements.com/blog" />
    <link rel="self" type="application/atom+xml" href="http://www.4elements.com/blog/atom" />
    <updated>2013-05-21T08:40:34Z</updated>
    <rights>Copyright (c) 2012, Martijn Broeders</rights>
    <generator uri="http://expressionengine.com/" version="2.5.2">ExpressionEngine</generator>
    <id>tag:4elements.com,2012:07:23</id>


    <entry>
      <title>The Perfect APC Configuration</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/the_perfect_apc_configuration" />
      <id>tag:4elements.com,2013:blog/3.189</id>
      <published>2013-03-26T09:36:40Z</published>
      <updated>2013-03-26T09:55:41Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        I’m hosting about 10 ExpressionEngine sites using Apache 2, APC, and Memcached. Here is my configuration:<br />
<br />
Operating system - Mac OS X Server Lion 10.7.5 (11G63)<br />
Processor - 2 GHz Intel Core i7<br />
RAM - 16 GB 1333 MHz DDR3<br />
Disk - 13.5 TB total<br />
Apache - 2.2.22<br />
PHP - 5.3.15<br />
APC - 3.1.13<br />
<br />
<strong>My php.ini configuration</strong><br />
<br />
<blockquote>[APC]<br />
apc.enabled=1<br />
apc.shm_segments=1<br />
<br />
;51M per ExpressionEngine install<br />
apc.shm_size=512M<br />
<br />
;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)<br />
apc.num_files_hint=7000<br />
<br />
;Relative to the size of ExpressionEngine<br />
apc.user_entries_hint=4096<br />
<br />
;The number of seconds a cache entry is allowed to idle in a slot before APC dumps the cache<br />
apc.ttl=7200<br />
apc.user_ttl=7200<br />
apc.gc_ttl=3600<br />
<br />
;Setting this to 0 will give you the best performance, as APC will<br />
;not have to check the IO for changes. However, you must clear <br />
;the APC cache to recompile already cached files. If you are still<br />
;developing, set this to 1<br />
apc.stat=0<br />
<br />
;This MUST be 0, ExpressionEngine can have errors otherwise!<br />
apc.include_once_override=0<br />
<br />
;Only set to 1 while debugging<br />
apc.enable_cli=0<br />
<br />
;Allow 2 seconds after a file is created before it is cached to prevent users from seeing half-written/weird pages<br />
apc.file_update_protection=2<br />
<br />
;Leave at 2M or lower. ExpressionEngine does't have any file sizes close to 2M<br />
apc.max_file_size=2M<br />
<br />
apc.cache_by_default=1<br />
apc.use_request_time=1<br />
apc.slam_defense=0<br />
apc.mmap_file_mask=/tmp/apc.XXXXXX<br />
apc.stat_ctime=0<br />
apc.canonicalize=1<br />
apc.write_lock=1<br />
apc.report_autofilter=0<br />
apc.rfc1867=0<br />
apc.rfc1867_prefix =upload_<br />
apc.rfc1867_name=APC_UPLOAD_PROGRESS<br />
apc.rfc1867_freq=0<br />
apc.rfc1867_ttl=3600<br />
apc.lazy_classes=0<br />
apc.lazy_functions=0</blockquote><br />
<br />
While this configuration works great for me, it may not for you. Finding “The Perfect APC Configuration” is like asking how many stars are in the sky. The are endless variables, like, “How much RAM, how many websites, do your websites support lazy classes, etc…” The best way to create your config is to do a little research. <br />
<br />
P.S. There seems to be a lot of debate about apc.stat = 0. The general thought is, set apc.stat=0 on production servers and it will prevent APC from actually going to the IO to check if the file has been changed.<br />
<br />
My advice: If you are running ExpressionEngine set apc.stat = 0. 
      ]]></content>
    </entry>

    <entry>
      <title>It’s official, II</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/its_official_ii" />
      <id>tag:4elements.com,2012:blog/3.173</id>
      <published>2012-07-23T11:15:33Z</published>
      <updated>2013-05-21T08:40:34Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>It’s official</strong>, today 4 years ago we changed our name and launched our current website.<br />
<br />
<strong>To celebrate our birthday</strong>:<br />
<img src="http://www.4elements.com/images/uploads/mergecode500d2eb4c4f34b0f03ae46321bb8b1fee7bbec1f3d9a4.png" alt="4elements, 4 years celebration." height="154" width="154" style="border: 0;" alt="image" /><br />
<br />
<strong>Coming up:</strong><br />
- Our project, Designscan.me, a breath taken new web service will be launched soon. <br /> 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Update II</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_update_ii" />
      <id>tag:4elements.com,2012:blog/3.172</id>
      <published>2012-07-02T12:51:57Z</published>
      <updated>2012-07-02T14:59:59Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>Apple just released Lion Server 10.7.4 update</strong><br />
Download and install the <a href="http://support.apple.com/downloads/DL1529/en_US/MacOSXServerUpdCombo10.7.4.dmg" target="_blank">combi update</a>, this prevents any miss behavior.<br />
<br />
After the update all the custom settings and installed scripts stayed intact and are working as it should be.<br />
With other words, it's save to update.<br />
<br />
Don't forget to download and install <a href="http://support.apple.com/downloads/DL1487/en_US/MacOSXServerUpdCombo10.7.3.dmg" target="_blank">Server Admin Tools 10.7.4</a> as well.<br /> 
      ]]></content>
    </entry>

    <entry>
      <title>cssFx, makes your live a bit easier</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/cssfx_makes_your_live_a_bit_easier" />
      <id>tag:4elements.com,2012:blog/3.171</id>
      <published>2012-04-06T09:00:04Z</published>
      <updated>2012-08-05T12:42:05Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="CSS"
        scheme="http://www.4elements.com/blog/category/css"
        label="CSS" />
      <content type="html"><![CDATA[
        <strong>cssFx</strong><br />
cssFx is a standalone polyfill that inserts the vendor-specific CSS3 properties necessary for old and new browsers. This saves you tons of time, maintenance, and bandwidth!<br />
<br />
<strong>Properties Supported</strong><br />
Border radius, box shadow, flex box, RGBA, gradients, multiple columns, border image, transforms, transitions, opacity, inline-block, ellipsis, and more.<br />
<br />
Get it (just updated): <a href="https://github.com/imsky/cssFx" >cssFx</a> 
      ]]></content>
    </entry>

    <entry>
      <title>Major CMS upgrade</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/major_cms_upgrade" />
      <id>tag:4elements.com,2012:blog/3.170</id>
      <published>2012-02-09T18:35:00Z</published>
      <updated>2012-02-09T19:40:01Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Expression Engine"
        scheme="http://www.4elements.com/blog/category/expression_engine"
        label="Expression Engine" />
      <content type="html"><![CDATA[
        Expressionengine 1.7.1 -> 2.4 Major upgrade<br />
- We needed to upgrade for future grow, more on this soon.<br />
- New version is faster and more secure.<br />
- and a lot more....<br />
<br />
Installed AutoMin (an EE module)<br />
- caching<br />
- Compressing HTML Markup (no more nice html code)<br />
- Combining css files (into one)<br />
- Combining js files (into one)<br />
<br />
The website now uses MemCache and APC, a really great improvement in page loading speed.<br />
<br />
Installed Http:BL antiSpam for forum and contact forms.<br />
This is also why I joined the projecthoneypot.org 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Update</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_update" />
      <id>tag:4elements.com,2012:blog/3.169</id>
      <published>2012-02-02T15:25:45Z</published>
      <updated>2012-02-02T17:52:46Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>Apple just released Lion Server 10.7.3 update</strong><br />
Download and install the <a href="http://support.apple.com/downloads/DL1487/en_US/MacOSXServerUpdCombo10.7.3.dmg" target="_blank">combi update</a>, this prevents any miss behavior.<br />
<br />
After the update all the custom settings and installed scripts stayed intact and are working as it should be.<br />
With other words, it's save to update.<br /> 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Part I</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_part_I" />
      <id>tag:4elements.com,2012:blog/3.165</id>
      <published>2012-01-05T13:54:07Z</published>
      <updated>2012-01-05T15:22:08Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>Part I:</strong> Intro and Goal.<br />
<strong>Part II:</strong> Preparations.<br />
<strong>Part III:</strong> Installation.<br />
<strong>Part IV:</strong> Settings.<br />
<br />
<strong>Intro: </strong><br />
My G5, dual 2Ghz and 8GB ram, server was still working like a charm.<br />
(Including a G5 Jive to add 4 extra Internal Sata disks - total 6 Internal Disks)<br />
<br />
<strong>But the downside:</strong><br />
- Heat, lots of heat. I even placed an airco in my server room.<br />
- Costs, A PowerMac G5 uses max 604 Watt. Add the airco time and your monthly bill will increase rapidly.<br />
- Noise, Due to the major fans, the heats it generates. I (sound)isolated the server room.<br />
<br />
<strong>Goal:</strong><br />
My own new web/mail/file/media server that generates less noise, heat and uses less power. And the right storage solution.<br />
<br />
<strong>Solution:</strong><br />
MacMini Server 2011 (2Ghz i7 Quad-core, 2 x 750 GB HD @ 7200 and 16GB RAM)<br />
MacMini uses:  8W (Idle) 18W (regular use) 85W (max)<br />
Sound: Silent (no sound)<br />
<br />
<strong>MacMini server:</strong> <a href="http://store.apple.com/us/configure/MC936LL/A?select=select&product=MC936LL%2FA" target="_blank">English</a> - <a href="http://store.apple.com/nl/configure/MC936FN/A?select=select&product=MC936FN%2FA" target="_blank">Dutch</a><br />
<strong>2 X 8 GB ram:</strong> <a href="http://eshop.macsales.com/item/Other%20World%20Computing/1333DDR3S16P/" target="_blank">English</a> - <a href="http://www.alternate.nl/html/product/Geheugen_SO-DIMM_DDR3/Corsair/8_GB_DDR3-1333/624968/?tn=HARDWARE&l1=Geheugen&l2=SO-DIMM&l3=DDR3" target="_blank">Dutch</a><br />
<br />
<strong>Empty Enclosure for my 4 extra Internal HD's</strong> (<a href="http://eshop.macsales.com/shop/hard-drives/RAID/Rack_Mount/FireWire_USB3_eSATA_1U" target="_blank">JBOD</a>) <br />
OWC RackPro Uses: 16W (Idle) 24W (regular use) 100W (max)<br />
Sound: Silent (no sound)<br />
<br />
Thunderbolt to eSata: <a href="http://eshop.macsales.com/item/Sonnet%20Technology/ECHOE34/" target="_blank">Thunderbolt Adapter</a> and <a href="http://eshop.macsales.com/item/Sonnet%20Technology/SATAIIPROE34/" target="_blank">eSATA adapter</a><br />
(two eSata connectors for future grow)<br />
<br />
<strong>Why eSata and not USB3:</strong><br />
USB3 is theoretically faster but eSata has no latency what makes it high responsible and low/none system resource use.<br /> 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Part II</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_part_II" />
      <id>tag:4elements.com,2012:blog/3.166</id>
      <published>2012-01-05T13:45:13Z</published>
      <updated>2012-01-05T15:35:14Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>Part II: Preparations.</strong><br />
<blockquote>Full web server, mailserver, caldav and carddav with webmin/virtualmin.</blockquote><br />
Update OS X 10.7 server software.<br />
Download <a href="https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.1_for_lion/xcode_4.1_for_lion.dmg" target="_blank">Xcode 4.1</a> + install <br />
Download <a href="http://www.macupdate.com/app/mac/13384/apple-server-admin-tools" target="_blank">ServerAdminTools</a> + install <br />
Download <a href="http://www.macupdate.com/download/39490/JavaForMacOSX10.7.dmg" target="_blank">Java</a> + install<br />
Download <a href="https://developer.apple.com/downloads/download.action?path=Developer_Tools/java_for_mac_os_x_10.7_update_1_developer_package/javadeveloper_for_mac_os_x_10.7__11m3527.dmg" target="_blank">java developer</a> + install<br />
Repair permissions<br />
<br />
<blockquote>Xcode 4.2 discontinued GCC 4.2 compiler and downgraded LLVM-GCC to 'legacy' compiler.<br />
Meaning that a lot of scripts/programs will not compile right until they are updated.<br />
This is the reason I stayed with Xcode 4.1. If you encounter problems please downgrade your Xcode 4.2.x to 4.1. (if you relay on my ffmpeg bash script you need to use Xcode 4.1)</blockquote><br />
<strong>Preps:</strong><br />
- While push mail didn't work for my setup, I decided to not use it.<br />
- But also when push was enabled, using my mac email account, I was not able to send a mail to my mac email account from the server. It continues to get back. (loop)<br />
- After installation, at the server setup section. Do not enter your mac account.<br />
<br />
<strong>Set computer name:</strong> server<br />
<strong>Set NS name:</strong> server.yourdomain.com<br />
<br />
<strong>Enable Root:</strong><br />
Macintosh HD -> System -> Library -> CoreServices -> Directory Utility<br />
Menu -> edit -> enable Root<br />
Enter a new password 2 times.<br />
Root enabled<br />
<br />
<strong>Dedicate system resources:</strong><br />
Start the server.app<br />
Select your computer under hardware.<br />
Press on settings. (see image) <br />
Disable "Dedicate system resources to server services"<br />
Restart your server.<br />
<br />
<img src="http://www.4elements.com/files/macmini_server/dedicated_system.jpg" /> 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Part III</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_part_iii" />
      <id>tag:4elements.com,2012:blog/3.167</id>
      <published>2012-01-05T13:37:47Z</published>
      <updated>2012-08-05T12:52:48Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <strong>Part III: Installation.</strong><br />
<br />
We are going to use brew to install several libs and programs.<br />
Big advantage of brew is that it makes simlinks into the local bin, lib and sbin folders.<br />
No mess as macports or fink (let's say I like this way better.)<br />
<br />
<strong>======= Brew =======</strong><br />
Brew will ask to add and change some path info. You may do this by editing <br />
<strong>BBEdit:</strong><blockquote>open /etc/paths<br />
/usr/local/sbin (infront of /usr/sbin/)<br />
/usr/local/bin (infront of /usr/bin/)</blockquote><br />
<strong>Terminal:</strong><blockquote>mkdir /usr/local/Cellar</blockquote><br />
<blockquote>/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"</blockquote><br />
<strong>Only in case there is an error.</strong><blockquote>chown name:admin /usr/local/share<br />
chown name:admin /usr/local/share/man<br />
chown name:admin /usr/local/share/man/man1<br />
chown name:admin /usr/local/Cellar</blockquote><br />
<strong>Terminal:</strong><br />
brew update<br />
<br />
<blockquote>brew install GD<br />
brew install wget<br />
brew install apc<br />
brew install libtiff<br />
brew install ghostscript<br />
brew install imagemagick<br />
brew install logrotate<br />
brew install mcrypt<br />
brew install qdbm<br />
brew install memcached<br />
brew install memcache-php<br />
brew install memcache-top<br />
brew install lynx<br />
brew install smartmontools<br />
brew install libconfig<br />
brew install GnuPG<br />
brew install re2c</blockquote><br />
<strong>Some extra brews I could use.</strong><blockquote>brew install xmlrpc-c<br />
brew install xml-coreutils<br />
brew install webfs<br />
brew install webkit2png</blockquote><br />
<strong>Read my notes.</strong><blockquote>brew install ffmpeg *<br />
brew install ffmpeg-php *<br />
brew install rrdtool **<br />
brew install ruby **<br />
brew install lsof **<br />
brew install snort **<br />
brew install libxml2 **<br />
brew install cairo **<br />
brew install squid ****<br />
brew install webalizer ***<br />
brew install mysql *****</blockquote><br />
<em>* don't use brew for this, I wrote a script that will install it all for you, and this one works <img src="http://www.4elements.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /><br />
** only needed if you would like to install system stats in webmin.<br />
*** do not install trough brew, berkery DB will cause some problems later on. (example squid or when you want to run your own postfix version)<br />
**** only needed if you would like to run squid proxy.<br />
***** Or follow the steps below (recommended)</em><br />
<br />
<strong>======= Create a work folder =======</strong><br />
We are going to download some software that we need to compile. The most clean way is to create a folder where we will put all the files.<br />
My case "work" on your main HD.<br />
<br />
<blockquote>mkdir /work</blockquote><br />
<strong>======= Installing FFMPEG and FFMPEG-php =======</strong><br />
Download my script into the work folder.<br />
Open terminal and su root.<br />
<blockquote>cd /work<br />
wget http://www.4elements.com/files/macmini_server/ffmpegphp_ok.sh.zip<br />
unzip ffmpegphp_ok.sh.zip<br />
bash ffmpegphp_ok.sh</blockquote>This will take a while.<br />
<br />
<strong>======= Installing MYSQL =======</strong><br />
Download MYSQL: http://dev.mysql.com/downloads/mysql/<br />
Pick the "Mac OS X ver 10.6 (x86, 64-bit), DMG" mysql-5.5.16-osx10.6-x86_64.dmg<br />
<br />
Turn mysql on. (system prefs)<br />
<blockquote>sudo mkdir /var/mysql<br />
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock<br />
<br />
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql<br />
ln -s /usr/local/mysql/bin/mysqld /usr/libexec/mysqld</blockquote><br />
<strong>Add to /etc/paths</strong><br />
<blockquote>/usr/local/mysql/bin"</blockquote><br />
<blockquote>sudo install_name_tool -id /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.dylib</blockquote><br />
<strong>Set up MySQL root password: (without the {})</strong><br />
<blockquote>/usr/local/mysql/bin/mysqladmin -u root password {password}<br />
/usr/local/mysql/bin/mysqladmin -u root -p{password} -h localhost password {password}<br />
/usr/local/mysql/bin/mysqladmin -u root -p{password} reload</blockquote><br />
<br />
<strong>======= Installing CPAN =======</strong><br />
Su root<br />
cpan (OSX 10.7 has 64bit as default, all will be installed as 64bit)<br />
<br />
Parameters for the 'make' command? Typical frequently used setting:<br />
<br />
<blockquote>    -j3              # dual processor system (on GNU make)<br />
 your choice -j6</blockquote><br />
<blockquote>CPAN Shell> install CPAN<br />
CPAN Shell> install YAML YAML::Syck</blockquote><br />
<blockquote>CPAN Shell> install DBI<br />
CPAN Shell> install DBD::mysql <br />
CPAN Shell> install DBD::Pg<br />
CPAN Shell> install Bundle::DBI Bundle::DBD::mysql Bundle::DBD::Pg<br />
CPAN Shell> install SQL::Statement Net::SSLeay Authen::PAM Net::LDAP</blockquote><br />
<strong>webmin, install needed for clamAV module</strong><blockquote>CPAN Shell> install Benchmark::Timer<br />
CPAN Shell> install Mail::Mbox::MessageParser<br />
CPAN Shell> force install GD<br />
CPAN Shell> install GD::Graph::lines GD::Text<br />
CPAN Shell> install Date::Manip <br />
CPAN Shell> install Compress::Zlib HTML::Entities Getopt::Long IO::File <br />
CPAN Shell> install Net::SMTP IO::Socket Mail::Internet</blockquote><br />
<strong>For webmin stats:</strong><br />
<blockquote>CPAN Shell> install Cwd English CGI::Carp Bundle::LWP<br />
CPAN Shell> install Date::Calc Bundle::libnet Crypt::SSLeay<br />
<br />
CPAN Shell> install Mail::SPF Net::DNS::Resolver::Programmable <br />
CPAN Shell> install Bundle::Email Geo::IPfree Net::XWhois SOAP::Lite</blockquote><br />
<strong>Postgrey</strong><br />
<blockquote>CPAN Shell> install Net::Server IO::Multiplex Filesys::Virtual::Plain Net::DAV::Server</blockquote><br />
<strong>http://search.cpan.org</strong> and download the following:<br />
<blockquote>NetAddr::IP<br />
Data::Dumper<br />
Digest::MD5<br />
Storable</blockquote><br />
<strong>By hand:</strong><br />
<blockquote>tar xfvz /work/Data-Dumper-2.131.tar.gz<br />
tar xfvz /work/Digest-MD5-2.51.tar.gz<br />
tar xfvz /work/NetAddr-IP-4.050.tar.gz<br />
tar xfvz /work/Storable-2.30.tar.gz</blockquote><br />
<blockquote>cd /work/Data-Dumper-2.131<br />
perl Makefile.pl<br />
make<br />
make install<br />
cd /work/Digest-MD5-2.51<br />
perl Makefile.pl<br />
make<br />
make install<br />
cd /work/NetAddr-IP-4.050<br />
perl Makefile.pl<br />
make<br />
make install<br />
cd /work/Storable-2.30<br />
perl Makefile.pl<br />
make<br />
make install</blockquote><br />
<strong>======= Apache Mod_perl =======</strong><br />
<blockquote>cd /work<br />
wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz<br />
tar xfvz /work/mod_perl-2.0-current.tar.gz<br />
cd /work/mod_perl-2.0.5<br />
perl Makefile.PL MP_APXS=/usr/sbin/apxs \<br />
MP_APR_CONFIG=/usr/bin/apr-1-config <br />
<br />
/etc/apache2/httpd.conf<br />
LoadModule perl_module  libexec/apache2/mod_perl.so</blockquote><br />
<strong>======= Apache suexec =======</strong><br />
<blockquote>cd /work<br />
wget http://apache.proserve.nl//httpd/httpd-2.2.21.tar.gz<br />
tar xfvz httpd-2.2.21.tar.gz<br />
cd /work/httpd-2.2.21<br />
./configure --with-layout=Darwin --enable-suexec --with-suexec-caller=_www --with-suexec-docroot=/home2 --with-suexec-userdir=public_html --with-suexec-logfile=/var/log/apache2/suexec_log<br />
make<br />
<br />
sudo cp /work/httpd-2.2.21/support/suexec /usr/bin/<br />
sudo chown root:_www /usr/bin/suexec <br />
sudo chmod 4750 /usr/bin/suexec<br />
<br />
cd /work/httpd-2.2.21/modules/generators<br />
sudo apxs -i -a -c mod_suexec.c<br />
(gcc -fpic -DSHARED_MODULE -I/usr/include/apache2 -c mod_suexec.c)</blockquote><br />
<strong>======= host =======</strong><br />
<blockquote>Edit host file:<br />
goto /etc<br />
open file "host" with BBEdit.<br />
127.0.0.1	localhost<br />
XX.XX.XX.XX	Hostname.domainname.com (XX is your static IP, hostname and domainname are your chosen one)</blockquote><br />
<strong>======= ProFtp =======</strong><br />
<blockquote>Install ProFtp proftpd-1.3.4rc2.tar.gz<br />
cd /work<br />
wget http://ftp.heanet.ie/mirrors/ftp.proftpd.org/distrib/source/proftpd-1.3.4rc2.tar.gz<br />
tar xfvz /work/proftpd-1.3.4rc2.tar.gz <br />
cd /work/proftpd-1.3.4rc2<br />
./configure --prefix=/usr/local/proftpd<br />
make<br />
make install<br />
cp /private/etc/pam.d/ftpd /private/etc/pam.d/ftp<br />
Shell /bin/false for FTP users is not included in /etc/shells, which may prevent FTP access.</blockquote><br />
<strong>======= ssl hosting =======</strong><br />
<blockquote>Cert for ssl hosting:<br />
openssl genrsa -des3 -out www.yourdomain.com.key 2048<br />
cat www.yourdomain.com.key<br />
openssl req -new -key  www.yourdomain.com.key -out  www.yourdomain.com.csr<br />
ls -ltr  www.yourdomain.*<br />
<br />
openssl x509 -req -days 365 -in www.yourdomain.com.csr -signkey www.yourdomain.com.key -out www.yourdomain.com.crt<br />
<br />
cat www.yourdomain.com.crt</blockquote><br />
<strong>======= webalizer =======</strong><br />
<blockquote>cd /work<br />
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-05-src.tgz<br />
tar xfvz /work/webalizer-2.23-05-src.tgz<br />
cd /work/webalizer-2.23-05<br />
./configure --with-pnglib=/usr/X11/lib --enable-geoip<br />
make<br />
make install</blockquote><br />
<strong>======= awstats =======</strong><br />
<blockquote>http://awstats.sourceforge.net/<br />
cd /home2<br />
wget http://sourceforge.net/projects/awstats/files/AWStats/7.0/awstats-7.0.tar.gz<br />
tar xfvz awstats-7.0.tar.gz <br />
mv awstats-7.0 awstats<br />
cd /home2/awstats/tools/<br />
perl awstats_configure.pl<br />
cd /home2<br />
<br />
rm -r awstats-7.0.tar.gz</blockquote><br />
<strong>======= Postgrey =======</strong><br />
<blockquote>cd /work <br />
wget http://pkgs.fedoraproject.org/repo/pkgs/postgrey/postgrey-1.34.tar.gz/f736a7be1094593f1a66cd13f32b39ef/postgrey-1.34.tar.gz<br />
tar xfvz postgrey-1.34.tar.gz<br />
cd /work/postgrey-1.34 <br />
<br />
mkdir /var/spool/postfix/postgrey<br />
cp postgrey /var/spool/postfix/postgrey<br />
cp postgrey_whitelist_clients /etc/postfix/postgrey_whitelist_clients<br />
cp postgrey_whitelist_recipients /etc/postfix/postgrey_whitelist_recipients<br />
chown -R _amavisd /var/spool/postfix/postgrey<br />
chgrp -R _amavisd /var/spool/postfix/postgrey<br />
chmod -R 755 /var/spool/postfix/postgrey<br />
/var/spool/postfix/postgrey/postgrey --inet=10023 -d --user=_amavisd --group=_amavisd</blockquote><br />
<strong>======= rrdtool =======</strong><br />
<blockquote>Download rrdtool-1.4.5<br />
cd /work<br />
tar xfvz rrdtool-1.4.5.tar.gz<br />
cd /work/rrdtool-1.4.5<br />
<br />
./configure<br />
make && make Install<br />
On your main HD you will find a folder "opt"<br />
<br />
cp /opt/rrdtool-1.4.5/lib/perl/5.12.3/RRDp.pm /Library/Perl/5.12/RRDp.pm<br />
cp -r /opt/rrdtool-1.4.5/lib/perl/5.12.3/darwin-thread-multi-2level/auto/RRDp/ /Library/Perl/5.12/darwin-thread-multi-2level/auto/RRDp/<br />
cp -r /opt/rrdtool-1.4.5/lib/perl/5.12.3/darwin-thread-multi-2level/auto/RRDs/ /Library/Perl/5.12/darwin-thread-multi-2level/auto/RRDs/<br />
cp /opt/rrdtool-1.4.5/lib/perl/5.12.3/darwin-thread-multi-2level/perllocal.pod /Library/Perl/5.12/darwin-thread-multi-2level/perllocal.pod<br />
cp /opt/rrdtool-1.4.5/lib/perl/5.12.3/darwin-thread-multi-2level/RRDs.pm /Library/Perl/5.12/darwin-thread-multi-2level/RRDs.pm<br />
<br />
Now open de screen webminstats in webmin, some errrors for some modules that won't work on os x and you get your working webminstats. Turn it on and let it run 1 hour. (nice graphics <img src="http://www.4elements.com/images/smileys/grin.gif" width="19" height="19" alt="grin" style="border:0;" /></blockquote><br />
<strong>======= Logrotate =======</strong><br />
<blockquote>/usr/local/sbin/logrotate<br />
/usr/local/etc/logrotate.conf (<a href="http://www.4elements.com/files/macmini_server/logrotate.conf.zip">download</a>)</blockquote><br />
<strong>======= php suhosin =======</strong><br />
<blockquote>cd /work<br />
wget http://download.suhosin.org/suhosin-0.9.32.1.tar.gz<br />
tar xfvz suhosin-0.9.32.1.tar.gz<br />
cd /work/suhosin-0.9.32.1<br />
phpize<br />
./configure <br />
make<br />
make install<br />
<br />
add the folowing to /etc/php.ini<br />
extension=suhosin.so</blockquote><br />
<strong>======= php PEAR =======</strong><br />
<blockquote>We need PEAR! For some reason, it's not set up ready to on Lion, but the install phar file is here, so we just need to run it.<br />
<br />
cd /usr/lib/php<br />
sudo php install-pear-nozlib.phar<br />
Edit /etc/php.ini and find the line: ;include_path = ".:/php/includes" and change it to:<br />
include_path = ".:/usr/lib/php/pear"<br />
sudo pear channel-update pear.php.net<br />
sudo pecl channel-update pecl.php.net<br />
sudo pear upgrade-all<br />
<br />
PHPUnit and friends<br />
I assume that everyone needs these…<br />
sudo pear channel-discover pear.phpunit.de<br />
sudo pear channel-discover components.ez.no<br />
sudo pear channel-discover pear.symfony-project.com<br />
sudo pear install phpunit/PHPUnit<br />
sudo pear install phpunit/phpcpd<br />
sudo pear install PHP_CodeSniffer</blockquote><br />
<strong>======= php PECL OAuth =======</strong><br />
<blockquote>A couple of projects I work on use the PECL OAuth component:<br />
cd /work<br />
wget http://sourceforge.net/projects/pcre/files/pcre/8.12/pcre-8.12.tar.gz<br />
tar xfvz pcre-8.12.tar.gz<br />
cd /work/pcre-8.12<br />
./configure<br />
sudo cp pcre.h /usr/include/<br />
Remove the pcre folder on your desktop as you don't need it any more<br />
sudo pecl install oauth<br />
Edit/etc/php.ini add these lines to the end of the file:<br />
<br />
[oauth]<br />
extension=oauth.so<br />
Restart apache: sudo apachectl restart and check in the phpinfo that OAuth is now loaded.</blockquote><br />
<strong>======= php mcrypt =======</strong><br />
<blockquote>cd /work<br />
wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz<br />
tar xfvz libmcrypt-2.5.8.tar.gz<br />
cd /work/libmcrypt-2.5.8<br />
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking<br />
make -j6<br />
make install</blockquote><br />
<blockquote>cd /work<br />
wget http://us.php.net/get/php-5.3.6.tar.gz/from/nl.php.net/mirror<br />
tar xfvz php-5.3.6.tar.gz<br />
cd /work/php-5.3.6/ext/mcrypt<br />
/usr/bin/phpize<br />
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.7.sdk/usr/bin/php-config <br />
make -j6<br />
make install<br />
sudo apachectl restart<br />
extension=mcrypt.so</blockquote><br />
<strong>======= logwatch =======</strong><br />
<blockquote>cd /work<br />
wget http://sourceforge.net/projects/logwatch/files/logwatch-7.4.0/logwatch-7.4.0.tar.gz<br />
tar xfvz logwatch-7.4.0.tar.gz<br />
cd /work/logwatch-7.4.0<br />
<br />
bash install_logwatch.sh</blockquote><br />
<strong>======= pflogsumm =======</strong><br />
<blockquote>cd /work<br />
wget http://linxnet.com/downloads/pflogsumm-1.1.1.tar.gz<br />
tar xfvz pflogsumm-1.1.1.tar.gz<br />
cd /work/pflogsumm-1.1.1<br />
<br />
cp pflogsumm.pl /usr/local/bin/pflogsumm<br />
chown root:wheel /usr/local/bin/pflogsumm<br />
chmod 755 /usr/local/bin/pflogsumm<br />
<br />
mkdir /usr/local/man/man1/<br />
cp pflogsumm.1 /usr/local/man/man1/pflogsumm.1<br />
chown root:wheel /usr/local/man/man1/pflogsumm.1<br />
chmod 644 /usr/local/man/man1/pflogsumm.1</blockquote><br />
<strong>======= squid =======</strong><br />
<blockquote>cd /work<br />
wget http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.15.tar.gz<br />
tar xfvz squid-3.1.15.tar.gz<br />
cd /work/squid-3.1.15<br />
./configure --enable-ssl --enable-delay-pools</blockquote><br />
<blockquote>cd /work<br />
wget http://sourceforge.net/projects/sarg/files/sarg/sarg-2.3.1/sarg-2.3.1.tar.gz<br />
tar xfvz sarg-2.3.1.tar.gz<br />
cd /work/sarg-2.3.1<br />
./configure<br />
make <br />
make install</blockquote><br />
<strong>======= PHP Imap =======</strong><br />
<blockquote>cd /work<br />
wget http://ftp.ntua.gr/pub/net/mail/imap/imap-2007f.tar.gz<br />
tar xfvz imap-2007f.tar.gz<br />
<br />
mv /work/imap-2007f /usr/local/imap-2007<br />
cd /usr/local/imap-2007<br />
make osx<br />
sudo cp c-client/c-client.a c-client/libc-client.a</blockquote><br />
<blockquote>cd /work<br />
tar xfvz php-5.3.6.tar.gz<br />
cd /work/php-5.3.6/ext/imap<br />
phpize<br />
./configure --with-imap=/usr/local/imap-2007 --with-kerberos --with-imap-ssl<br />
make<br />
cp modules/imap.so /usr/lib/php/extensions/no-debug-non-zts-20090626/<br />
<br />
add extension=imap.so <br />
to php.ini</blockquote><br />
<strong>======= webmin/usermin/virtualmin =======</strong><br />
<blockquote>cd /work <br />
wget: http://sourceforge.net/projects/webadmin/files/webmin/1.570/webmin-1.570.tar.gz<br />
tar xfvz webmin-1.570.tar.gz<br />
cd /work/webmin-1.570 <br />
./setup.sh<br />
admin username: root<br />
pass: use your root password<br />
<br />
cd /work<br />
wget http://sourceforge.net/projects/webadmin/files/usermin/1.490/usermin-1.490.tar.gz<br />
tar xfvz usermin-webmail-1.480.tar.gz<br />
cd /work/usermin-webmail-1.480<br />
./setup.sh<br />
<br />
Open webmin website and install virtualmin server + virtualmin server template<br />
wget http://download.webmin.com/download/virtualmin/virtual-server-3.89.gpl.wbm.gz<br />
wget http://download.webmin.com/download/virtualmin/virtual-server-theme-8.1.wbt.gz<br />
<br />
In webmin, these two modules are hard to find on the internet.<br />
download and install  <a href="http://www.4elements.com/files/macmini_server/wbmclamav-0.14.wbm.gz">wbmclamav-0.14.wbm.gz</a><br />
download and install  <a href="http://www.4elements.com/files/macmini_server/amavisd_1.8-for-amavisdV2.038.wbm.zip">amavisd_1.8-for-amavisdV2.038.wbm</a></blockquote> 
      ]]></content>
    </entry>

    <entry>
      <title>MacMini Server 2011 Part IV</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/macmini_server_2011_part_iv" />
      <id>tag:4elements.com,2012:blog/3.168</id>
      <published>2012-01-05T12:54:29Z</published>
      <updated>2012-01-06T15:05:30Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        <blockquote>On request, I did get many requests for this section, hereby the uncut version of Part IV: Settings. Still need to rewrite and change information, but that's for later.</blockquote><br />
<br />
<strong>Part IV: Settings.</strong><br />
<br />
<strong>======= Webmin ========</strong><br />
Post-Installation Wizard<br />
- Install Virtualmin<br />
- Install Virtualmin template<br />
- DNS need to setup,<br />
- PostgreSQL<br />
- MySQL<br />
<br />
goto your webmin url in safari or firefox.<br />
https://your.givenname.com:10000<br />
login with root and root password<br />
<br />
click on webmin, at the left. -> webmin configuration.<br />
click on webmin modules and select + install virtualmin<br />
Click on Return to Webmin configuration <br />
click on Webmin Themes ->  Install theme <br />
click on Return to themes list <br />
select virtualmin template and click on change...<br />
 <br />
page will reload and will be shown the new template.<br />
Click on webmin, left top<br />
click on "servers" from the left menu<br />
clcik on BIND DNS Server<br />
<br />
<strong>======== DNS ========</strong><br />
DNS module Configuration<br />
Display options: <br />
Reverse zone must exist? yes<br />
Zone file options:<br />
Serial number style: Date based (YYYYMMDDnn)<br />
<br />
DNS Configuration: <br />
Addresses and Topology<br />
Ports and addresses: Listed below<br />
Port number: 53<br />
Addresses: any<br />
<br />
Zone Defaults<br />
Allow transfers from.. default<br />
Refresh time: 10800<br />
Expiry time: 1209600<br />
Transfer retry time: 3600<br />
Negative cache time: 10800<br />
Default email address: email addes your like to use<br />
Default nameserver for master domains: ns01.servername.com<br />
and press save.<br />
<br />
than create an default master zone of the domain used for your host name.<br />
(this domain name will also be used for name server. aka mailserver)<br />
It should look like this.<br />
<br />
$ttl 10800<br />
domainname.com.	IN	SOA	ns01.domainname.com. info.domainname.com. (<br />
			2011102600<br />
			10800<br />
			3600<br />
			1209600<br />
			10800 )<br />
domainname.com.	IN	A	xx.xx.xx.xx<br />
www.domainname.com.	IN	A	xx.xx.xx.xx<br />
mail.domainname.com.	IN	A	xx.xx.xx.xx<br />
ftp.domainname.com.	IN	A	xx.xx.xx.xx<br />
ns01.domainname.com.	14400 IN	A	xx.xx.xx.xx<br />
ns02.domainname.com.	14400 IN	A	xx.xx.xx.xx<br />
domainname.com.	86400 IN	NS	ns01.domainname.com.<br />
domainname.com.	86400 IN	NS	ns02.domainname.com.<br />
domainname.com.	IN	MX	10 mail.domainname.com.<br />
<br />
Now goto your domain rigistar and add at the dns section<br />
ns01.yourdomain.com - IP address here<br />
ns02.yourdomain.com - IP address here<br />
it can take upto 24 hours before it's progressed.<br />
(depending on the domain rigistar you use)<br />
<br />
<strong>======== PostgreSQL ========</strong><br />
If you not already done it by now. start server and let it load.<br />
than quit the server (PostgreSQL will be configured and activated now)<br />
<br />
under unused modules at the right pick, PostgreSQL<br />
click on module configure<br />
<br />
Options: <br />
Administrator login: _postgres<br />
password: set password to your root password.<br />
<br />
System configuration:<br />
Path to psql command: /usr/bin/psql<br />
Path to PostgreSQL shared libraries: /usr/lib/postgresql<br />
Initial PostgreSQL database: template1<br />
Command to start PostgreSQL: su _postgres -c "/usr/bin/pg_ctl -D/private/var/pgsql"<br />
Path to postmaster PID file: /private/var/pgsql/postmaster.pid<br />
Paths to host access config file: /private/var/pgsql/pg_hba.conf<br />
Path to pg_dump command: /usr/bin/pg_dump<br />
Path to pg_restore command: /usr/bin/pg_restore<br />
press save and PostgreSQL webinterface is loading..<br />
<br />
<strong>======== MySQL ========</strong><br />
under server, click on MySQL<br />
enter your password.<br />
press save<br />
Click on Module Config -> system configure<br />
Path to mysqld command: /usr/local/mysql/bin/mysqld<br />
Click on save<br />
<br />
Mysql is done.<br />
<br />
<strong>======== Post-Installation Wizard ========</strong><br />
press on system information left bottom.<br />
<br />
Post-Installation Wizard<br />
Preload Virtualmin libraries? Yes<br />
Run MySQL database server? Yes<br />
Run PostgreSQL database server? Yes<br />
Change MySQL password Leave un-changed<br />
DNS: keep your hostname as main.<br />
enter as 2nd your ns02.#censored# <br />
(if you get an error, restart dns and try again)<br />
Password storage mode: store plain-text passwords<br />
<br />
<strong>======== setting up continue webmin and virtualmin ========</strong><br />
Before we set the other settings, first install all needed modules first.<br />
<br />
http://software.virtualmin.com/gpl/wbm/<br />
Module php pear: http://software.virtualmin.com/gpl/wbm/php-pear-1.5.wbm.gz<br />
Module Ruby GEMS: http://software.virtualmin.com/gpl/wbm/ruby-gems-1.4.wbm.gz<br />
virtualmin-dav: http://software.virtualmin.com/gpl/wbm/virtualmin-dav-3.5.wbm.gz<br />
virtualmin-awstats: http://software.virtualmin.com/gpl/wbm/virtualmin-awstats-4.6.wbm.gz<br />
virtual-server-mobile: http://software.virtualmin.com/gpl/wbm/virtual-server-mobile-2.4.wbt.gz<br />
virtualmin-svn: http://software.virtualmin.com/gpl/wbm/virtualmin-svn-4.9.wbm.gz<br />
virtualmin-htpasswd: http://software.virtualmin.com/gpl/wbm/virtualmin-htpasswd-2.5.wbm.gz <br />
<br />
amavisd: I have a rare copy... only downloadable from our site.<br />
Webmin -> webmin -> webmin configuration -> Webmin Modules<br />
<br />
<strong>======== Feature or Plugin ========</strong><br />
Our coal:<br />
<br />
Feature or Plugin   	  <br />
+ Administration user<br />
+ Home directory<br />
+ BIND DNS domain<br />
+ Mail for domain<br />
+ Apache website<br />
+ Webalizer reporting<br />
+ SSL website<br />
+ Log file rotation<br />
+ MySQL database<br />
+ PostgreSQL database<br />
+ ProFTPd virtual FTP<br />
- Spam filtering<br />
- Virus filtering<br />
+ Webmin login<br />
+ AWstats reporting	Plugin<br />
+ DAV Login	Plugin<br />
<br />
Spam and virus will be handled by AwavisD-New and Clam Antivirus<br />
<br />
<strong>======== PRO FTP ========</strong><br />
webmin ->  Un-used Modules -> proftp -> module config<br />
<br />
ProFTP:<br />
Path to ProFTPD config file: /usr/local/proftpd/etc/proftpd.conf<br />
Path to ProFTPD executable: /usr/local/proftpd/sbin/proftpd<br />
Path to ProFTPD PID file:/usr/local/proftpd/var/proftpd.pid<br />
Path to ftpusers file None (was /etc/ftpusers)<br />
<br />
Before we can start ProFTPD, we need to make some OS X specific adjustments. Go ahead and open up the "ProFTPD Server" module under the "Servers" section. Select the "Edit Config Files" option. Look for the line that has the comment "Set the user and group under which the server will run." and comment out the next two lines so it looks like this:<br />
<br />
# Set the user and group under which the server will run.<br />
#User	 nobody<br />
#Group	 nogroup<br />
Click the "Save" button to return to the main menu. By now you should have a functional FTP server. However, thier are a couple of "tweaks" I like to do to make things work a little better. Lets start by removing the login delay.<br />
<br />
Click on "Networking Options" in the ProFTPD module's main menu.<br />
Change the "Do reverse DNS lookups of client" option to "No".<br />
Change the "Lookup remote ident username" option to "No".<br />
PASV port range: 60000 - 65535<br />
Click "Save" to save and return to the main menu.<br />
<br />
Lets allow the use of "CHMOD":<br />
In the main menu, under "Virtual Servers" click "Default server".<br />
Under "Per-directory and Per-command options" click "Commands SITE_CHMOD".<br />
Click "Access Control".<br />
Change the "Access Control Policy" option to "Allow all clients".<br />
Click "SITE_CHMOD".<br />
set FTP commands to All (or just what you like)<br />
<br />
Click "Save" to save. Then click "return to main menu".<br />
<br />
Limit Users to Home Directory:<br />
Click on "Files and Directoriess" in the main menu.<br />
Change the "Limit users to directories" option to "Home Directory".<br />
Click "Save" to save and return to the main menu".<br />
<br />
To avoid hack attacks, change the port number of proftp.<br />
I changed it from port 21 to XXXX (pick your own number)<br />
I also disabled anonymous ftp.<br />
<br />
Download config file.....<br />
<br />
-----> proftp settings file bijsluiten<br />
Starting ProFTPD Automaticly on Boot<br />
You probably want ProFTPD to start automaticly on boot instead of having to start it up manually each time. To setup an OS X startup item, just use Webmin.<br />
<br />
Open up Webmin, and go to the "Bootup and Shutdown" module under the "System" menu.<br />
Click on "Add a new bootup action script".<br />
Action Name: PROFTPD<br />
Script name: PROFTPD<br />
Bootup Commands: /usr/local/proftpd/sbin/proftpd<br />
Description: ProFTPD<br />
Provides: FTP<br />
Start Message: Starting ProFTPD<br />
Stop Message: Stopping ProFTPD<br />
Start at boot time?: Yes<br />
Click "Create"<br />
<br />
Shell /bin/false for FTP users is not included in /etc/shells, which may prevent FTP access.<br />
Create a group names ftp<br />
<br />
<strong>======== SSH Server - OpenSSH_5.6 ========</strong><br />
Authentication:<br />
Allow authentication by password? No<br />
Allow login by root? No (before server setup - yes)<br />
Allow RSA (SSH 1) authentication? no<br />
<br />
Networking: <br />
Listen on port XXXX (pick your own number)<br />
Accept protocols SSH v2<br />
Deny members of groups deniedssh (create this group)<br />
<br />
User SSH Key Setup<br />
Setup SSH key for new Unix users? yes<br />
<br />
Host SSH Keys<br />
Create a ssh_host_key.pub, ssh_host_rsa_key.pub and ssh_host_dsa_key.pub<br />
under /private/etc/<br />
Use provided script (sh <a href="http://www.4elements.com/files/macmini_server/sshd-key-gen.sh.zip">sshd-key-gen</a>)<br />
<br />
Client Host Options<br />
Edit Host Options<br />
Port to connect to xxxxx (your own unique number here)<br />
Number of connection attempts 2<br />
Try SSH protocols 2 only<br />
<br />
Start server<br />
If you're not able to connect to ssh server, add Port XXXX (pick your own number)<br />
to the config file. (sometimes it won't copy from the settings)<br />
<br />
Open up Webmin, and go to the "Bootup and Shutdown" module under the "System" menu.<br />
Click on "Add a new bootup action script".<br />
Action Name: OPENSSH<br />
Script name: OPENSSH<br />
Bootup Commands: /usr/sbin/sshd<br />
Description: OpenSSH<br />
Provides: SSH<br />
Start Message: Starting OpenSSH<br />
Stop Message: Stopping OpenSSH<br />
Start at boot time?: Yes<br />
<br />
<strong>======== SSH Server - SSH Login ========</strong><br />
Other -> SSH Login:<br />
Module config.<br />
Port to connect to: XXXX (pick your own number)<br />
<br />
<strong>======== Amavisd-new ========</strong><br />
Path to AMaViSD-new amavisd: /usr/bin/amavisd<br />
Path to AMaViSD-new amavisd.conf: /etc/amavisd.conf<br />
Path to PID-File: /var/amavis/amavsid.pid<br />
default Domain: domainname.com<br />
Path to Amavis Start file: /etc/init.d/amavisd<br />
<br />
<strong>======== Clam Antivirus ========</strong><br />
Configuration category: ClamAV<br />
ClamAV system user: _clamav<br />
ClamAV system group: _clamav<br />
Daemon init script path: /usr/sbin/clamd<br />
Logfile path: /var/log/clamav.log<br />
Configuration file path: /etc/clamd.conf<br />
Main virus signatures database path: /var/clamav/main.cld<br />
Daily virus signatures database path: /var/clamav/daily.cvd<br />
<br />
Configuration category: Freshclam<br />
Configuration file path: /etc/freshclam.conf<br />
Logfile path: /var/log/freshclam.log<br />
Daemon init script path: /etc/cron.daily/freshclam<br />
<br />
Press save<br />
Than press backup<br />
<br />
<strong>======== AWstats ========</strong><br />
AWstats configuration directory: /Library/WebServer/awstats/wwwroot/cgi-bin/<br />
Full path to AWstats program:/Library/WebServer/awstats/wwwroot/cgi-bin/awstats.pl<br />
Full path to AWstats icons directory: /Library/WebServer/awstats/wwwroot/icon<br />
Full path to AWstats lang directory: /Library/WebServer/awstats/wwwroot/cgi-bin/lang<br />
Full path to AWstats lib directory: /Library/WebServer/awstats/wwwroot/cgi-bin/lib<br />
Full path to AWstats plugins directory: /Library/WebServer/awstats/wwwroot/cgi-bin/plugins<br />
<br />
<strong>======== CVS Server ========</strong><br />
Just click, "Initialize Repository" than "Setup"<br />
<br />
<strong>======== Webalizer Logfile Analysis ========</strong><br />
Configurable options:<br />
Automatically include logfiles from: Apache, Squid, ProFTPd<br />
<br />
System configuration:<br />
Path to webalizer command: /usr/local/bin/webalizer<br />
Path to webalizer configuration file: /usr/local/etc/webalizer.conf<br />
Sample webalizer configuration file: /usr/local/etc/webalizer.conf.sample<br />
<br />
<strong>======== PHP manage ========</strong><br />
Resource Limits:<br />
Maximum memory allocation 512M<br />
Maximum file upload size 64M<br />
Maximum input parsing time 360<br />
Maximum HTTP POST size 64M<br />
Maximum execution time 360<br />
<br />
Error Logging:<br />
Expression for error types: E_ALL & ~E_NOTICE<br />
<br />
Other Settings:<br />
Allow PHP scripts starting with &lt;? ? YES<br />
<br />
<strong>======== PHP Manuel ========</strong><br />
[apc]<br />
extension="/usr/local/Cellar/apc/3.1.9/apc.so"<br />
apc.enabled=1<br />
apc.shm_segments=1<br />
apc.shm_size=256M<br />
apc.ttl=7200<br />
apc.user_ttl=7200<br />
apc.num_files_hint=1024<br />
apc.mmap_file_mask=/tmp/apc.XXXXXX<br />
apc.enable_cli=1<br />
<br />
[memcache]<br />
extension="/usr/local/Cellar/memcache-php/2.2.6/memcache.so"<br />
<br />
[suhosin]<br />
extension=suhosin.so<br />
<br />
[oauth]<br />
extension=oauth.so<br />
<br />
[mcrypt]<br />
extension=mcrypt.so<br />
<br />
[imap]<br />
extension=imap.so<br />
<br />
[ffmpeg]<br />
extension=ffmpeg.so<br />
<br />
<br />
<strong>======== Perl ========</strong><br />
Suggested Modules: Click install Selected Modules ans all will be included (small glidsh in webmin)<br />
<br />
<strong>======== Log File Rotation ========</strong><br />
webmin -> Un-used Modules -> Log File Rotation<br />
Path to logrotate configuration file: /usr/local/etc/logrotate.conf<br />
Path to logrotate program: /usr/local/sbin/logrotate<br />
<br />
<strong>======== Amavisd ========</strong><br />
#@local_domains_maps = ( [".$mydomain"] );  # list of all local domains<br />
@local_domains_maps = ( read_hash("/var/amavis/local_domains") );<br />
<br />
into <br />
<br />
@local_domains_maps = ( [".$mydomain"] );  # list of all local domains<br />
#@local_domains_maps = ( read_hash("/var/amavis/local_domains") );<br />
<br />
forward_method => 'smtp:[127.0.0.1]:10027',<br />
into<br />
forward_method => 'smtp:[127.0.0.1]:10025',<br />
  <br />
uncomment $virus_admin               if you would like to reseive emails (what's going on spam/virus wize)<br />
<br />
# $myhostname = 'host.example.com';  # must be a fully-qualified domain name!<br />
into<br />
$myhostname = 'space09.domainname.com';  # must be a fully-qualified domain name!<br />
<br />
<br />
<strong>======== postgrey ========</strong><br />
Open up Webmin, and go to the "Bootup and Shutdown" module under the "System" menu.<br />
Click on "Add a new bootup action script".<br />
Action Name: POSTGREY<br />
Script name: POSTGREY<br />
Bootup Commands: /var/spool/postfix/postgrey/postgrey --inet=10023 -d --user=postgrey --group=postgrey<br />
Description: POSTGREY<br />
Provides: filter<br />
Start Message: Starting postgrey<br />
Stop Message: Stopping postgrey<br />
Start at boot time?: Yes<br />
Click "Create"<br />
<br />
/etc/postfix/main.cf<br />
<br />
Change:<br />
smtpd_recipient_restrictions = reject_unauth_pipelining,reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated permit_auth_destination,reject_unauth_destination,check_sender_access hash:/etc/postfix/sender_access,reject_rbl_client bl.spamcop.net,reject_rbl_client list.dsbl.org,reject_rbl_client zen.spamhaus.org,permit<br />
<br />
Into:<br />
<br />
smtpd_recipient_restrictions = reject_unauth_pipelining,reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated permit_auth_destination,reject_unauth_destination,check_sender_access hash:/etc/postfix/sender_access,reject_rbl_client bl.spamcop.net,reject_rbl_client list.dsbl.org,reject_rbl_client zen.spamhaus.org,check_policy_service inet:127.0.0.1:10023<br />
<br />
<strong>======== mail server ========</strong><br />
check to see if your mailserver is running as should be<br />
http://www.mxtoolbox.com/<br />
<br />
Check your DNS<br />
http://www.intodns.com/<br />
<br />
<strong>======== Webmin -> system ==========</strong><br />
Apache Webserver<br />
<br />
Processes and Limits:<br />
Maximum requests per server process: 0<br />
Minimum spare server processes: 5<br />
Maximum spare server processes: 10<br />
Initial server processes: 5<br />
<br />
SSL Options:<br />
Fixed password: (pick a password for later on)<br />
<br />
Default Server: Virtual Server Options<br />
<br />
Directory Indexing: <br />
Directory index files	<br />
index.html<br />
index.htm<br />
index.shtml<br />
index.php<br />
index.php4<br />
index.php5<br />
index.pl<br />
index.cgi<br />
<br />
SSL Options: Generate a .crt and .key file<br />
<br />
Step 1: Generate a Private Key<br />
<br />
The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self-signed certificates which can be used for testing purposes or internal usage.<br />
<br />
The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text.<br />
<br />
openssl genrsa -des3 -out server.key 1024<br />
<br />
Generating RSA private key, 1024 bit long modulus<br />
.........................................................++++++<br />
........++++++<br />
e is 65537 (0x10001)<br />
Enter PEM pass phrase:<br />
Verifying password - Enter PEM pass phrase:<br />
<br />
Step 2: Generate a CSR (Certificate Signing Request)<br />
<br />
Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as Thawte or Verisign who will verify the identity of the requestor and issue a signed certificate. The second option is to self-sign the CSR, which will be demonstrated in the next section.<br />
<br />
During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for "Common Name (e.g., YOUR name)". It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be https://public.akadia.com, then enter public.akadia.com at this prompt. The command to generate the CSR is as follows:<br />
<br />
openssl req -new -key server.key -out server.csr<br />
<br />
Country Name (2 letter code) [GB]:CH<br />
State or Province Name (full name) [Berkshire]:Bern<br />
Locality Name (eg, city) [Newbury]:Oberdiessbach<br />
Organization Name (eg, company) [My Company Ltd]:Akadia AG<br />
Organizational Unit Name (eg, section) []:Information Technology<br />
Common Name (eg, your name or your server's hostname) []:public.akadia.com<br />
Email Address []:martin dot zahn at akadia dot ch<br />
Please enter the following 'extra' attributes<br />
to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:<br />
<br />
Step 3: Remove Passphrase from Key<br />
<br />
One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file only be readable by the root user! If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:<br />
<br />
cp server.key server.key.org<br />
openssl rsa -in server.key.org -out server.key<br />
<br />
The newly created server.key file has no more passphrase in it.<br />
<br />
-rw-r--r-- 1 root root 745 Jun 29 12:19 server.csr<br />
-rw-r--r-- 1 root root 891 Jun 29 13:22 server.key<br />
-rw-r--r-- 1 root root 963 Jun 29 13:22 server.key.org<br />
<br />
Step 4: Generating a Self-Signed Certificate<br />
<br />
At this point you will need to generate a self-signed certificate because you either don't plan on having your certificate signed by a CA, or you wish to test your new SSL implementation while the CA is signing your certificate. This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.<br />
<br />
To generate a temporary certificate which is good for 365 days, issue the following command:<br />
<br />
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<br />
Signature ok<br />
subject=/C=CH/ST=Bern/L=Oberdiessbach/O=Akadia AG/OU=Information<br />
Technology/CN=public.akadia.com/Email=martin dot zahn at akadia dot ch<br />
Getting Private key<br />
<br />
Step 5: Installing the Private Key and Certificate<br />
<br />
When Apache with mod_ssl is installed, it creates several directories in the Apache config directory. The location of this directory will differ depending on how Apache was compiled.<br />
<br />
cp server.crt /usr/local/apache/conf/ssl.crt<br />
cp server.key /usr/local/apache/conf/ssl.key<br />
<br />
Step 6: Configuring SSL Enabled Virtual Hosts<br />
<br />
SSLEngine on<br />
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt<br />
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key<br />
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown<br />
CustomLog logs/ssl_request_log \<br />
   "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"<br />
<br />
Step 7: Restart Apache and Test<br />
<br />
apachectl stop<br />
apachectl start<br />
<br />
<br />
<strong>======== check system configuration ========</strong><br />
Bind ok....<br />
Postfix ok....<br />
Suexec, need to be changed.<br />
(Virtualmin -> Virtualmin configuration -> defaults for new domain. enter /home2 -> press save<br />
<br />
Bind ok....<br />
Postfix ok....<br />
Apache ok....<br />
Mysql ok....<br />
PostgreSQL ok....<br />
Logrotate ok....<br />
<br />
All is running, but we are not done yet.<br />
Now we will configure webmin and virtualmin.<br />
<br />
<strong>======== Webmin ==========</strong><br />
webmin -> Webmin Configuration<br />
start at boot time: yes<br />
<br />
Trusted Referrers:<br />
Referrer checking enabled? yes<br />
Trust links from unknown referrers: yes<br />
<br />
Authentication:<br />
Support full PAM conversations? yes<br />
Use MD5 encryption for Webmin passwords (allows long passwords) YES<br />
<br />
<strong>======== Webmin -> system ==========</strong><br />
Disk Quotas, turn it on on the HD where your system runs on<br />
<br />
<strong>======== Webmin -> system ==========</strong><br />
Historic System Statistics: turn it on or leave it off. (<br />
<br />
<strong>======== Webmin -> Usermin Configuration ==========</strong><br />
install Usermin -> Un-used Modules -> Usermin Configuration -> click on "install Usermin"<br />
<br />
webmin -> Usermin Configuration<br />
start at boot time: yes<br />
<br />
Authentication:<br />
Enable session authentication: yes<br />
Always require username and password: yes<br />
Support full PAM conversations? yes<br />
<br />
Available Modules: <br />
select you want to Usermin<br />
<br />
Access Control Options: <br />
Root directory for file chooser: User's home directory<br />
<br />
DAV Server:<br />
DAV enabled? Enabled<br />
Allow access to directory: User's home directory<br />
<br />
Restart usermin.<br />
<br />
<strong>======== Webmin - Usermin -> PAM ==========</strong><br />
PAM Authentication:<br />
cp /work/usermin-webmail-1.480/usermin-pam-osx /etc/pam.d/usermin<br />
cp /etc/pam.d/usermin /etc/pam.d/webmin<br />
For Dovecot<br />
cp /etc/pam.d/usermin /etc/pam.d/dovecot<br />
Open /etc/pam.d/dovecot and replace current listing with:<br />
<br />
# dovecot: auth account password session<br />
auth required pam_nologin.so<br />
auth sufficient pam_securityserver.so<br />
auth sufficient pam_unix.so<br />
auth required pam_deny.so<br />
account required pam_permit.so<br />
password required pam_deny.so<br />
session required pam_uwtmp.so<br />
<br />
<strong>======== Webmin -> Usermin -> Usermin Configuration ==========</strong><br />
Read mail: <br />
Mail storage format for Inbox: Qmail style<br />
Sendmail mail file location: ~${USER}/Maildir<br />
<br />
PostgreSQL Database: <br />
Path to psql command: /usr/bin/psql<br />
Path to PostgreSQL shared libraries: /usr/lib/postgresql<br />
Path to pg_dump command: /usr/bin/pg_dump<br />
Path to pg_restore command: /usr/bin/pg_restore<br />
Only show databases owned by user? yes<br />
<br />
SSH Login:<br />
Port number for SSH: XXXX (pick your own number)<br />
<br />
Upload and Download:<br />
Limit uploads and downloads to home directory? yes<br />
<br />
<strong>======== Virtualmin -> System Settings -> Features and Plugins ==========</strong><br />
Select all except "Spam filtering" and "virus filtering" We use our own (remember)<br />
<br />
<strong>======== Virtualmin -> System Settings -> Server Templates ==========</strong><br />
mkdir /etc/skel<br />
I moved my own under construction html files to it.<br />
The moment a new accounts has been created the under construction page is shown by default.<br />
<br />
Default Settings: <br />
Home directory: Substitute variables in contents? Yes<br />
<br />
Bind DNS domain:<br />
Custom TTL: 10800<br />
Create new domains in view: com.apple.ServerAdmin.DNS....<br />
Add SPF DNS record? Yes<br />
Does SPF record cover all senders? yes<br />
<br />
Mail for domain:<br />
Email message to send upon server creation: Message below ..<br />
Default quota for mail users: Unlimited<br />
<br />
Apache Website:<br />
Directives and settings for new websites:<br />
<br />
ServerName ${DOM}<br />
ServerAlias www.${DOM}<br />
DocumentRoot ${HOME}/public_html<br />
ErrorLog /var/log/virtualmin/${DOM}_error_log<br />
CustomLog /var/log/virtualmin/${DOM}_access_log combined<br />
ScriptAlias /cgi-bin/ ${HOME}/public_html/cgi-bin/<br />
DirectoryIndex index.html index.htm index.php index.php4 index.php5<br />
<.Directory ${HOME}/public_html><br />
Options FollowSymLinks<br />
AllowOverride all<br />
Order allow,deny<br />
Allow from all<br />
<./Directory><br />
<.Directory ${HOME}/public_html/cgi-bin><br />
Options FollowSymLinks +ExecCGI<br />
AddHandler cgi-script .cgi .pl<br />
Allow from all<br />
<./Directory><br />
<br />
Configure Webmin to use same SSL cert for IP? Yes<br />
Configure Usermin to use same SSL cert for IP? Yes<br />
PHP configuration variables for scripts: memory_limit 256M<br />
<br />
Webmin Login:<br />
Webmin group for domain owners: hosting<br />
<br />
<strong>======== Virtualmin -> System Settings -> Account Plans ==========</strong><br />
<br />
You may create what you want here.<br />
I'll add a "Pro Plan" with all on unlimited<br />
<br />
<strong>======== Virtualmin -> System Settings -> Virtualmin Configuration ==========</strong><br />
User interface settings:<br />
Columns to show: pick your own<br />
Feature columns to show: pick your own<br />
Show mailbox size in users list? Yes<br />
Allow editing of limits when creating server? Yes<br />
<br />
Defaults for new domains:<br />
Home directory base: /Users<br />
<br />
Actions upon Server and User creation:<br />
Notify other modules when updating server administrator Unix users? yes<br />
Notify other modules when updating mailbox Unix users? Yes<br />
Add users with no SSH access to deniedssh group? yes<br />
<br />
Advanced Options:<br />
Delete all email aliases when disabling mail? Yes<br />
Allow creation of sub-domains? Yes<br />
<br />
<strong>======== Un-used Modules -> squid ==========</strong><br />
Module configuration: _ options<br />
Encryption method for proxy passwords: md5base64<br />
<br />
system conf:<br />
Full path to squid config file: /usr/local/etc/squid.conf<br />
Squid executable: /usr/local/sbin/squid<br />
Full path to PID file: /usr/local/var/run/squid.pid<br />
Full path to squid cache directory: /usr/local/var/cache<br />
Squid cachemgr.cgi executable: /usr/local/Cellar/squid/3.1.9/libexec/cachemgr.cgi<br />
Full path to squid log directory: /usr/local/var/logs<br />
Path to squidclient program: /usr/local/bin/squidclient<br />
<br />
<strong>======== Squid Report Generator ========</strong><br />
Module configuration.<br />
<br />
Full path to sarg executable: /usr/local/bin/sarg<br />
Full path to SARG configuration file: /usr/local/etc/sarg.conf<br />
<br />
<strong>======== Apple OSX settings ========</strong><br />
chmod 777 /Library/Logs<br />
<br />
<strong>======== Web server ========</strong><br />
<blockquote>There are 2 ways to setup apache. I choose to use the default settings of apache to work well with webmin.<br />
<br />
Specific setup for use with server.app is easy accomplish.<br />
Both instruction will be posted on a later stage.</blockquote><br />
<strong>======== Mail server ========</strong><br />
<blockquote>A complete solution will be provided. Stay tuned.<br />
(Below is the raw version, for those who requested.)</blockquote><br />
<strong>======== Dovecot IMAP/POP3 Server ========</strong><br />
We will configure the mail our selves, but to get all config files created<br />
please launge "Admin Server" add mail and start the mail server. This will generate all files we need. (stop the mail server when generation is done)<br />
<br />
Dovecot server program: /usr/sbin/dovecotd<br />
Full path to Dovecot configuration file: /etc/dovecot/dovecot.conf<br />
Dovecot server PID file: /var/run/dovecot/master.pid<br />
<br />
Mail Files:<br />
Mail file location: Inbox and folders in ~/Maildir<br />
UIDL format: %08Xu%08Xv<br />
<br />
<strong>======== Postfix Mail Server ========</strong><br />
The message "group or other writable" means that another user (not the owner) is able to write. You can fix it with chmod. Example to remove group write permissions<br />
 <br />
$ sudo chmod g-w /Library/Server/Mail/Data/mta<br />
<br />
Suggest to create a backup of /etc/postfix /etc/dovecot and /etc/apache2<br />
cd /etc<br />
/Developer/Tools/CpMac -r apache2 "apache2 backup"<br />
/Developer/Tools/CpMac -r postfix "postfix backup"<br />
/Developer/Tools/CpMac -r dovecot "dovecot backup"<br />
<br />
While it's possible to write all steps by hand, I decided to attach the config files.<br />
(change my files and copy them to the ment folders. i'll explain during the process)<br />
<br />
after copy:<br />
chown root:wheel /private/etc/postfix/*<br />
chmod g-w /var/lib/postfix<br />
<br />
cd /etc/postfix<br />
postmap hash:access<br />
postmap hash:transport<br />
postmap hash:sender_access<br />
<br />
General Options:<br />
What domains to receive mail for: $myhostname<br />
Network interfaces for receiving mail: All<br />
Local internet domain name: Default<br />
Mail queue directory: /var/spool/postfix<br />
rm -r /var/spool/postfix<br />
mkdir /var/spool/postfix<br />
<br />
Mail Aliases:<br />
Alias databases used by the local delivery agent: Map specifications: hash:/etc/postfix/aliases<br />
<br />
Canonical Mapping:<br />
Tables for recipient addresses: No map set <br />
<br />
Virtual Domains:<br />
Domain mapping lookup tables: hash:/etc/postfix/virtual<br />
<br />
Transport Mapping:<br />
Transport mapping lookup tables: Map specifications: hash:/etc/postfix/smtproutes<br />
<br />
Header Checks:<br />
Example header checks<br />
<br />
Body Checks: <br />
Message body checking tables: Map specifications: pcre:/etc/postfix/custom_body_checks<br />
Example body checks<br />
<br />
Local Delivery:<br />
Home-relative pathname of user mailbox file: Maildir/<br />
External command to use instead of mailbox delivery: /usr/libexec/dovecot/deliver<br />
Optional actual transport to use: None<br />
<br />
SMTP Server Options:<br />
Timeout in seconds for SMTP transactions: 300s<br />
Disable SMTP VRFY command: Yes<br />
Error count for closing connection: 20<br />
Restrictions on sends in HELO commands: permit_mynetworks,check_helo_access hash:/etc/postfix/access,permit_auth_destination,permit_sasl_authenticated,reject_non_fqdn_hostname,reject_invalid_hostname,permit<br />
Restrictions on sender addresses: permit_sasl_authenticated,permit_mynetworks,permit_auth_destination,reject_non_fqdn_sender,reject_unknown_sender_domain,permit<br />
Restrictions on recipient addresses: reject_unauth_pipelining,reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated,permit_auth_destination,reject_unauth_destination,check_sender_access hash:/etc/postfix/sender_access,permit<br />
cd /etc/postfix<br />
postmap hash:sender_access<br />
postmap hash:access<br />
<br />
SMTP Authentication And Encryption:<br />
Handle non-compliant SMTP clients?: yes<br />
SMTP security options: none<br />
<br />
SMTP Client Restrictions:<br />
Client restrictions: Postfix default (allow all clients)  (all off)<br />
<br />
Edit main.cf<br />
data_directory = /var/lib/postfix<br />
rm /var/lib/postfix<br />
mkdir /var/lib/postfix<br />
chown _postfix /var/lib/postfix<br />
Show main.cf file (example domainnames)<br />
<br />
==> virtual_transport = lmtp:unix:/var/imap/socket/lmtp<br />
<br />
Edit greylist.pl (/usr/libexec/postfix/greylist.pl)<br />
change: /Library/Server/Mail/Data/mta/<br />
into: /var/lib/postfix/<br />
<br />
Edit Master.cf:<br />
Show master.cf file (example domainnames) 
      ]]></content>
    </entry>

    <entry>
      <title>Happy New Year</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/happy_new_year1" />
      <id>tag:4elements.com,2012:blog/3.163</id>
      <published>2012-01-01T11:03:40Z</published>
      <updated>2012-01-02T16:06:41Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        All the best wishes for 2012.<br />
<br />
Coming Up:<br />
- New blog about webmin/virtualmin on a MacMini 2011 server model.<br />
- New service that will blow your mind. 
      ]]></content>
    </entry>

    <entry>
      <title>Memcache vs APC cache in PHP</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/memcache_vs_apc_cache_in_php" />
      <id>tag:4elements.com,2011:blog/3.161</id>
      <published>2011-07-19T07:53:04Z</published>
      <updated>2011-07-19T09:55:05Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Daily"
        scheme="http://www.4elements.com/blog/category/daily"
        label="Daily" />
      <content type="html"><![CDATA[
        I often see this question asked; which is a better caching mechanism for PHP: Memcache or APC cache. I wanted to write about how different both of them are inherently in their very concept.<br />
<br />
Memcache for PHP is a distributed caching mechanism. If you have several webservers running under a load balancer serving the same content and you want a caching mechanism to avoid frequent database hits , Memcache is the way to go.  When using Memcache you will make the update to one webserver and it would be auto-replicated across all the severs through distributed caching mechanism. Since it requires dealing with network protocols in order to support the distributed part of caching, it is slower compared to APC cache. If data is stored in APC cache, updates need to be done individually on all APC caches on all web servers. They wont be automatically replicated.<br />
<br />
However,  Memcached is NOT an Opcode cacher like APC. APC when employed will cache all the opcode the first time it is converted and serve the cached version for subsequent HTTP requests. APC can also be used to store data like Memcache but in a non-distributed manner. Most of the times memcache is used to store results of time consuming data queries, so the need to hit database on every query is eliminated and this gives a huge performance benefit.<br />
<br />
The good part of both these technologies, is that they are compatible with each other. A good design for scalable websites should be employing APC for opcode caching and data-caching through Memcache to exploit the distributed capabilities across several webservers. If there is just a single webserver, using just APC cache for both opcode and data caching is a good idea. 
      ]]></content>
    </entry>

    <entry>
      <title>0&#45;24rod.nl live</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/0-24rod.nl_live" />
      <id>tag:4elements.com,2011:blog/3.160</id>
      <published>2011-04-16T10:39:16Z</published>
      <updated>2011-04-16T12:45:17Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Projects"
        scheme="http://www.4elements.com/blog/category/projects"
        label="Projects" />
      <content type="html"><![CDATA[
        We designed and build the web for 0/24 Research & Organization Development<br />
<blockquote>0/24 advises organizations, provides change and interim management and conducts research in the public sector.</blockquote><br />
Now online: <a href="http://www.0-24rod.nl" target="_blank">http://www.0-24rod.nl</a><br /> 
      ]]></content>
    </entry>

    <entry>
      <title>Sponsored sailingsynergy.com</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/sponsored_sailingsynergy.com" />
      <id>tag:4elements.com,2011:blog/3.158</id>
      <published>2011-02-02T06:46:41Z</published>
      <updated>2011-03-31T08:57:42Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Projects"
        scheme="http://www.4elements.com/blog/category/projects"
        label="Projects" />
      <content type="html"><![CDATA[
        We designed and build sailingsynergy.com<br />
<blockquote>Synergy is een prachtig 49` zeiljacht ontworpen door German Frers. Ze is een perfect schip voor mensen die van het buitenleven en een actieve zeilvakantie houden.</blockquote><br />
We sponsored the website for Synergy.<br />
<br />
Online: <a href="http://www.sailingsynergy.com" target="_blank">http://www.sailingsynergy.com</a><br /> 
      ]]></content>
    </entry>

    <entry>
      <title>shop.Rebelrelic.com</title>
      <link rel="alternate" type="text/html" href="http://www.4elements.com/blog/shop.rebelrelic.com" />
      <id>tag:4elements.com,2011:blog/3.157</id>
      <published>2011-01-11T06:40:04Z</published>
      <updated>2011-03-31T08:57:05Z</updated>
      <author>
            <name>Martijn Broeders</name>
            <email>info@4elements.com</email>
                  </author>

      <category term="Projects"
        scheme="http://www.4elements.com/blog/category/projects"
        label="Projects" />
      <content type="html"><![CDATA[
        We designed and build the web store for "RebelRelic Vintage Style Relic Guitars"<br />
<blockquote>An Original 50's or 60's Vintage guitar is unaffordable to most.<br />
The reissues don't even come close to the "Oldies".<br />
Custom shop prices are outrageous. ...<br />
RebelRelic builds them faithfully like the originals at musicians prices.</blockquote><br />
Now online: <a href="http://shop.Rebelrelic.com" target="_blank">http://shop.Rebelrelic.com</a> 
      ]]></content>
    </entry>


</feed>