<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Blog</title>
    <link>http://www.4elements.com/blog</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:creator>info@4elements.com</dc:creator>
    <dc:rights>Copyright 2013</dc:rights>
    <dc:date>2013-03-26T09:36:40+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>The Perfect APC Configuration</title>
      <link>http://www.4elements.com/blog/the_perfect_apc_configuration</link>
      <guid>http://www.4elements.com/blog/the_perfect_apc_configuration#When:09:36:40Z</guid>
      <description>I’m hosting about 10 ExpressionEngine sites using Apache 2, APC, and Memcached. Here is my configuration:

Operating system &#45; Mac OS X Server Lion 10.7.5 (11G63)
Processor &#45; 2 GHz Intel Core i7
RAM &#45; 16 GB 1333 MHz DDR3
Disk &#45; 13.5 TB total
Apache &#45; 2.2.22
PHP &#45; 5.3.15
APC &#45; 3.1.13

My php.ini configuration

[APC]
apc.enabled=1
apc.shm_segments=1

;51M per ExpressionEngine install
apc.shm_size=512M

;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)
apc.num_files_hint=7000

;Relative to the size of ExpressionEngine
apc.user_entries_hint=4096

;The number of seconds a cache entry is allowed to idle in a slot before APC dumps the cache
apc.ttl=7200
apc.user_ttl=7200
apc.gc_ttl=3600

;Setting this to 0 will give you the best performance, as APC will
;not have to check the IO for changes. However, you must clear 
;the APC cache to recompile already cached files. If you are still
;developing, set this to 1
apc.stat=0

;This MUST be 0, ExpressionEngine can have errors otherwise!
apc.include_once_override=0

;Only set to 1 while debugging
apc.enable_cli=0

;Allow 2 seconds after a file is created before it is cached to prevent users from seeing half&#45;written/weird pages
apc.file_update_protection=2

;Leave at 2M or lower. ExpressionEngine does&apos;t have any file sizes close to 2M
apc.max_file_size=2M

apc.cache_by_default=1
apc.use_request_time=1
apc.slam_defense=0
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.stat_ctime=0
apc.canonicalize=1
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=0
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600
apc.lazy_classes=0
apc.lazy_functions=0

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. 

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.

My advice: If you are running ExpressionEngine set apc.stat = 0.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2013-03-26T09:36:40+00:00</dc:date>
    </item>

    <item>
      <title>It’s official, II</title>
      <link>http://www.4elements.com/blog/its_official_ii</link>
      <guid>http://www.4elements.com/blog/its_official_ii#When:11:15:40Z</guid>
      <description>It’s official, today 4 years ago we changed our name and launched our current website.

To celebrate our birthday:


Coming up:
&#45; New website, offers a.o. soon.
&#45; Our project, Designscan.me, a breath taken new web service will be launched soon.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-07-23T11:15:40+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Update II</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_update_ii</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_update_ii#When:12:51:57Z</guid>
      <description>Apple just released Lion Server 10.7.4 update
Download and install the combi update, this prevents any miss behavior.

After the update all the custom settings and installed scripts stayed intact and are working as it should be.
With other words, it&apos;s save to update.

Don&apos;t forget to download and install Server Admin Tools 10.7.4 as well.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-07-02T12:51:57+00:00</dc:date>
    </item>

    <item>
      <title>cssFx, makes your live a bit easier</title>
      <link>http://www.4elements.com/blog/cssfx_makes_your_live_a_bit_easier</link>
      <guid>http://www.4elements.com/blog/cssfx_makes_your_live_a_bit_easier#When:09:00:04Z</guid>
      <description>cssFx
cssFx is a standalone polyfill that inserts the vendor&#45;specific CSS3 properties necessary for old and new browsers. This saves you tons of time, maintenance, and bandwidth!

Properties Supported
Border radius, box shadow, flex box, RGBA, gradients, multiple columns, border image, transforms, transitions, opacity, inline&#45;block, ellipsis, and more.

Get it (just updated): cssFx</description>
      <dc:subject>CSS,</dc:subject>
      <dc:date>2012-04-06T09:00:04+00:00</dc:date>
    </item>

    <item>
      <title>Major CMS upgrade</title>
      <link>http://www.4elements.com/blog/major_cms_upgrade</link>
      <guid>http://www.4elements.com/blog/major_cms_upgrade#When:18:35:00Z</guid>
      <description>Expressionengine 1.7.1 &#45;&gt; 2.4 Major upgrade
&#45; We needed to upgrade for future grow, more on this soon.
&#45; New version is faster and more secure.
&#45; and a lot more....

Installed AutoMin (an EE module)
&#45; caching
&#45; Compressing HTML Markup (no more nice html code)
&#45; Combining css files (into one)
&#45; Combining js files (into one)

The website now uses MemCache and APC, a really great improvement in page loading speed.

Installed Http:BL antiSpam for forum and contact forms.
This is also why I joined the projecthoneypot.org</description>
      <dc:subject>Expression Engine,</dc:subject>
      <dc:date>2012-02-09T18:35:00+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Update</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_update</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_update#When:15:25:45Z</guid>
      <description>Apple just released Lion Server 10.7.3 update
Download and install the combi update, this prevents any miss behavior.

After the update all the custom settings and installed scripts stayed intact and are working as it should be.
With other words, it&apos;s save to update.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-02-02T15:25:45+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Part I</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_part_I</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_part_I#When:13:54:07Z</guid>
      <description>Part I: Intro and Goal.
Part II: Preparations.
Part III: Installation.
Part IV: Settings.

Intro: 
My G5, dual 2Ghz and 8GB ram, server was still working like a charm.
(Including a G5 Jive to add 4 extra Internal Sata disks &#45; total 6 Internal Disks)

But the downside:
&#45; Heat, lots of heat. I even placed an airco in my server room.
&#45; Costs, A PowerMac G5 uses max 604 Watt. Add the airco time and your monthly bill will increase rapidly.
&#45; Noise, Due to the major fans, the heats it generates. I (sound)isolated the server room.

Goal:
My own new web/mail/file/media server that generates less noise, heat and uses less power. And the right storage solution.

Solution:
MacMini Server 2011 (2Ghz i7 Quad&#45;core, 2 x 750 GB HD @ 7200 and 16GB RAM)
MacMini uses:  8W (Idle) 18W (regular use) 85W (max)
Sound: Silent (no sound)

MacMini server: English &#45; Dutch
2 X 8 GB ram: English &#45; Dutch

Empty Enclosure for my 4 extra Internal HD&apos;s (JBOD) 
OWC RackPro Uses: 16W (Idle) 24W (regular use) 100W (max)
Sound: Silent (no sound)

Thunderbolt to eSata: Thunderbolt Adapter and eSATA adapter
(two eSata connectors for future grow)

Why eSata and not USB3:
USB3 is theoretically faster but eSata has no latency what makes it high responsible and low/none system resource use.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-01-05T13:54:07+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Part II</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_part_II</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_part_II#When:13:45:13Z</guid>
      <description>Part II: Preparations.
Full web server, mailserver, caldav and carddav with webmin/virtualmin.
Update OS X 10.7 server software.
Download Xcode 4.1 + install 
Download ServerAdminTools + install 
Download Java + install
Download java developer + install
Repair permissions

Xcode 4.2 discontinued GCC 4.2 compiler and downgraded LLVM&#45;GCC to &apos;legacy&apos; compiler.
Meaning that a lot of scripts/programs will not compile right until they are updated.
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)
Preps:
&#45; While push mail didn&apos;t work for my setup, I decided to not use it.
&#45; 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)
&#45; After installation, at the server setup section. Do not enter your mac account.

Set computer name: server
Set NS name: server.yourdomain.com

Enable Root:
Macintosh HD &#45;&gt; System &#45;&gt; Library &#45;&gt; CoreServices &#45;&gt; Directory Utility
Menu &#45;&gt; edit &#45;&gt; enable Root
Enter a new password 2 times.
Root enabled

Dedicate system resources:
Start the server.app
Select your computer under hardware.
Press on settings. (see image) 
Disable &quot;Dedicate system resources to server services&quot;
Restart your server.</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-01-05T13:45:13+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Part III</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_part_iii</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_part_iii#When:13:37:47Z</guid>
      <description>Part III: Installation.

We are going to use brew to install several libs and programs.
Big advantage of brew is that it makes simlinks into the local bin, lib and sbin folders.
No mess as macports or fink (let&apos;s say I like this way better.)

======= Brew =======
Brew will ask to add and change some path info. You may do this by editing 
BBEdit:open /etc/paths
/usr/local/sbin (infront of /usr/sbin/)
/usr/local/bin (infront of /usr/bin/)
Terminal:mkdir /usr/local/Cellar
/usr/bin/ruby &#45;e &quot;$(curl &#45;fsSL https://raw.github.com/gist/323731)&quot;
Only in case there is an error.chown name:admin /usr/local/share
chown name:admin /usr/local/share/man
chown name:admin /usr/local/share/man/man1
chown name:admin /usr/local/Cellar
Terminal:
brew update

brew install GD
brew install wget
brew install apc
brew install libtiff
brew install ghostscript
brew install imagemagick
brew install logrotate
brew install mcrypt
brew install qdbm
brew install memcached
brew install memcache&#45;php
brew install memcache&#45;top
brew install lynx
brew install smartmontools
brew install libconfig
brew install GnuPG
brew install re2c
Some extra brews I could use.brew install xmlrpc&#45;c
brew install xml&#45;coreutils
brew install webfs
brew install webkit2png
Read my notes.brew install ffmpeg *
brew install ffmpeg&#45;php *
brew install rrdtool **
brew install ruby **
brew install lsof **
brew install snort **
brew install libxml2 **
brew install cairo **
brew install squid ****
brew install webalizer ***
brew install mysql *****
* don&apos;t use brew for this, I wrote a script that will install it all for you, and this one works 
** only needed if you would like to install system stats in webmin.
*** 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)
**** only needed if you would like to run squid proxy.
***** Or follow the steps below (recommended)

======= Create a work folder =======
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.
My case &quot;work&quot; on your main HD.

mkdir /work
======= Installing FFMPEG and FFMPEG&#45;php =======
Download my script into the work folder.
Open terminal and su root.
cd /work
wget http://www.4elements.com/files/macmini_server/ffmpegphp_ok.sh.zip
unzip ffmpegphp_ok.sh.zip
bash ffmpegphp_ok.shThis will take a while.

======= Installing MYSQL =======
Download MYSQL: http://dev.mysql.com/downloads/mysql/
Pick the &quot;Mac OS X ver 10.6 (x86, 64&#45;bit), DMG&quot; mysql&#45;5.5.16&#45;osx10.6&#45;x86_64.dmg

Turn mysql on. (system prefs)
sudo mkdir /var/mysql
sudo ln &#45;s /tmp/mysql.sock /var/mysql/mysql.sock

ln &#45;s /usr/local/mysql/bin/mysql /usr/bin/mysql
ln &#45;s /usr/local/mysql/bin/mysqld /usr/libexec/mysqld
Add to /etc/paths
/usr/local/mysql/bin&quot;
sudo install_name_tool &#45;id /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.dylib
Set up MySQL root password: (without the {})
/usr/local/mysql/bin/mysqladmin &#45;u root password {password}
/usr/local/mysql/bin/mysqladmin &#45;u root &#45;p{password} &#45;h localhost password {password}
/usr/local/mysql/bin/mysqladmin &#45;u root &#45;p{password} reload

======= Installing CPAN =======
Su root
cpan (OSX 10.7 has 64bit as default, all will be installed as 64bit)

Parameters for the &apos;make&apos; command? Typical frequently used setting:

    &#45;j3              # dual processor system (on GNU make)
 your choice &#45;j6
CPAN Shell&gt; install CPAN
CPAN Shell&gt; install YAML YAML::Syck
CPAN Shell&gt; install DBI
CPAN Shell&gt; install DBD::mysql 
CPAN Shell&gt; install DBD::Pg
CPAN Shell&gt; install Bundle::DBI Bundle::DBD::mysql Bundle::DBD::Pg
CPAN Shell&gt; install SQL::Statement Net::SSLeay Authen::PAM Net::LDAP
webmin, install needed for clamAV moduleCPAN Shell&gt; install Benchmark::Timer
CPAN Shell&gt; install Mail::Mbox::MessageParser
CPAN Shell&gt; force install GD
CPAN Shell&gt; install GD::Graph::lines GD::Text
CPAN Shell&gt; install Date::Manip 
CPAN Shell&gt; install Compress::Zlib HTML::Entities Getopt::Long IO::File 
CPAN Shell&gt; install Net::SMTP IO::Socket Mail::Internet
For webmin stats:
CPAN Shell&gt; install Cwd English CGI::Carp Bundle::LWP
CPAN Shell&gt; install Date::Calc Bundle::libnet Crypt::SSLeay

CPAN Shell&gt; install Mail::SPF Net::DNS::Resolver::Programmable 
CPAN Shell&gt; install Bundle::Email Geo::IPfree Net::XWhois SOAP::Lite
Postgrey
CPAN Shell&gt; install Net::Server IO::Multiplex Filesys::Virtual::Plain Net::DAV::Server
http://search.cpan.org and download the following:
NetAddr::IP
Data::Dumper
Digest::MD5
Storable
By hand:
tar xfvz /work/Data&#45;Dumper&#45;2.131.tar.gz
tar xfvz /work/Digest&#45;MD5&#45;2.51.tar.gz
tar xfvz /work/NetAddr&#45;IP&#45;4.050.tar.gz
tar xfvz /work/Storable&#45;2.30.tar.gz
cd /work/Data&#45;Dumper&#45;2.131
perl Makefile.pl
make
make install
cd /work/Digest&#45;MD5&#45;2.51
perl Makefile.pl
make
make install
cd /work/NetAddr&#45;IP&#45;4.050
perl Makefile.pl
make
make install
cd /work/Storable&#45;2.30
perl Makefile.pl
make
make install
======= Apache Mod_perl =======
cd /work
wget http://perl.apache.org/dist/mod_perl&#45;2.0&#45;current.tar.gz
tar xfvz /work/mod_perl&#45;2.0&#45;current.tar.gz
cd /work/mod_perl&#45;2.0.5
perl Makefile.PL MP_APXS=/usr/sbin/apxs \
MP_APR_CONFIG=/usr/bin/apr&#45;1&#45;config 

/etc/apache2/httpd.conf
LoadModule perl_module  libexec/apache2/mod_perl.so
======= Apache suexec =======
cd /work
wget http://apache.proserve.nl//httpd/httpd&#45;2.2.21.tar.gz
tar xfvz httpd&#45;2.2.21.tar.gz
cd /work/httpd&#45;2.2.21
./configure &#45;&#45;with&#45;layout=Darwin &#45;&#45;enable&#45;suexec &#45;&#45;with&#45;suexec&#45;caller=_www &#45;&#45;with&#45;suexec&#45;docroot=/home2 &#45;&#45;with&#45;suexec&#45;userdir=public_html &#45;&#45;with&#45;suexec&#45;logfile=/var/log/apache2/suexec_log
make

sudo cp /work/httpd&#45;2.2.21/support/suexec /usr/bin/
sudo chown root:_www /usr/bin/suexec 
sudo chmod 4750 /usr/bin/suexec

cd /work/httpd&#45;2.2.21/modules/generators
sudo apxs &#45;i &#45;a &#45;c mod_suexec.c
(gcc &#45;fpic &#45;DSHARED_MODULE &#45;I/usr/include/apache2 &#45;c mod_suexec.c)
======= host =======
Edit host file:
goto /etc
open file &quot;host&quot; with BBEdit.
127.0.0.1	localhost
XX.XX.XX.XX	Hostname.domainname.com (XX is your static IP, hostname and domainname are your chosen one)
======= ProFtp =======
Install ProFtp proftpd&#45;1.3.4rc2.tar.gz
cd /work
wget http://ftp.heanet.ie/mirrors/ftp.proftpd.org/distrib/source/proftpd&#45;1.3.4rc2.tar.gz
tar xfvz /work/proftpd&#45;1.3.4rc2.tar.gz 
cd /work/proftpd&#45;1.3.4rc2
./configure &#45;&#45;prefix=/usr/local/proftpd
make
make install
cp /private/etc/pam.d/ftpd /private/etc/pam.d/ftp
Shell /bin/false for FTP users is not included in /etc/shells, which may prevent FTP access.
======= ssl hosting =======
Cert for ssl hosting:
openssl genrsa &#45;des3 &#45;out www.yourdomain.com.key 2048
cat www.yourdomain.com.key
openssl req &#45;new &#45;key  www.yourdomain.com.key &#45;out  www.yourdomain.com.csr
ls &#45;ltr  www.yourdomain.*

openssl x509 &#45;req &#45;days 365 &#45;in www.yourdomain.com.csr &#45;signkey www.yourdomain.com.key &#45;out www.yourdomain.com.crt

cat www.yourdomain.com.crt
======= webalizer =======
cd /work
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer&#45;2.23&#45;05&#45;src.tgz
tar xfvz /work/webalizer&#45;2.23&#45;05&#45;src.tgz
cd /work/webalizer&#45;2.23&#45;05
./configure &#45;&#45;with&#45;pnglib=/usr/X11/lib &#45;&#45;enable&#45;geoip
make
make install
======= awstats =======
http://awstats.sourceforge.net/
cd /home2
wget http://sourceforge.net/projects/awstats/files/AWStats/7.0/awstats&#45;7.0.tar.gz
tar xfvz awstats&#45;7.0.tar.gz 
mv awstats&#45;7.0 awstats
cd /home2/awstats/tools/
perl awstats_configure.pl
cd /home2

rm &#45;r awstats&#45;7.0.tar.gz
======= Postgrey =======
cd /work 
wget http://pkgs.fedoraproject.org/repo/pkgs/postgrey/postgrey&#45;1.34.tar.gz/f736a7be1094593f1a66cd13f32b39ef/postgrey&#45;1.34.tar.gz
tar xfvz postgrey&#45;1.34.tar.gz
cd /work/postgrey&#45;1.34 

mkdir /var/spool/postfix/postgrey
cp postgrey /var/spool/postfix/postgrey
cp postgrey_whitelist_clients /etc/postfix/postgrey_whitelist_clients
cp postgrey_whitelist_recipients /etc/postfix/postgrey_whitelist_recipients
chown &#45;R _amavisd /var/spool/postfix/postgrey
chgrp &#45;R _amavisd /var/spool/postfix/postgrey
chmod &#45;R 755 /var/spool/postfix/postgrey
/var/spool/postfix/postgrey/postgrey &#45;&#45;inet=10023 &#45;d &#45;&#45;user=_amavisd &#45;&#45;group=_amavisd
======= rrdtool =======
Download rrdtool&#45;1.4.5
cd /work
tar xfvz rrdtool&#45;1.4.5.tar.gz
cd /work/rrdtool&#45;1.4.5

./configure
make &amp;&amp; make Install
On your main HD you will find a folder &quot;opt&quot;

cp /opt/rrdtool&#45;1.4.5/lib/perl/5.12.3/RRDp.pm /Library/Perl/5.12/RRDp.pm
cp &#45;r /opt/rrdtool&#45;1.4.5/lib/perl/5.12.3/darwin&#45;thread&#45;multi&#45;2level/auto/RRDp/ /Library/Perl/5.12/darwin&#45;thread&#45;multi&#45;2level/auto/RRDp/
cp &#45;r /opt/rrdtool&#45;1.4.5/lib/perl/5.12.3/darwin&#45;thread&#45;multi&#45;2level/auto/RRDs/ /Library/Perl/5.12/darwin&#45;thread&#45;multi&#45;2level/auto/RRDs/
cp /opt/rrdtool&#45;1.4.5/lib/perl/5.12.3/darwin&#45;thread&#45;multi&#45;2level/perllocal.pod /Library/Perl/5.12/darwin&#45;thread&#45;multi&#45;2level/perllocal.pod
cp /opt/rrdtool&#45;1.4.5/lib/perl/5.12.3/darwin&#45;thread&#45;multi&#45;2level/RRDs.pm /Library/Perl/5.12/darwin&#45;thread&#45;multi&#45;2level/RRDs.pm

Now open de screen webminstats in webmin, some errrors for some modules that won&apos;t work on os x and you get your working webminstats. Turn it on and let it run 1 hour. (nice graphics 
======= Logrotate =======
/usr/local/sbin/logrotate
/usr/local/etc/logrotate.conf (download)
======= php suhosin =======
cd /work
wget http://download.suhosin.org/suhosin&#45;0.9.32.1.tar.gz
tar xfvz suhosin&#45;0.9.32.1.tar.gz
cd /work/suhosin&#45;0.9.32.1
phpize
./configure 
make
make install

add the folowing to /etc/php.ini
extension=suhosin.so
======= php PEAR =======
We need PEAR! For some reason, it&apos;s not set up ready to on Lion, but the install phar file is here, so we just need to run it.

cd /usr/lib/php
sudo php install&#45;pear&#45;nozlib.phar
Edit /etc/php.ini and find the line: ;include_path = &quot;.:/php/includes&quot; and change it to:
include_path = &quot;.:/usr/lib/php/pear&quot;
sudo pear channel&#45;update pear.php.net
sudo pecl channel&#45;update pecl.php.net
sudo pear upgrade&#45;all

PHPUnit and friends
I assume that everyone needs these…
sudo pear channel&#45;discover pear.phpunit.de
sudo pear channel&#45;discover components.ez.no
sudo pear channel&#45;discover pear.symfony&#45;project.com
sudo pear install phpunit/PHPUnit
sudo pear install phpunit/phpcpd
sudo pear install PHP_CodeSniffer
======= php PECL OAuth =======
A couple of projects I work on use the PECL OAuth component:
cd /work
wget http://sourceforge.net/projects/pcre/files/pcre/8.12/pcre&#45;8.12.tar.gz
tar xfvz pcre&#45;8.12.tar.gz
cd /work/pcre&#45;8.12
./configure
sudo cp pcre.h /usr/include/
Remove the pcre folder on your desktop as you don&apos;t need it any more
sudo pecl install oauth
Edit/etc/php.ini add these lines to the end of the file:

[oauth]
extension=oauth.so
Restart apache: sudo apachectl restart and check in the phpinfo that OAuth is now loaded.
======= php mcrypt =======
cd /work
wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt&#45;2.5.8.tar.gz
tar xfvz libmcrypt&#45;2.5.8.tar.gz
cd /work/libmcrypt&#45;2.5.8
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS=&apos;&#45;O3 &#45;fno&#45;common &#45;arch i386 &#45;arch x86_64&apos; LDFLAGS=&apos;&#45;O3 &#45;arch i386 &#45;arch x86_64&apos; CXXFLAGS=&apos;&#45;O3 &#45;fno&#45;common &#45;arch i386 &#45;arch x86_64&apos; ./configure &#45;&#45;disable&#45;dependency&#45;tracking
make &#45;j6
make install
cd /work
wget http://us.php.net/get/php&#45;5.3.6.tar.gz/from/nl.php.net/mirror
tar xfvz php&#45;5.3.6.tar.gz
cd /work/php&#45;5.3.6/ext/mcrypt
/usr/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS=&apos;&#45;O3 &#45;fno&#45;common &#45;arch i386 &#45;arch x86_64&apos; LDFLAGS=&apos;&#45;O3 &#45;arch i386 &#45;arch x86_64&apos; CXXFLAGS=&apos;&#45;O3 &#45;fno&#45;common &#45;arch i386 &#45;arch x86_64&apos; ./configure &#45;&#45;with&#45;php&#45;config=/Developer/SDKs/MacOSX10.7.sdk/usr/bin/php&#45;config 
make &#45;j6
make install
sudo apachectl restart
extension=mcrypt.so
======= logwatch =======
cd /work
wget http://sourceforge.net/projects/logwatch/files/logwatch&#45;7.4.0/logwatch&#45;7.4.0.tar.gz
tar xfvz logwatch&#45;7.4.0.tar.gz
cd /work/logwatch&#45;7.4.0

bash install_logwatch.sh
======= pflogsumm =======
cd /work
wget http://linxnet.com/downloads/pflogsumm&#45;1.1.1.tar.gz
tar xfvz pflogsumm&#45;1.1.1.tar.gz
cd /work/pflogsumm&#45;1.1.1

cp pflogsumm.pl /usr/local/bin/pflogsumm
chown root:wheel /usr/local/bin/pflogsumm
chmod 755 /usr/local/bin/pflogsumm

mkdir /usr/local/man/man1/
cp pflogsumm.1 /usr/local/man/man1/pflogsumm.1
chown root:wheel /usr/local/man/man1/pflogsumm.1
chmod 644 /usr/local/man/man1/pflogsumm.1
======= squid =======
cd /work
wget http://www.squid&#45;cache.org/Versions/v3/3.1/squid&#45;3.1.15.tar.gz
tar xfvz squid&#45;3.1.15.tar.gz
cd /work/squid&#45;3.1.15
./configure &#45;&#45;enable&#45;ssl &#45;&#45;enable&#45;delay&#45;pools
cd /work
wget http://sourceforge.net/projects/sarg/files/sarg/sarg&#45;2.3.1/sarg&#45;2.3.1.tar.gz
tar xfvz sarg&#45;2.3.1.tar.gz
cd /work/sarg&#45;2.3.1
./configure
make 
make install
======= PHP Imap =======
cd /work
wget http://ftp.ntua.gr/pub/net/mail/imap/imap&#45;2007f.tar.gz
tar xfvz imap&#45;2007f.tar.gz

mv /work/imap&#45;2007f /usr/local/imap&#45;2007
cd /usr/local/imap&#45;2007
make osx
sudo cp c&#45;client/c&#45;client.a c&#45;client/libc&#45;client.a
cd /work
tar xfvz php&#45;5.3.6.tar.gz
cd /work/php&#45;5.3.6/ext/imap
phpize
./configure &#45;&#45;with&#45;imap=/usr/local/imap&#45;2007 &#45;&#45;with&#45;kerberos &#45;&#45;with&#45;imap&#45;ssl
make
cp modules/imap.so /usr/lib/php/extensions/no&#45;debug&#45;non&#45;zts&#45;20090626/

add extension=imap.so 
to php.ini
======= webmin/usermin/virtualmin =======
cd /work 
wget: http://sourceforge.net/projects/webadmin/files/webmin/1.570/webmin&#45;1.570.tar.gz
tar xfvz webmin&#45;1.570.tar.gz
cd /work/webmin&#45;1.570 
./setup.sh
admin username: root
pass: use your root password

cd /work
wget http://sourceforge.net/projects/webadmin/files/usermin/1.490/usermin&#45;1.490.tar.gz
tar xfvz usermin&#45;webmail&#45;1.480.tar.gz
cd /work/usermin&#45;webmail&#45;1.480
./setup.sh

Open webmin website and install virtualmin server + virtualmin server template
wget http://download.webmin.com/download/virtualmin/virtual&#45;server&#45;3.89.gpl.wbm.gz
wget http://download.webmin.com/download/virtualmin/virtual&#45;server&#45;theme&#45;8.1.wbt.gz

In webmin, these two modules are hard to find on the internet.
download and install  wbmclamav&#45;0.14.wbm.gz
download and install  amavisd_1.8&#45;for&#45;amavisdV2.038.wbm</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-01-05T13:37:47+00:00</dc:date>
    </item>

    <item>
      <title>MacMini Server 2011 Part IV</title>
      <link>http://www.4elements.com/blog/macmini_server_2011_part_iv</link>
      <guid>http://www.4elements.com/blog/macmini_server_2011_part_iv#When:12:54:29Z</guid>
      <description>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&apos;s for later.

Part IV: Settings.

======= Webmin ========
Post&#45;Installation Wizard
&#45; Install Virtualmin
&#45; Install Virtualmin template
&#45; DNS need to setup,
&#45; PostgreSQL
&#45; MySQL

goto your webmin url in safari or firefox.
https://your.givenname.com:10000
login with root and root password

click on webmin, at the left. &#45;&gt; webmin configuration.
click on webmin modules and select + install virtualmin
Click on Return to Webmin configuration 
click on Webmin Themes &#45;&gt;  Install theme 
click on Return to themes list 
select virtualmin template and click on change...
 
page will reload and will be shown the new template.
Click on webmin, left top
click on &quot;servers&quot; from the left menu
clcik on BIND DNS Server

======== DNS ========
DNS module Configuration
Display options: 
Reverse zone must exist? yes
Zone file options:
Serial number style: Date based (YYYYMMDDnn)

DNS Configuration: 
Addresses and Topology
Ports and addresses: Listed below
Port number: 53
Addresses: any

Zone Defaults
Allow transfers from.. default
Refresh time: 10800
Expiry time: 1209600
Transfer retry time: 3600
Negative cache time: 10800
Default email address: email addes your like to use
Default nameserver for master domains: ns01.servername.com
and press save.

than create an default master zone of the domain used for your host name.
(this domain name will also be used for name server. aka mailserver)
It should look like this.

$ttl 10800
domainname.com.	IN	SOA	ns01.domainname.com. info.domainname.com. (
			2011102600
			10800
			3600
			1209600
			10800 )
domainname.com.	IN	A	xx.xx.xx.xx
www.domainname.com.	IN	A	xx.xx.xx.xx
mail.domainname.com.	IN	A	xx.xx.xx.xx
ftp.domainname.com.	IN	A	xx.xx.xx.xx
ns01.domainname.com.	14400 IN	A	xx.xx.xx.xx
ns02.domainname.com.	14400 IN	A	xx.xx.xx.xx
domainname.com.	86400 IN	NS	ns01.domainname.com.
domainname.com.	86400 IN	NS	ns02.domainname.com.
domainname.com.	IN	MX	10 mail.domainname.com.

Now goto your domain rigistar and add at the dns section
ns01.yourdomain.com &#45; IP address here
ns02.yourdomain.com &#45; IP address here
it can take upto 24 hours before it&apos;s progressed.
(depending on the domain rigistar you use)

======== PostgreSQL ========
If you not already done it by now. start server and let it load.
than quit the server (PostgreSQL will be configured and activated now)

under unused modules at the right pick, PostgreSQL
click on module configure

Options: 
Administrator login: _postgres
password: set password to your root password.

System configuration:
Path to psql command: /usr/bin/psql
Path to PostgreSQL shared libraries: /usr/lib/postgresql
Initial PostgreSQL database: template1
Command to start PostgreSQL: su _postgres &#45;c &quot;/usr/bin/pg_ctl &#45;D/private/var/pgsql&quot;
Path to postmaster PID file: /private/var/pgsql/postmaster.pid
Paths to host access config file: /private/var/pgsql/pg_hba.conf
Path to pg_dump command: /usr/bin/pg_dump
Path to pg_restore command: /usr/bin/pg_restore
press save and PostgreSQL webinterface is loading..

======== MySQL ========
under server, click on MySQL
enter your password.
press save
Click on Module Config &#45;&gt; system configure
Path to mysqld command: /usr/local/mysql/bin/mysqld
Click on save

Mysql is done.

======== Post&#45;Installation Wizard ========
press on system information left bottom.

Post&#45;Installation Wizard
Preload Virtualmin libraries? Yes
Run MySQL database server? Yes
Run PostgreSQL database server? Yes
Change MySQL password Leave un&#45;changed
DNS: keep your hostname as main.
enter as 2nd your ns02.#censored# 
(if you get an error, restart dns and try again)
Password storage mode: store plain&#45;text passwords

======== setting up continue webmin and virtualmin ========
Before we set the other settings, first install all needed modules first.

http://software.virtualmin.com/gpl/wbm/
Module php pear: http://software.virtualmin.com/gpl/wbm/php&#45;pear&#45;1.5.wbm.gz
Module Ruby GEMS: http://software.virtualmin.com/gpl/wbm/ruby&#45;gems&#45;1.4.wbm.gz
virtualmin&#45;dav: http://software.virtualmin.com/gpl/wbm/virtualmin&#45;dav&#45;3.5.wbm.gz
virtualmin&#45;awstats: http://software.virtualmin.com/gpl/wbm/virtualmin&#45;awstats&#45;4.6.wbm.gz
virtual&#45;server&#45;mobile: http://software.virtualmin.com/gpl/wbm/virtual&#45;server&#45;mobile&#45;2.4.wbt.gz
virtualmin&#45;svn: http://software.virtualmin.com/gpl/wbm/virtualmin&#45;svn&#45;4.9.wbm.gz
virtualmin&#45;htpasswd: http://software.virtualmin.com/gpl/wbm/virtualmin&#45;htpasswd&#45;2.5.wbm.gz 

amavisd: I have a rare copy... only downloadable from our site.
Webmin &#45;&gt; webmin &#45;&gt; webmin configuration &#45;&gt; Webmin Modules

======== Feature or Plugin ========
Our coal:

Feature or Plugin   	  
+ Administration user
+ Home directory
+ BIND DNS domain
+ Mail for domain
+ Apache website
+ Webalizer reporting
+ SSL website
+ Log file rotation
+ MySQL database
+ PostgreSQL database
+ ProFTPd virtual FTP
&#45; Spam filtering
&#45; Virus filtering
+ Webmin login
+ AWstats reporting	Plugin
+ DAV Login	Plugin

Spam and virus will be handled by AwavisD&#45;New and Clam Antivirus

======== PRO FTP ========
webmin &#45;&gt;  Un&#45;used Modules &#45;&gt; proftp &#45;&gt; module config

ProFTP:
Path to ProFTPD config file: /usr/local/proftpd/etc/proftpd.conf
Path to ProFTPD executable: /usr/local/proftpd/sbin/proftpd
Path to ProFTPD PID file:/usr/local/proftpd/var/proftpd.pid
Path to ftpusers file None (was /etc/ftpusers)

Before we can start ProFTPD, we need to make some OS X specific adjustments. Go ahead and open up the &quot;ProFTPD Server&quot; module under the &quot;Servers&quot; section. Select the &quot;Edit Config Files&quot; option. Look for the line that has the comment &quot;Set the user and group under which the server will run.&quot; and comment out the next two lines so it looks like this:

# Set the user and group under which the server will run.
#User	 nobody
#Group	 nogroup
Click the &quot;Save&quot; button to return to the main menu. By now you should have a functional FTP server. However, thier are a couple of &quot;tweaks&quot; I like to do to make things work a little better. Lets start by removing the login delay.

Click on &quot;Networking Options&quot; in the ProFTPD module&apos;s main menu.
Change the &quot;Do reverse DNS lookups of client&quot; option to &quot;No&quot;.
Change the &quot;Lookup remote ident username&quot; option to &quot;No&quot;.
PASV port range: 60000 &#45; 65535
Click &quot;Save&quot; to save and return to the main menu.

Lets allow the use of &quot;CHMOD&quot;:
In the main menu, under &quot;Virtual Servers&quot; click &quot;Default server&quot;.
Under &quot;Per&#45;directory and Per&#45;command options&quot; click &quot;Commands SITE_CHMOD&quot;.
Click &quot;Access Control&quot;.
Change the &quot;Access Control Policy&quot; option to &quot;Allow all clients&quot;.
Click &quot;SITE_CHMOD&quot;.
set FTP commands to All (or just what you like)

Click &quot;Save&quot; to save. Then click &quot;return to main menu&quot;.

Limit Users to Home Directory:
Click on &quot;Files and Directoriess&quot; in the main menu.
Change the &quot;Limit users to directories&quot; option to &quot;Home Directory&quot;.
Click &quot;Save&quot; to save and return to the main menu&quot;.

To avoid hack attacks, change the port number of proftp.
I changed it from port 21 to XXXX (pick your own number)
I also disabled anonymous ftp.

Download config file.....

&#45;&#45;&#45;&#45;&#45;&gt; proftp settings file bijsluiten
Starting ProFTPD Automaticly on Boot
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.

Open up Webmin, and go to the &quot;Bootup and Shutdown&quot; module under the &quot;System&quot; menu.
Click on &quot;Add a new bootup action script&quot;.
Action Name: PROFTPD
Script name: PROFTPD
Bootup Commands: /usr/local/proftpd/sbin/proftpd
Description: ProFTPD
Provides: FTP
Start Message: Starting ProFTPD
Stop Message: Stopping ProFTPD
Start at boot time?: Yes
Click &quot;Create&quot;

Shell /bin/false for FTP users is not included in /etc/shells, which may prevent FTP access.
Create a group names ftp

======== SSH Server &#45; OpenSSH_5.6 ========
Authentication:
Allow authentication by password? No
Allow login by root? No (before server setup &#45; yes)
Allow RSA (SSH 1) authentication? no

Networking: 
Listen on port XXXX (pick your own number)
Accept protocols SSH v2
Deny members of groups deniedssh (create this group)

User SSH Key Setup
Setup SSH key for new Unix users? yes

Host SSH Keys
Create a ssh_host_key.pub, ssh_host_rsa_key.pub and ssh_host_dsa_key.pub
under /private/etc/
Use provided script (sh sshd&#45;key&#45;gen)

Client Host Options
Edit Host Options
Port to connect to xxxxx (your own unique number here)
Number of connection attempts 2
Try SSH protocols 2 only

Start server
If you&apos;re not able to connect to ssh server, add Port XXXX (pick your own number)
to the config file. (sometimes it won&apos;t copy from the settings)

Open up Webmin, and go to the &quot;Bootup and Shutdown&quot; module under the &quot;System&quot; menu.
Click on &quot;Add a new bootup action script&quot;.
Action Name: OPENSSH
Script name: OPENSSH
Bootup Commands: /usr/sbin/sshd
Description: OpenSSH
Provides: SSH
Start Message: Starting OpenSSH
Stop Message: Stopping OpenSSH
Start at boot time?: Yes

======== SSH Server &#45; SSH Login ========
Other &#45;&gt; SSH Login:
Module config.
Port to connect to: XXXX (pick your own number)

======== Amavisd&#45;new ========
Path to AMaViSD&#45;new amavisd: /usr/bin/amavisd
Path to AMaViSD&#45;new amavisd.conf: /etc/amavisd.conf
Path to PID&#45;File: /var/amavis/amavsid.pid
default Domain: domainname.com
Path to Amavis Start file: /etc/init.d/amavisd

======== Clam Antivirus ========
Configuration category: ClamAV
ClamAV system user: _clamav
ClamAV system group: _clamav
Daemon init script path: /usr/sbin/clamd
Logfile path: /var/log/clamav.log
Configuration file path: /etc/clamd.conf
Main virus signatures database path: /var/clamav/main.cld
Daily virus signatures database path: /var/clamav/daily.cvd

Configuration category: Freshclam
Configuration file path: /etc/freshclam.conf
Logfile path: /var/log/freshclam.log
Daemon init script path: /etc/cron.daily/freshclam

Press save
Than press backup

======== AWstats ========
AWstats configuration directory: /Library/WebServer/awstats/wwwroot/cgi&#45;bin/
Full path to AWstats program:/Library/WebServer/awstats/wwwroot/cgi&#45;bin/awstats.pl
Full path to AWstats icons directory: /Library/WebServer/awstats/wwwroot/icon
Full path to AWstats lang directory: /Library/WebServer/awstats/wwwroot/cgi&#45;bin/lang
Full path to AWstats lib directory: /Library/WebServer/awstats/wwwroot/cgi&#45;bin/lib
Full path to AWstats plugins directory: /Library/WebServer/awstats/wwwroot/cgi&#45;bin/plugins

======== CVS Server ========
Just click, &quot;Initialize Repository&quot; than &quot;Setup&quot;

======== Webalizer Logfile Analysis ========
Configurable options:
Automatically include logfiles from: Apache, Squid, ProFTPd

System configuration:
Path to webalizer command: /usr/local/bin/webalizer
Path to webalizer configuration file: /usr/local/etc/webalizer.conf
Sample webalizer configuration file: /usr/local/etc/webalizer.conf.sample

======== PHP manage ========
Resource Limits:
Maximum memory allocation 512M
Maximum file upload size 64M
Maximum input parsing time 360
Maximum HTTP POST size 64M
Maximum execution time 360

Error Logging:
Expression for error types: E_ALL &amp; ~E_NOTICE

Other Settings:
Allow PHP scripts starting with &amp;lt;? ? YES

======== PHP Manuel ========
[apc]
extension=&quot;/usr/local/Cellar/apc/3.1.9/apc.so&quot;
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256M
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

[memcache]
extension=&quot;/usr/local/Cellar/memcache&#45;php/2.2.6/memcache.so&quot;

[suhosin]
extension=suhosin.so

[oauth]
extension=oauth.so

[mcrypt]
extension=mcrypt.so

[imap]
extension=imap.so

[ffmpeg]
extension=ffmpeg.so


======== Perl ========
Suggested Modules: Click install Selected Modules ans all will be included (small glidsh in webmin)

======== Log File Rotation ========
webmin &#45;&gt; Un&#45;used Modules &#45;&gt; Log File Rotation
Path to logrotate configuration file: /usr/local/etc/logrotate.conf
Path to logrotate program: /usr/local/sbin/logrotate

======== Amavisd ========
#@local_domains_maps = ( [&quot;.$mydomain&quot;] );  # list of all local domains
@local_domains_maps = ( read_hash(&quot;/var/amavis/local_domains&quot;) );

into 

@local_domains_maps = ( [&quot;.$mydomain&quot;] );  # list of all local domains
#@local_domains_maps = ( read_hash(&quot;/var/amavis/local_domains&quot;) );

forward_method =&gt; &apos;smtp:[127.0.0.1]:10027&apos;,
into
forward_method =&gt; &apos;smtp:[127.0.0.1]:10025&apos;,
  
uncomment $virus_admin               if you would like to reseive emails (what&apos;s going on spam/virus wize)

# $myhostname = &apos;host.example.com&apos;;  # must be a fully&#45;qualified domain name!
into
$myhostname = &apos;space09.domainname.com&apos;;  # must be a fully&#45;qualified domain name!


======== postgrey ========
Open up Webmin, and go to the &quot;Bootup and Shutdown&quot; module under the &quot;System&quot; menu.
Click on &quot;Add a new bootup action script&quot;.
Action Name: POSTGREY
Script name: POSTGREY
Bootup Commands: /var/spool/postfix/postgrey/postgrey &#45;&#45;inet=10023 &#45;d &#45;&#45;user=postgrey &#45;&#45;group=postgrey
Description: POSTGREY
Provides: filter
Start Message: Starting postgrey
Stop Message: Stopping postgrey
Start at boot time?: Yes
Click &quot;Create&quot;

/etc/postfix/main.cf

Change:
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

Into:

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

======== mail server ========
check to see if your mailserver is running as should be
http://www.mxtoolbox.com/

Check your DNS
http://www.intodns.com/

======== Webmin &#45;&gt; system ==========
Apache Webserver

Processes and Limits:
Maximum requests per server process: 0
Minimum spare server processes: 5
Maximum spare server processes: 10
Initial server processes: 5

SSL Options:
Fixed password: (pick a password for later on)

Default Server: Virtual Server Options

Directory Indexing: 
Directory index files	
index.html
index.htm
index.shtml
index.php
index.php4
index.php5
index.pl
index.cgi

SSL Options: Generate a .crt and .key file

Step 1: Generate a Private Key

The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self&#45;signed certificates which can be used for testing purposes or internal usage.

The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple&#45;DES and stored in a PEM format so that it is readable as ASCII text.

openssl genrsa &#45;des3 &#45;out server.key 1024

Generating RSA private key, 1024 bit long modulus
.........................................................++++++
........++++++
e is 65537 (0x10001)
Enter PEM pass phrase:
Verifying password &#45; Enter PEM pass phrase:

Step 2: Generate a CSR (Certificate Signing Request)

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&#45;sign the CSR, which will be demonstrated in the next section.

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 &quot;Common Name (e.g., YOUR name)&quot;. 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:

openssl req &#45;new &#45;key server.key &#45;out server.csr

Country Name (2 letter code) [GB]:CH
State or Province Name (full name) [Berkshire]:Bern
Locality Name (eg, city) [Newbury]:Oberdiessbach
Organization Name (eg, company) [My Company Ltd]:Akadia AG
Organizational Unit Name (eg, section) []:Information Technology
Common Name (eg, your name or your server&apos;s hostname) []:public.akadia.com
Email Address []:martin dot zahn at akadia dot ch
Please enter the following &apos;extra&apos; attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Step 3: Remove Passphrase from Key

One unfortunate side&#45;effect of the pass&#45;phrased private key is that Apache will ask for the pass&#45;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&#45;phrase, such as after a reboot or crash. mod_ssl includes the ability to use an external program in place of the built&#45;in pass&#45;phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple&#45;DES encryption from the key, thereby no longer needing to type in a pass&#45;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&#45;phrase from the key:

cp server.key server.key.org
openssl rsa &#45;in server.key.org &#45;out server.key

The newly created server.key file has no more passphrase in it.

&#45;rw&#45;r&#45;&#45;r&#45;&#45; 1 root root 745 Jun 29 12:19 server.csr
&#45;rw&#45;r&#45;&#45;r&#45;&#45; 1 root root 891 Jun 29 13:22 server.key
&#45;rw&#45;r&#45;&#45;r&#45;&#45; 1 root root 963 Jun 29 13:22 server.key.org

Step 4: Generating a Self&#45;Signed Certificate

At this point you will need to generate a self&#45;signed certificate because you either don&apos;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.

To generate a temporary certificate which is good for 365 days, issue the following command:

openssl x509 &#45;req &#45;days 365 &#45;in server.csr &#45;signkey server.key &#45;out server.crt
Signature ok
subject=/C=CH/ST=Bern/L=Oberdiessbach/O=Akadia AG/OU=Information
Technology/CN=public.akadia.com/Email=martin dot zahn at akadia dot ch
Getting Private key

Step 5: Installing the Private Key and Certificate

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.

cp server.crt /usr/local/apache/conf/ssl.crt
cp server.key /usr/local/apache/conf/ssl.key

Step 6: Configuring SSL Enabled Virtual Hosts

SSLEngine on
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
SetEnvIf User&#45;Agent &quot;.*MSIE.*&quot; nokeepalive ssl&#45;unclean&#45;shutdown
CustomLog logs/ssl_request_log \
   &quot;%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \&quot;%r\&quot; %b&quot;

Step 7: Restart Apache and Test

apachectl stop
apachectl start


======== check system configuration ========
Bind ok....
Postfix ok....
Suexec, need to be changed.
(Virtualmin &#45;&gt; Virtualmin configuration &#45;&gt; defaults for new domain. enter /home2 &#45;&gt; press save

Bind ok....
Postfix ok....
Apache ok....
Mysql ok....
PostgreSQL ok....
Logrotate ok....

All is running, but we are not done yet.
Now we will configure webmin and virtualmin.

======== Webmin ==========
webmin &#45;&gt; Webmin Configuration
start at boot time: yes

Trusted Referrers:
Referrer checking enabled? yes
Trust links from unknown referrers: yes

Authentication:
Support full PAM conversations? yes
Use MD5 encryption for Webmin passwords (allows long passwords) YES

======== Webmin &#45;&gt; system ==========
Disk Quotas, turn it on on the HD where your system runs on

======== Webmin &#45;&gt; system ==========
Historic System Statistics: turn it on or leave it off. (

======== Webmin &#45;&gt; Usermin Configuration ==========
install Usermin &#45;&gt; Un&#45;used Modules &#45;&gt; Usermin Configuration &#45;&gt; click on &quot;install Usermin&quot;

webmin &#45;&gt; Usermin Configuration
start at boot time: yes

Authentication:
Enable session authentication: yes
Always require username and password: yes
Support full PAM conversations? yes

Available Modules: 
select you want to Usermin

Access Control Options: 
Root directory for file chooser: User&apos;s home directory

DAV Server:
DAV enabled? Enabled
Allow access to directory: User&apos;s home directory

Restart usermin.

======== Webmin &#45; Usermin &#45;&gt; PAM ==========
PAM Authentication:
cp /work/usermin&#45;webmail&#45;1.480/usermin&#45;pam&#45;osx /etc/pam.d/usermin
cp /etc/pam.d/usermin /etc/pam.d/webmin
For Dovecot
cp /etc/pam.d/usermin /etc/pam.d/dovecot
Open /etc/pam.d/dovecot and replace current listing with:

# dovecot: auth account password session
auth required pam_nologin.so
auth sufficient pam_securityserver.so
auth sufficient pam_unix.so
auth required pam_deny.so
account required pam_permit.so
password required pam_deny.so
session required pam_uwtmp.so

======== Webmin &#45;&gt; Usermin &#45;&gt; Usermin Configuration ==========
Read mail: 
Mail storage format for Inbox: Qmail style
Sendmail mail file location: ~${USER}/Maildir

PostgreSQL Database: 
Path to psql command: /usr/bin/psql
Path to PostgreSQL shared libraries: /usr/lib/postgresql
Path to pg_dump command: /usr/bin/pg_dump
Path to pg_restore command: /usr/bin/pg_restore
Only show databases owned by user? yes

SSH Login:
Port number for SSH: XXXX (pick your own number)

Upload and Download:
Limit uploads and downloads to home directory? yes

======== Virtualmin &#45;&gt; System Settings &#45;&gt; Features and Plugins ==========
Select all except &quot;Spam filtering&quot; and &quot;virus filtering&quot; We use our own (remember)

======== Virtualmin &#45;&gt; System Settings &#45;&gt; Server Templates ==========
mkdir /etc/skel
I moved my own under construction html files to it.
The moment a new accounts has been created the under construction page is shown by default.

Default Settings: 
Home directory: Substitute variables in contents? Yes

Bind DNS domain:
Custom TTL: 10800
Create new domains in view: com.apple.ServerAdmin.DNS....
Add SPF DNS record? Yes
Does SPF record cover all senders? yes

Mail for domain:
Email message to send upon server creation: Message below ..
Default quota for mail users: Unlimited

Apache Website:
Directives and settings for new websites:

ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi&#45;bin/ ${HOME}/public_html/cgi&#45;bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all


Options FollowSymLinks +ExecCGI
AddHandler cgi&#45;script .cgi .pl
Allow from all


Configure Webmin to use same SSL cert for IP? Yes
Configure Usermin to use same SSL cert for IP? Yes
PHP configuration variables for scripts: memory_limit 256M

Webmin Login:
Webmin group for domain owners: hosting

======== Virtualmin &#45;&gt; System Settings &#45;&gt; Account Plans ==========

You may create what you want here.
I&apos;ll add a &quot;Pro Plan&quot; with all on unlimited

======== Virtualmin &#45;&gt; System Settings &#45;&gt; Virtualmin Configuration ==========
User interface settings:
Columns to show: pick your own
Feature columns to show: pick your own
Show mailbox size in users list? Yes
Allow editing of limits when creating server? Yes

Defaults for new domains:
Home directory base: /Users

Actions upon Server and User creation:
Notify other modules when updating server administrator Unix users? yes
Notify other modules when updating mailbox Unix users? Yes
Add users with no SSH access to deniedssh group? yes

Advanced Options:
Delete all email aliases when disabling mail? Yes
Allow creation of sub&#45;domains? Yes

======== Un&#45;used Modules &#45;&gt; squid ==========
Module configuration: _ options
Encryption method for proxy passwords: md5base64

system conf:
Full path to squid config file: /usr/local/etc/squid.conf
Squid executable: /usr/local/sbin/squid
Full path to PID file: /usr/local/var/run/squid.pid
Full path to squid cache directory: /usr/local/var/cache
Squid cachemgr.cgi executable: /usr/local/Cellar/squid/3.1.9/libexec/cachemgr.cgi
Full path to squid log directory: /usr/local/var/logs
Path to squidclient program: /usr/local/bin/squidclient

======== Squid Report Generator ========
Module configuration.

Full path to sarg executable: /usr/local/bin/sarg
Full path to SARG configuration file: /usr/local/etc/sarg.conf

======== Apple OSX settings ========
chmod 777 /Library/Logs

======== Web server ========
There are 2 ways to setup apache. I choose to use the default settings of apache to work well with webmin.

Specific setup for use with server.app is easy accomplish.
Both instruction will be posted on a later stage.
======== Mail server ========
A complete solution will be provided. Stay tuned.
(Below is the raw version, for those who requested.)
======== Dovecot IMAP/POP3 Server ========
We will configure the mail our selves, but to get all config files created
please launge &quot;Admin Server&quot; add mail and start the mail server. This will generate all files we need. (stop the mail server when generation is done)

Dovecot server program: /usr/sbin/dovecotd
Full path to Dovecot configuration file: /etc/dovecot/dovecot.conf
Dovecot server PID file: /var/run/dovecot/master.pid

Mail Files:
Mail file location: Inbox and folders in ~/Maildir
UIDL format: %08Xu%08Xv

======== Postfix Mail Server ========
The message &quot;group or other writable&quot; means that another user (not the owner) is able to write. You can fix it with chmod. Example to remove group write permissions
 
$ sudo chmod g&#45;w /Library/Server/Mail/Data/mta

Suggest to create a backup of /etc/postfix /etc/dovecot and /etc/apache2
cd /etc
/Developer/Tools/CpMac &#45;r apache2 &quot;apache2 backup&quot;
/Developer/Tools/CpMac &#45;r postfix &quot;postfix backup&quot;
/Developer/Tools/CpMac &#45;r dovecot &quot;dovecot backup&quot;

While it&apos;s possible to write all steps by hand, I decided to attach the config files.
(change my files and copy them to the ment folders. i&apos;ll explain during the process)

after copy:
chown root:wheel /private/etc/postfix/*
chmod g&#45;w /var/lib/postfix

cd /etc/postfix
postmap hash:access
postmap hash:transport
postmap hash:sender_access

General Options:
What domains to receive mail for: $myhostname
Network interfaces for receiving mail: All
Local internet domain name: Default
Mail queue directory: /var/spool/postfix
rm &#45;r /var/spool/postfix
mkdir /var/spool/postfix

Mail Aliases:
Alias databases used by the local delivery agent: Map specifications: hash:/etc/postfix/aliases

Canonical Mapping:
Tables for recipient addresses: No map set 

Virtual Domains:
Domain mapping lookup tables: hash:/etc/postfix/virtual

Transport Mapping:
Transport mapping lookup tables: Map specifications: hash:/etc/postfix/smtproutes

Header Checks:
Example header checks

Body Checks: 
Message body checking tables: Map specifications: pcre:/etc/postfix/custom_body_checks
Example body checks

Local Delivery:
Home&#45;relative pathname of user mailbox file: Maildir/
External command to use instead of mailbox delivery: /usr/libexec/dovecot/deliver
Optional actual transport to use: None

SMTP Server Options:
Timeout in seconds for SMTP transactions: 300s
Disable SMTP VRFY command: Yes
Error count for closing connection: 20
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
Restrictions on sender addresses: permit_sasl_authenticated,permit_mynetworks,permit_auth_destination,reject_non_fqdn_sender,reject_unknown_sender_domain,permit
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
cd /etc/postfix
postmap hash:sender_access
postmap hash:access

SMTP Authentication And Encryption:
Handle non&#45;compliant SMTP clients?: yes
SMTP security options: none

SMTP Client Restrictions:
Client restrictions: Postfix default (allow all clients)  (all off)

Edit main.cf
data_directory = /var/lib/postfix
rm /var/lib/postfix
mkdir /var/lib/postfix
chown _postfix /var/lib/postfix
Show main.cf file (example domainnames)

==&gt; virtual_transport = lmtp:unix:/var/imap/socket/lmtp

Edit greylist.pl (/usr/libexec/postfix/greylist.pl)
change: /Library/Server/Mail/Data/mta/
into: /var/lib/postfix/

Edit Master.cf:
Show master.cf file (example domainnames)</description>
      <dc:subject>Daily,</dc:subject>
      <dc:date>2012-01-05T12:54:29+00:00</dc:date>
    </item>

    
    </channel>
</rss>