<?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>2012-02-02T17:52:46Z</updated> <rights>Copyright (c) 2012, Martijn Broeders</rights> <generator uri="http://expressionengine.com/" version="2.4.0">ExpressionEngine</generator> <id>tag:4elements.com,2012:02:02</id><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:56Z</published> <updated>2012-01-06T14:30:57Z</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><entry><title>Happy New Year</title><link rel="alternate" type="text/html" href="http://www.4elements.com/blog/happy_new_year" /> <id>tag:4elements.com,2011:blog/3.155</id> <published>2011-01-01T13:14:37Z</published> <updated>2011-01-04T14:20:38Z</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>All the best wisher for 2011.</strong><br /> The things that came to mind.....<br /> <br /> - Creative and productive;<br /> - The recession ends;<br /> - No more alarm clock bugs from Apple;<br /> - Complete redesign of 4elements.com;<br /> - Last but not least, stay healthy.<br /> ]]></content> </entry><entry><title>Best Practices for Speeding Up Your Web Site</title><link rel="alternate" type="text/html" href="http://www.4elements.com/blog/best_practices_for_speeding_up_your_web_site" /> <id>tag:4elements.com,2010:blog/3.153</id> <published>2010-09-19T09:48:34Z</published> <updated>2010-09-19T12:46:35Z</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 id="page-nav">Best Practices for Speeding Up Your Web Site</strong><br /> The Exceptional Performance team has identified a number of best practices for making web pages fast.<br /> The list includes 35 best practices divided into 7 categories.<br /> <br /> <strong>Minimize HTTP Requests</strong><br /> 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces the number of HTTP requests required to render the page. This is the key to faster pages. <br /> <br /> One way to reduce the number of components in the page is to simplify the page's design. But is there a way to build pages with richer content while also achieving fast response times? Here are some techniques for reducing the number of HTTP requests, while still supporting rich page designs.<br /> <br /> <strong>Combined files</strong> are a way to reduce the number of HTTP requests by combining all scripts into a single script, and similarly combining all CSS into a single stylesheet. Combining files is more challenging when the scripts and stylesheets vary from page to page, but making this part of your release process improves response times.<br /> <br /> <a href="http://alistapart.com/articles/sprites" target="_blank"><strong>CSS Sprites</strong></a> are the preferred method for reducing the number of image requests. Combine your background images into a single image and use the CSS <code>background-image</code> and <code>background-position</code> properties to display the desired image segment.<br /> <br /> <a href="http://www.w3.org/TR/html401/struct/objects.html#h-13.6" target="_blank"><strong>Image maps</strong></a> combine multiple images into a single image. The overall size is about the same, but reducing the number of HTTP requests speeds up the page. Image maps only work if the images are contiguous in the page, such as a navigation bar. Defining the coordinates of image maps can be tedious and error prone. Using image maps for navigation is not accessible too, so it's not recommended.<br /> <br /> <strong>Inline images</strong> use the <a href="http://tools.ietf.org/html/rfc2397" target="_blank"><code>data:</code> URL scheme</a> to embed the image data in the actual page. This can increase the size of your HTML document. Combining inline images into your (cached) stylesheets is a way to reduce HTTP requests and avoid increasing the size of your pages. Inline images are not yet supported across all major browsers.<br /> <br /> Reducing the number of HTTP requests in your page is the place to start. This is the most important guideline for improving performance for first time visitors. As described in Tenni Theurer's blog post <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" target="_blank">Browser Cache Usage - Exposed!</a>, 40-60% of daily visitors to your site come in with an empty cache. Making your page fast for these first time visitors is key to a better user experience.<br /> <a href="#page-nav">top</a> <br /> <br /> <strong>Use a Content Delivery Network</strong><br /> The user's proximity to your web server has an impact on response times. Deploying your content across multiple, geographically dispersed servers will make your pages load faster from the user's perspective. But where should you start?<br /> As a first step to implementing geographically dispersed content, don't attempt to redesign your web application to work in a distributed architecture. Depending on the application, changing the architecture could include daunting tasks such as synchronizing session state and replicating database transactions across server locations. Attempts to reduce the distance between users and your content could be delayed by, or never pass, this application architecture step. <br /> Remember that 80-90% of the end-user response time is spent downloading all the components in the page: images, stylesheets, scripts, Flash, etc. This is the <em>Performance Golden Rule</em>. Rather than starting with the difficult task of redesigning your application architecture, it's better to first disperse your static content. This not only achieves a bigger reduction in response times, but it's easier thanks to content delivery networks.<br /> A content delivery network (CDN) is a collection of web servers distributed across multiple locations to deliver content more efficiently to users. The server selected for delivering content to a specific user is typically based on a measure of network proximity. For example, the server with the fewest network hops or the server with the quickest response time is chosen.<br /> Some large Internet companies own their own CDN, but it's cost-effective to use a CDN service provider, such as <a href="http://www.akamai.com/" target="_blank">Akamai Technologies</a>, <a href="http://www.edgecast.com/" target="_blank">EdgeCast</a>, or <a href="http://www.level3.com/index.cfm?pageID=36" target="_blank">level3</a>. For start-up companies and private web sites, the cost of a CDN service can be prohibitive, but as your target audience grows larger and becomes more global, a CDN is necessary to achieve fast response times.  Switching to a CDN is a relatively easy code change that will dramatically improve the speed of your web site.<br /> <a href="#page-nav">top</a> <br /> <br /> <strong id="expires">Add an Expires or a Cache-Control Header</strong><br /> <br /> There are two aspects to this rule:<br /> <br /> For static components: implement "Never expire" policy by setting far future <code>Expires</code> header<br /> For dynamic components: use an appropriate <code>Cache-Control</code> header to help the browser with conditional requests<br /> <br /> Web page designs are getting richer and richer, which means more scripts, stylesheets, images, and Flash in the page. A first-time visitor to your page may have to make several HTTP requests, but by using the Expires header you make those components cacheable. This avoids unnecessary HTTP requests on subsequent page views. Expires headers are most often used with images, but they should be used on <em>all</em> components including scripts, stylesheets, and Flash components.<br /> Browsers (and proxies) use a cache to reduce the number and size of HTTP requests, making web pages load faster. A web server uses the Expires header in the HTTP response to tell the client how long a component can be cached. This is a far future Expires header, telling the browser that this response won't be stale until April 15, 2010. <br /><pre>      Expires: Thu, 15 Apr 2010 20:00:00 GMT</pre><br /> If your server is Apache, use the ExpiresDefault directive to set an expiration date relative to the current date. This example of the ExpiresDefault directive sets the Expires date 10 years out from the time of the request.<br /><pre>      ExpiresDefault "access plus 10 years"</pre><br /> Keep in mind, if you use a far future Expires header you have to change the component's filename whenever the component changes. At 4elements.com we often make this step part of the build process: a version number is embedded in the component's filename, for example, 4elements_2.0.6.js.<br /> Using a far future Expires header affects page views only after a user has already visited your site. It has no effect on the number of HTTP requests when a user visits your site for the first time and the browser's cache is empty. Therefore the impact of this performance improvement depends on how often users hit your pages with a primed cache. (A "primed cache" already contains all of the components in the page.) We <a href="http://yuiblog.com/blog/2007/01/04/performance-research-part-2/" target="_blank">measured this at 4elements.com</a> and found the number of page views with a primed cache is 75-85%. By using a far future Expires header, you increase the number of components that are cached by the browser and re-used on subsequent page views without sending a single byte over the user's Internet connection.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="gzip">Gzip Components</strong><br /> The time it takes to transfer an HTTP request and response across the network can be significantly reduced by decisions made by front-end engineers. It's true that the end-user's bandwidth speed, Internet service provider, proximity to peering exchange points, etc. are beyond the control of the development team. But there are other variables that affect response times. Compression reduces response times by reducing the size of the HTTP response.<br /> Starting with HTTP/1.1, web clients indicate support for compression with the Accept-Encoding header in the HTTP request.<br /><pre>      Accept-Encoding: gzip, deflate</pre><br /> If the web server sees this header in the request, it may compress the response using one of the methods listed by the client. The web server notifies the web client of this via the Content-Encoding header in the response.<br /><pre>      Content-Encoding: gzip</pre><br /> Gzip is the most popular and effective compression method at this time. It was developed by the GNU project and standardized by <a href="http://www.ietf.org/rfc/rfc1952.txt" target="_blank">RFC 1952</a>. The only other compression format you're likely to see is deflate, but it's less effective and less popular. <br /> Gzipping generally reduces the response size by about 70%. Approximately 90% of today's Internet traffic travels through browsers that claim to support gzip. If you use Apache, the module configuring gzip depends on your version: Apache 1.3 uses <a href="http://sourceforge.net/projects/mod-gzip/" target="_blank">mod_gzip</a> while Apache 2.x uses <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" target="_blank">mod_deflate</a>. <br /> There are known issues with browsers and proxies that may cause a mismatch in what the browser expects and what it receives with regard to compressed content. Fortunately, these edge cases are dwindling as the use of older browsers drops off. The Apache modules help out by adding appropriate Vary response headers automatically. <br /> Servers choose what to gzip based on file type, but are typically too limited in what they decide to compress. Most web sites gzip their HTML documents. It's also worthwhile to gzip your scripts and stylesheets, but many web sites miss this opportunity. In fact, it's worthwhile to compress any text response including XML and JSON. Image and PDF files should not be gzipped because they are already compressed. Trying to gzip them not only wastes CPU but can potentially increase file sizes. <br /> Gzipping as many file types as possible is an easy way to reduce page weight and accelerate the user experience.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="css_top">Put Stylesheets at the Top</strong><br /> While researching performance at 4elements.com, we discovered that moving stylesheets to the document HEAD makes pages <em>appear</em> to be loading faster. This is because putting stylesheets in the HEAD allows the page to render progressively. <br /> Front-end engineers that care about performance want a page to load progressively; that is, we want the browser to display whatever content it has as soon as possible. This is especially important for pages with a lot of content and for users on slower Internet connections. The importance of giving users visual feedback, such as progress indicators, has been well researched and <a href="http://www.useit.com/papers/responsetime.html" target="_blank">documented</a>. In our case the HTML page is the progress indicator! When the browser loads the page progressively the header, the navigation bar, the logo at the top, etc. all serve as visual feedback for the user who is waiting for the page. This improves the overall user experience.<br /> The problem with putting stylesheets near the bottom of the document is that it prohibits progressive rendering in many browsers, including Internet Explorer. These browsers block rendering to avoid having to redraw elements of the page if their styles change. The user is stuck viewing a blank white page.<br /> The <a href="http://www.w3.org/TR/html4/struct/links.html#h-12.3" target="_blank">HTML specification</a> clearly states that stylesheets are to be included in the HEAD of the page: "Unlike A, [LINK] may only appear in the HEAD section of a document, although it may appear any number of times." Neither of the alternatives, the blank white screen or flash of unstyled content, are worth the risk. The optimal solution is to follow the HTML specification and load your stylesheets in the document HEAD.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="js_bottom">Put Scripts at the Bottom</strong><br /> The problem caused by scripts is that they block parallel downloads. The <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4" target="_blank">HTTP/1.1 specification</a> suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. While a script is downloading, however, the browser won't start any other downloads, even on different hostnames. <br /> In some situations it's not easy to move scripts to the bottom. If, for example, the script uses <code>document.write</code> to insert part of the page's content, it can't be moved lower in the page. There might also be scoping issues. In many cases, there are ways to workaround these situations.<br /> An alternative suggestion that often comes up is to use deferred scripts. The <code>DEFER</code> attribute indicates that the script does not contain document.write, and is a clue to browsers that they can continue rendering. Unfortunately, Firefox doesn't support the <code>DEFER</code> attribute. In Internet Explorer, the script may be deferred, but not as much as desired. If a script can be deferred, it can also be moved to the bottom of the page. That will make your web pages load faster.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="css_expressions">Avoid CSS Expressions</strong><br /> CSS expressions are a powerful (and dangerous) way to set CSS properties dynamically. They were supported in Internet Explorer starting with version 5, but were <a href="http://msdn.microsoft.com/en-us/library/ms537634%28VS.85%29.aspx" target="_blank">deprecated starting with IE8</a>. As an example, the background color could be set to alternate every hour using CSS expressions:<br /><pre>      background-color: expression( (new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00" );</pre><br /> <br /> As shown here, the <code>expression</code> method accepts a JavaScript expression. The CSS property is set to the result of evaluating the JavaScript expression. The <code>expression</code> method is ignored by other browsers, so it is useful for setting properties in Internet Explorer needed to create a consistent experience across browsers.<br /> The problem with expressions is that they are evaluated more frequently than most people expect. Not only are they evaluated when the page is rendered and resized, but also when the page is scrolled and even when the user moves the mouse over the page. Adding a counter to the CSS expression allows us to keep track of when and how often a CSS expression is evaluated. Moving the mouse around the page can easily generate more than 10,000 evaluations.<br /> One way to reduce the number of times your CSS expression is evaluated is to use one-time expressions, where the first time the expression is evaluated it sets the style property to an explicit value, which replaces the CSS expression. If the style property must be set dynamically throughout the life of the page, using event handlers instead of CSS expressions is an alternative approach. If you must use CSS expressions, remember that they may be evaluated thousands of times and could affect the performance of your page.<br /> <a href="#page-nav" target="_blank">top</a><br /> <br /> <strong id="external">Make JavaScript and CSS External</strong><br /> Many of these performance rules deal with how external components are managed. However, before these considerations arise you should ask a more basic question: Should JavaScript and CSS be contained in external files, or inlined in the page itself?<br /> <br /> Using external files in the real world generally produces faster pages because the JavaScript and CSS files are cached by the browser. JavaScript and CSS that are inlined in HTML documents get downloaded every time the HTML document is requested. This reduces the number of HTTP requests that are needed, but increases the size of the HTML document. On the other hand, if the JavaScript and CSS are in external files cached by the browser, the size of the HTML document is reduced without increasing the number of HTTP requests. <br /> <br /> The key factor, then, is the frequency with which external JavaScript and CSS components are cached relative to the number of HTML documents requested. This factor, although difficult to quantify, can be gauged using various metrics. If users on your site have multiple page views per session and many of your pages re-use the same scripts and stylesheets, there is a greater potential benefit from cached external files. <br /> <br /> Many web sites fall in the middle of these metrics. For these sites, the best solution generally is to deploy the JavaScript and CSS as external files.<br /> Home pages that have few (perhaps only one) page view per session may find that inlining JavaScript and CSS results in faster end-user response times.<br /> <br /> For front pages that are typically the first of many page views, there are techniques that leverage the reduction of HTTP requests that inlining provides, as well as the caching benefits achieved through using external files. One such technique is to inline JavaScript and CSS in the front page, but dynamically download the external files after the page has finished loading. Subsequent pages would reference the external files that should already be in the browser's cache.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="dns_lookups">Reduce DNS Lookups</strong><br /> The Domain Name System (DNS) maps hostnames to IP addresses, just as phonebooks map people's names to their phone numbers. When you type www.4elements.com into your browser, a DNS resolver contacted by the browser returns that server's IP address. DNS has a cost. It typically takes 20-120 milliseconds for DNS to lookup the IP address for a given hostname. The browser can't download anything from this hostname until the DNS lookup is completed. <br /> DNS lookups are cached for better performance. This caching can occur on a special caching server, maintained by the user's ISP or local area network, but there is also caching that occurs on the individual user's computer. The DNS information remains in the operating system's DNS cache (the "DNS Client service" on Microsoft Windows). Most browsers have their own caches, separate from the operating system's cache. As long as the browser keeps a DNS record in its own cache, it doesn't bother the operating system with a request for the record.<br /> Internet Explorer caches DNS lookups for 30 minutes by default, as specified by the <code>DnsCacheTimeout</code> registry setting. Firefox caches DNS lookups for 1 minute, controlled by the <code>network.dnsCacheExpiration</code> configuration setting. (Fasterfox changes this to 1 hour.)<br /> When the client's DNS cache is empty (for both the browser and the operating system), the number of DNS lookups is equal to the number of unique hostnames in the web page. This includes the hostnames used in the page's URL, images, script files, stylesheets, Flash objects, etc. Reducing the number of unique hostnames reduces the number of DNS lookups. <br /> Reducing the number of unique hostnames has the potential to reduce the amount of parallel downloading that takes place in the page. Avoiding DNS lookups cuts response times, but reducing parallel downloads may increase response times. My guideline is to split these components across at least two but no more than four hostnames. This results in a good compromise between reducing DNS lookups and allowing a high degree of parallel downloads.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="minify">Minify JavaScript and CSS</strong><br /> Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times. When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced. Two popular tools for minifying JavaScript code are <a href="http://crockford.com/javascript/jsmin" target="_blank">JSMin</a> and <a href="http://developer.yahoo.com/yui/compressor/" target="_blank">YUI Compressor</a>. The YUI compressor can also minify CSS.<br /> Obfuscation is an alternative optimization that can be applied to source code. It's more complex than minification and thus more likely to generate bugs as a result of the obfuscation step itself. In a survey of ten top U.S. web sites, minification achieved a 21% size reduction versus 25% for obfuscation. Although obfuscation has a higher size reduction, minifying JavaScript is less risky.<br /> <br /> In addition to minifying external scripts and styles, inlined <code>&lt;script&gt;</code> and <code>&lt;style&gt;</code> blocks can and should also be minified. Even if you gzip your scripts and styles, minifying them will still reduce the size by 5% or more. As the use and size of JavaScript and CSS increases, so will the savings gained by minifying your code.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="redirects">Avoid Redirects</strong><br /> Redirects are accomplished using the 301 and 302 status codes. Here's an example of the HTTP headers in a 301 response:<br /><pre>      HTTP/1.1 301 Moved Permanently
      Location: http://example.com/newuri
      Content-Type: text/html</pre><br /> The browser automatically takes the user to the URL specified in the <code>Location</code> field. All the information necessary for a redirect is in the headers. The body of the response is typically empty. Despite their names, neither a 301 nor a 302 response is cached in practice unless additional headers, such as <code>Expires</code> or <code>Cache-Control</code>, indicate it should be. The meta refresh tag and JavaScript are other ways to direct users to a different URL, but if you must do a redirect, the preferred technique is to use the standard 3xx HTTP status codes, primarily to ensure the back button works correctly.<br /> The main thing to remember is that redirects slow down the user experience. Inserting a redirect between the user and the HTML document delays everything in the page since nothing in the page can be rendered and no components can start being downloaded until the HTML document has arrived.<br /> One of the most wasteful redirects happens frequently and web developers are generally not aware of it. It occurs when a trailing slash (/) is missing from a URL that should otherwise have one. For example, going to <a href="http://www.4elements.com/astrology" target="_blank">http://www.4elements.com/astrology</a> results in a 301 response containing a redirect to <a href="http://www.4elements.com/astrology/" target="_blank">http://www.4elements.com/astrology/</a> (notice the added trailing slash). This is fixed in Apache by using <code>Alias</code> or <code>mod_rewrite</code>, or the <code>DirectorySlash</code> directive if you're using Apache handlers.<br /> Connecting an old web site to a new one is another common use for redirects. Others include connecting different parts of a website and directing the user based on certain conditions (type of browser, type of user account, etc.). Using a redirect to connect two web sites is simple and requires little additional coding. Although using redirects in these situations reduces the complexity for developers, it degrades the user experience. Alternatives for this use of redirects include using <code>Alias</code> and <code>mod_rewrite</code> if the two code paths are hosted on the same server. If a domain name change is the cause of using redirects, an alternative is to create a CNAME (a DNS record that creates an alias pointing from one domain name to another) in combination with <code>Alias</code> or <code>mod_rewrite</code>.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="js_dupes">Remove Duplicate Scripts</strong><br /> It hurts performance to include the same JavaScript file twice in one page. This isn't as unusual as you might think. A review of the ten top U.S. web sites shows that two of them contain a duplicated script. Two main factors increase the odds of a script being duplicated in a single web page: team size and number of scripts. When it does happen, duplicate scripts hurt performance by creating unnecessary HTTP requests and wasted JavaScript execution.<br /> Unnecessary HTTP requests happen in Internet Explorer, but not in Firefox. In Internet Explorer, if an external script is included twice and is not cacheable, it generates two HTTP requests during page loading. Even if the script is cacheable, extra HTTP requests occur when the user reloads the page.<br /> In addition to generating wasteful HTTP requests, time is wasted evaluating the script multiple times. This redundant JavaScript execution happens in both Firefox and Internet Explorer, regardless of whether the script is cacheable.<br /> One way to avoid accidentally including the same script twice is to implement a script management module in your templating system. The typical way to include a script is to use the SCRIPT tag in your HTML page.<br /><pre>      &lt;script type="text/javascript" src="menu_1.0.17.js"&gt;&lt;/script&gt;</pre><br /> An alternative in PHP would be to create a function called <code>insertScript</code>.<br /><pre>      &lt;?php insertScript("menu.js") ?&gt;</pre><br /> In addition to preventing the same script from being inserted multiple times, this function could handle other issues with scripts, such as dependency checking and adding version numbers to script filenames to support far future Expires headers.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="etags">Configure ETags</strong><br /> Entity tags (ETags) are a mechanism that web servers and browsers use to determine whether the component in the browser's cache matches the one on the origin server. (An "entity" is another word a "component": images, scripts, stylesheets, etc.) ETags were added to provide a mechanism for validating entities that is more flexible than the last-modified date. An ETag is a string that uniquely identifies a specific version of a component. The only format constraints are that the string be quoted. The origin server specifies the component's ETag using the <code>ETag</code> response header.<br /><pre>      HTTP/1.1 200 OK
      Last-Modified: Tue, 12 Dec 2006 03:03:59 GMT
      ETag: "10c24bc-4ab-457e1c1f"
      Content-Length: 12195</pre><br /> Later, if the browser has to validate a component, it uses the <code>If-None-Match</code> header to pass the ETag back to the origin server. If the ETags match, a 304 status code is returned reducing the response by 12195 bytes for this example.<br /><pre>      GET /i/yahoo.gif HTTP/1.1
      Host: us.yimg.com
      If-Modified-Since: Tue, 12 Dec 2006 03:03:59 GMT
      If-None-Match: "10c24bc-4ab-457e1c1f"
      HTTP/1.1 304 Not Modified</pre><br /> The problem with ETags is that they typically are constructed using attributes that make them unique to a specific server hosting a site. ETags won't match when a browser gets the original component from one server and later tries to validate that component on a different server, a situation that is all too common on Web sites that use a cluster of servers to handle requests. By default, both Apache and IIS embed data in the ETag that dramatically reduces the odds of the validity test succeeding on web sites with multiple servers.<br /> The ETag format for Apache 1.3 and 2.x is <code>inode-size-timestamp</code>. Although a given file may reside in the same directory across multiple servers, and have the same file size, permissions, timestamp, etc., its inode is different from one server to the next.<br /> IIS 5.0 and 6.0 have a similar issue with ETags. The format for ETags on IIS is <code>Filetimestamp:ChangeNumber</code>. A <code>ChangeNumber</code> is a counter used to track configuration changes to IIS. It's unlikely that the <code>ChangeNumber</code> is the same across all IIS servers behind a web site.<br /> The end result is ETags generated by Apache and IIS for the exact same component won't match from one server to another. If the ETags don't match, the user doesn't receive the small, fast 304 response that ETags were designed for; instead, they'll get a normal 200 response along with all the data for the component. If you host your web site on just one server, this isn't a problem. But if you have multiple servers hosting your web site, and you're using Apache or IIS with the default ETag configuration, your users are getting slower pages, your servers have a higher load, you're consuming greater bandwidth, and proxies aren't caching your content efficiently. Even if your components have a far future <code>Expires</code> header, a conditional GET request is still made whenever the user hits Reload or Refresh.<br /> If you're not taking advantage of the flexible validation model that ETags provide, it's better to just remove the ETag altogether. The <code>Last-Modified</code> header validates based on the component's timestamp. And removing the ETag reduces the size of the HTTP headers in both the response and subsequent requests. This <a href="http://support.microsoft.com/?id=922733" target="_blank">Microsoft Support article</a> describes how to remove ETags. In Apache, this is done by simply adding the following line to your Apache configuration file:<br /><pre>      FileETag none</pre><br /> <a href="#page-nav">top</a<br /> <br /> <strong id="cacheajax">Make Ajax Cacheable</strong><br /> One of the cited benefits of Ajax is that it provides instantaneous feedback to the user because it requests information asynchronously from the backend web server. However, using Ajax is no guarantee that the user won't be twiddling his thumbs waiting for those asynchronous JavaScript and XML responses to return. In many applications, whether or not the user is kept waiting depends on how Ajax is used. For example, in a web-based email client the user will be kept waiting for the results of an Ajax request to find all the email messages that match their search criteria. It's important to remember that "asynchronous" does not imply "instantaneous".<br /> <br /> To improve performance, it's important to optimize these Ajax responses. The most important way to improve the performance of Ajax is to make the responses cacheable, as discussed in <a href="#expires">Add an Expires or a Cache-Control Header</a>. Some of the other rules also apply to Ajax:<br /> <br /> <a href="#gzip">Gzip Components</a><br /> <a href="#dns_lookups">Reduce DNS Lookups</a><br /> <a href="#minify">Minify JavaScript</a><br /> <a href="#redirects">Avoid Redirects</a><br /> <a href="#etags">Configure ETags</a><br /> <br /> Let's look at an example. A Web 2.0 email client might use Ajax to download the user's address book for autocompletion. If the user hasn't modified her address book since the last time she used the email web app, the previous address book response could be read from cache if that Ajax response was made cacheable with a future Expires or Cache-Control header. The browser must be informed when to use a previously cached address book response versus requesting a new one. This could be done by adding a timestamp to the address book Ajax URL indicating the last time the user modified her address book, for example, <code>&amp;t=1190241612</code>. If the address book hasn't been modified since the last download, the timestamp will be the same and the address book will be read from the browser's cache eliminating an extra HTTP roundtrip. If the user has modified her address book, the timestamp ensures the new URL doesn't match the cached response, and the browser will request the updated address book entries.<br /> <br /> Even though your Ajax responses are created dynamically, and might only be applicable to a single user, they can still be cached. Doing so will make your Web 2.0 apps faster.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="flush">Flush the Buffer Early</strong><br /> When users request a page, it can take anywhere from 200 to 500ms for the backend server to stitch together the HTML page.<br /> During this time, the browser is idle as it waits for the data to arrive.<br /> In PHP you have the function <a href="http://php.net/flush" target="_blank">flush()</a>.<br /> It allows you to send your partially ready HTML response to the browser so that<br /> the browser can start fetching components while your backend is busy with the rest of the HTML page.<br /> The benefit is mainly seen on busy backends or light frontends.<br /> <br /> A good place to consider flushing is right after the HEAD because the HTML for the head is<br /> usually easier to produce and it allows you to include any CSS and JavaScript<br /> files for the browser to start fetching in parallel while the backend is still processing.<br /> <br /> Example:<br /><pre>
      ... &lt;!-- css, js --&gt;
    &lt;/head&gt;
    <span class="hilite">&lt;?php flush(); ?&gt;</span>
    &lt;body&gt;
      ... &lt;!-- content --&gt;
</pre><br /> <a href="#page-nav">top</a><br /> <br /> <strong id="ajax_get">Use GET for AJAX Requests</strong><br /> The 4elements design team found that when using <code>XMLHttpRequest</code>, POST is implemented in the browsers as a two-step process:<br /> sending the headers first, then sending data. So it's best to use GET, which only takes one TCP packet to send (unless you have a lot of cookies).<br /> The maximum URL length in IE is 2K, so if you send more than 2K data you might not be able to use GET.<br /> <br /> An interesting side affect is that POST without actually posting any data behaves like GET.<br /> Based on the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html" target="_blank">HTTP specs</a>, GET is meant for retrieving information, so it<br /> makes sense (semantically) to use GET when you're only requesting data, as opposed to sending data to be stored server-side.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="postload">Post-load Components</strong><br /> You can take a closer look at your page and ask yourself: "What's absolutely required in order to render the page initially?".<br /> The rest of the content and components can wait.<br /> <br /> JavaScript is an ideal candidate for splitting before and after the onload event. For example<br /> if you have JavaScript code and libraries that do drag and drop and animations, those can wait,<br /> because dragging elements on the page comes after the initial rendering.<br /> Other places to look for candidates for post-loading include hidden content (content that appears after a user action) and images below the fold.<br /> <br /> Tools to help you out in your effort: <a href="http://developer.yahoo.com/yui/imageloader/" target="_blank">YUI Image Loader</a> allows you to delay images<br /> below the fold and the <a href="http://developer.yahoo.com/yui/get/" target="_blank">YUI Get utility</a> is an easy way to include JS and CSS on the fly.<br /> <br /> It's good when the performance goals are inline with other<br /> web development best practices. In this case, the idea of progressive enhancement tells us that JavaScript, when supported, can<br /> improve the user experience but you have to make sure the page works even without JavaScript. So after you've made sure the page<br /> works fine, you can enhance it with some post-loaded scripts that give you more bells and whistles such as drag and drop and animations.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="preload">Preload Components</strong><br /> Preload may look like the opposite of post-load, but it actually has a different goal.<br /> By preloading components you can take advantage of the time the browser is idle and request components<br /> (like images, styles and scripts) you'll need in the future.<br /> This way when the user visits the next page, you could have most of the components already in<br /> the cache and your page will load much faster for the user.<br /> <br /> There are actually several types of preloading:<br /> <br /> <em>Unconditional</em> preload - as soon as onload fires, you go ahead and fetch some extra components.<br /> Check google.com for an example of how a sprite image is requested onload. This sprite image is<br /> not needed on the google.com homepage, but it is needed on the consecutive search result page.<br /> <em>Conditional</em> preload - based on a user action you make an educated guess where the user is headed next and preload accordingly.<br /> <em>Anticipated</em> preload - preload in advance before launching a redesign. It often happens after a redesign that you hear:<br /> "The new site is cool, but it's slower than before". Part of the problem could be that the users were visiting your old site with a<br /> full cache, but the new one is always an empty cache experience. You can mitigate this side effect by preloading some<br /> components before you even launched the redesign. Your old site can use the time the browser is idle and request images and scripts<br /> that will be used by the new site<br /> <br /> <a href="#page-nav">top</a><br /> <br /> <strong id="min_dom">Reduce the Number of DOM Elements</strong><br /> A complex page means more bytes to download and it also means slower DOM access in JavaScript. It makes a difference<br /> if you loop through 500 or 5000 DOM elements on the page when you want to add an event handler for example.<br /> <br /> A high number of DOM elements can be a symptom that there's something that should be improved with the markup<br /> of the page without necessarily removing content.<br /> Are you using nested tables for layout purposes?<br /> Are you throwing in more <code>&lt;div&gt;</code>s only to fix layout issues?<br /> Maybe there's a better and more semantically correct way to do your markup.<br /> <br /> A great help with layouts are the <a href="http://developer.yahoo.com/yui/" target="_blank">YUI CSS utilities</a>:<br /> grids.css can help you with the overall layout, fonts.css and reset.css<br /> can help you strip away the browser's defaults formatting.<br /> This is a chance to start fresh and think about your markup,<br /> for example use <code>&lt;div&gt;</code>s only when it makes sense semantically, and not because it renders a new line.<br /> <br /> The number of DOM elements is easy to test, just type in Firebug's console:<br /> <code>document.getElementsByTagName('*').length</code><br /> <br /> And how many DOM elements are too many? Check other similar pages that have good markup.<br /> For example the <a href="http://www.4elements.com" target="_blank">4elements Home Page</a> is a pretty busy page and still under 700 elements (HTML tags).<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="split">Split Components Across Domains</strong><br /> Splitting components allows you to maximize parallel downloads. Make sure you're using<br /> not more than 2-4 domains because of the DNS lookup penalty.<br /> For example, you can host your HTML and dynamic content<br /> on <code>www.example.org</code><br /> and split static components between <code>static1.example.org</code> and <code>static2.example.org</code><br /> <br /> For more information check<br /> "<a href="http://yuiblog.com/blog/2007/04/11/performance-research-part-4/" target="_blank">Maximizing Parallel Downloads in the Carpool Lane</a>" by Tenni Theurer and Patty Chi.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="iframes">Minimize the Number of iframes</strong><br /> Iframes allow an HTML document to be inserted in the parent document.<br /> It's important to understand how iframes work so they can be used effectively.<br /> <br /> <code>&lt;iframe&gt;</code> pros:<br /> Helps with slow third-party content like badges and ads<br /> Security sandbox<br /> Download scripts in parallel<br /> <br /> <code>&lt;iframe&gt;</code> cons:<br /> Costly even if blank<br /> Blocks page onload<br /> Non-semantic<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="no404">No 404s</strong><br /> HTTP requests are expensive so making an HTTP request and getting a useless response (i.e. 404 Not Found)<br /> is totally unnecessary and will slow down the user experience without any benefit.<br /> <br /> Some sites have helpful 404s "Did you mean X?", which is great for the user<br /> experience but also wastes server resources (like database, etc).<br /> Particularly bad is when the link to an external JavaScript is wrong and the result is a 404.<br /> First, this download will block parallel downloads. Next the browser may try to parse<br /> the 404 response body as if it were JavaScript code, trying to find something usable in it.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="cookie_size">Reduce Cookie Size</strong><br /> HTTP cookies are used for a variety of reasons such as authentication and personalization.<br /> Information about cookies is exchanged in the HTTP headers between web servers and browsers.<br /> It's important to keep the size of cookies as low as possible to minimize the impact on the user's response time.<br /> <br /> For more information check<br /> <a href="http://yuiblog.com/blog/2007/03/01/performance-research-part-3/" target="_blank">"When the Cookie Crumbles"</a> by Tenni Theurer and Patty Chi.<br /> The take-home of this research:<br /> <br /> Eliminate unnecessary cookies<br /> Keep cookie sizes as low as possible to minimize the impact on the user response time<br /> Be mindful of setting cookies at the appropriate domain level so other sub-domains are not affected<br /> Set an Expires date appropriately. An earlier Expires date or none removes the cookie sooner, improving the user response time<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="cookie_free">Use Cookie-free Domains for Components</strong><br /> When the browser makes a request for a static image and sends cookies together with the request,<br /> the server doesn't have any use for those cookies. So they only create network traffic for no good<br /> reason. You should make sure static components are requested with cookie-free requests. Create<br /> a subdomain and host all your static components there.<br /> <br /> If your domain is <code>www.example.org</code>, you can host your static components<br /> on <code>static.example.org</code>. However, if you've already set cookies on the top-level domain<br /> <code>example.org</code> as opposed to <code>www.example.org</code>, then all the requests to<br /> <code>static.example.org</code> will include those cookies. In this case, you can buy a whole new domain, host your static<br /> components there, and keep this domain cookie-free. YouTube uses <code>ytimg.com</code>,<br /> Amazon uses <code>images-amazon.com</code> and so on.<br /> <br /> Another benefit of hosting static components on a cookie-free domain is that some proxies might refuse to cache<br /> the components that are requested with cookies.<br /> On a related note, if you wonder if you should use example.org or www.example.org for your home page, consider the cookie impact.<br /> Omitting www leaves you no choice but to write cookies to <code>*.example.org</code>, so for performance reasons it's best to use the<br /> www subdomain and<br /> write the cookies to that subdomain.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="dom_access">Minimize DOM Access</strong><br /> Accessing DOM elements with JavaScript is slow so in order to have a more responsive page, you should:<br /> <br /> Cache references to accessed elements<br /> Update nodes "offline" and then add them to the tree<br /> Avoid fixing layout with JavaScript<br /> <br /> For more information check the YUI theatre's<br /> <a href="http://yuiblog.com/blog/2007/12/20/video-lecomte/" target="_blank">"High Performance Ajax Applications"</a><br /> by Julien Lecomte.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="events">Develop Smart Event Handlers</strong><br /> Sometimes pages feel less responsive because of too many event handlers attached to different<br /> elements of the DOM tree which are then executed too often. That's why using <em>event delegation</em> is a good approach.<br /> If you have 10 buttons inside a <code>div</code>, attach only one event handler to the div wrapper, instead of<br /> one handler for each button. Events bubble up so you'll be able to catch the event and figure out which button it originated from.<br /> <br /> You also don't need to wait for the onload event in order to start doing something with the DOM tree.<br /> Often all you need is the element you want to access to be available in the tree. You don't have to wait for all images to be downloaded.<br /> <br /> <code>DOMContentLoaded</code> is the event you might consider using instead of onload, but until it's available in all browsers, you<br /> can use the <a href="http://developer.yahoo.com/yui/event/" target="_blank">YUI Event</a> utility, which has an <code><a href="http://developer.yahoo.com/yui/event/#onavailable" target="_blank">onAvailable</a></code> method.<br /> <br /> For more information check the YUI theatre's<br /> <a href="http://yuiblog.com/blog/2007/12/20/video-lecomte/" target="_blank">"High Performance Ajax Applications"</a><br /> by Julien Lecomte.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="csslink">Choose &lt;link&gt; over @import</strong><br /> One of the previous best practices states that CSS should be at the top in order to allow for<br /> progressive rendering.<br /> <br /> In IE <code>@import</code> behaves the same as using <code>&lt;link&gt;</code> at the bottom of the page, so it's best not to use it.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="no_filters">Avoid Filters</strong><br /> The IE-proprietary <code>AlphaImageLoader</code> filter aims to fix a problem with semi-transparent true color PNGs in IE versions &lt; 7.<br /> The problem with this filter is that it blocks rendering and freezes the browser while the image is being downloaded.<br /> It also increases memory consumption and is applied per element, not per image, so the problem is multiplied.<br /> <br /> The best approach is to avoid <code>AlphaImageLoader</code> completely and use gracefully degrading PNG8 instead, which are fine in IE.<br /> If you absolutely need <code>AlphaImageLoader</code>, use the underscore hack <code>_filter</code> as to not penalize your IE7+ users.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="opt_images">Optimize Images</strong><br /> After a designer is done with creating the images for your web page, there are still some things you can try before you<br /> FTP those images to your web server.<br /> <br /> You can check the GIFs and see if they are using a palette size corresponding<br /> to the number of colors in the image. Using <a href="http://www.imagemagick.org" target="_blank">imagemagick</a> it's easy to check using<br /> <br /> <code>identify -verbose image.gif</code><br /> <br /> When you see an image useing 4 colors and a 256 color "slots" in the palette, there is room for improvement.<br /> <br /> Try converting GIFs to PNGs and see if there is a saving. More often than not, there is.<br /> Developers often hesitate to use PNGs due to the limited support in browsers, but this is now a thing of the past.<br /> The only real problem is alpha-transparency in true color PNGs, but then again, GIFs are not true color and don't<br /> support variable transparency either.<br /> So anything a GIF can do, a palette PNG (PNG8) can do too (except for animations).<br /> This simple imagemagick command results in totally safe-to-use<br /> PNGs:<br /> <code>convert image.gif image.png</code><br /> <br /> "All we are saying is: Give PiNG a Chance!"<br /> <br /> Run <a href="http://pmt.sourceforge.net/pngcrush/" target="_blank">pngcrush</a> (or any other PNG optimizer tool) on all your PNGs. Example:<br /> <br /> <code>pngcrush image.png -rem alla -reduce -brute result.png</code><br /> <br /> Run jpegtran on all your JPEGs. This tool does lossless JPEG operations such as rotation and can also be used to optimize<br /> and remove comments and other useless information (such as EXIF information) from your images.<br /> <br /> <code>jpegtran -copy none -optimize -perfect src.jpg dest.jpg</code><br /> <a href="#page-nav">top</a><br /> <br /> <strong id="opt_sprites">Optimize CSS Sprites</strong><br /> <br /> Arranging the images in the sprite horizontally as opposed to vertically usually results in a smaller file size.<br /> Combining similar colors in a sprite helps you keep the color count low, ideally under 256 colors so to fit in a PNG8.<br /> "Be mobile-friendly" and don't leave big gaps between the images in a sprite. This doesn't affect the file size as much<br /> but requires less memory for the user agent to decompress the image into a pixel map.<br /> 100x100 image is 10 thousand pixels, where 1000x1000 is 1 million pixels<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="no_scale">Don't Scale Images in HTML</strong><br /> Don't use a bigger image than you need just because you can set the width and height in HTML.<br /> If you need <br /> <code>&lt;img width="100" height="100" src="mycat.jpg" alt="My Cat" /&gt;</code><br /> <br /> then your image (mycat.jpg) should be 100x100px rather than a scaled down 500x500px image.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="favicon">Make favicon.ico Small and Cacheable</strong><br /> The favicon.ico is an image that stays in the root of your server.<br /> It's a necessary evil because even if you don't care about it the<br /> browser will still request it, so it's better not to respond with a <code>404 Not Found</code>.<br /> Also since it's on the same server, cookies are sent every time it's requested.<br /> This image also interferes with the download sequence, for example in IE when you request<br /> extra components in the onload, the favicon will be downloaded before these extra components.<br /> <br /> So to mitigate the drawbacks of having a favicon.ico make sure:<br /> <br /> It's small, preferably under 1K.<br /> Set Expires header with what you feel comfortable (since you cannot rename it if you decide to change it).<br /> You can probably safely set the Expires header a few months in the future.<br /> You can check the last modified date of your current favicon.ico to make an informed decision.<br /> <a href="http://www.imagemagick.org" target="_blank">Imagemagick</a> can help you create small favicons<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="under25">Keep Components under 25K</strong><br /> This restriction is related to the fact that iPhone won't cache components bigger than 25K.<br /> Note that this is the <em>uncompressed</em> size. This is where minification is important<br /> because gzip alone may not be sufficient.<br /> <br /> For more information check "<a href="http://yuiblog.com/blog/2008/02/06/iphone-cacheability/" target="_blank">Performance Research, Part 5: iPhone Cacheability - Making it Stick</a>" by Wayne Shea and Tenni Theurer.<br /> <a href="#page-nav">top</a><br /> <br /> <strong id="multipart">Pack Components into a Multipart Document</strong><br /> Packing components into a multipart document is like an email with attachments,<br /> it helps you fetch several components with one HTTP request (remember: HTTP requests are expensive).<br /> When you use this technique, first check if the user agent supports it (iPhone does not).<br /> <br /> <strong id="emptysrc">Avoid Empty Image src</strong><br /> Image with empty string <b>src</b> attribute occurs more than one will expect. It appears in two form: <br /> <br /> straight HTML<br><br /><blockquote>&lt;img src=""&gt;</blockquote><br /> JavaScript<br><br /><blockquote>var img = new Image();<br><br /> img.src = "";</blockquote><br /> <br /> Both forms cause the same effect: browser makes another request to your server.<br /> <br /> <b>Internet Explorer</b> makes a request to the directory in which the page is located.<br /> <b>Safari and Chrome</b> make a request to the actual page itself.<br /> <b>Firefox</b> 3 and earlier versions behave the same as Safari and Chrome, but version 3.5 addressed this issue<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=444931" target="_blank">[bug 444931]</a> and no longer sends a request.<br /> <b>Opera</b> does not do anything when an empty image src is encountered.<br /> <br /> <b>Why is this behavior bad? </b><br /> Cripple your servers by sending a large amount of unexpected traffic, especially for pages that get millions of page views per day.<br /> Waste server computing cycles generating a page that will never be viewed.<br /> Possibly corrupt user data. If you are tracking state in the request, either by cookies or in another way, you have the possibility of destroying data. Even though the image request does not return an image, all of the headers are read and accepted by the browser, including all cookies. While the rest of the response is thrown away, the damage may already be done.<br /> <br /> <br /> The root cause of this behavior is the way that URI resolution is performed in browsers. <br /> This behavior is defined in RFC 3986 - Uniform Resource Identifiers. <br /> When an empty string is encountered as a URI, it is considered a relative URI and is resolved according to the algorithm defined in section 5.2. This specific example, an empty string, is listed in section 5.4. Firefox, Safari, and Chrome are all resolving an empty string correctly per the specification, while Internet Explorer is resolving it incorrectly, apparently in line with an earlier version of the specification, RFC 2396 - Uniform Resource Identifiers (this was obsoleted by RFC 3986). So technically, the browsers are doing what they are supposed to do to resolve relative URIs. The problem is that in this context, the empty string is clearly unintentional.<br /> <br /> HTML5 adds to the description of the <img> tag's src  attribute to instruct browsers not to make an additional request in section 4.8.2:<br /> <br /><blockquote><br /> The src attribute must be present, and must contain a valid URL referencing a non-interactive, optionally animated, image resource that is neither paged nor scripted. If the base URI of the element is the same as the document's address, then the src attribute's value must not be the empty string.<br /></blockquote><br /> <br /> Hopefully, browsers will not have this problem in the future. Unfortunately, there is no such clause for &lt;script src=""&gt; and &lt;link href=""&gt;. Maybe there is still time to make that adjustment to ensure browsers don't accidentally implement this behavior.<br /> <br /> This rule was inspired by Yahoo!'s JavaScript guru Nicolas C. Zakas.  For more information check out his article "<a href="http://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/" target="_blank">Empty image src can destroy your site</a>".
]]></content> </entry><entry><title>5 Ways to Increase Your Website Traffic Through Effective Web Design</title><link rel="alternate" type="text/html" href="http://www.4elements.com/blog/5_ways_to_increase_your_website_traffic_through_effective_web_design" /> <id>tag:4elements.com,2010:blog/3.152</id> <published>2010-06-29T13:03:05Z</published> <updated>2010-06-29T16:27:06Z</updated> <author> <name>Kirsten Ramsburg</name> <email>interad@mac.com</email> </author><category term="Daily"
scheme="http://www.4elements.com/blog/category/daily"
label="Daily" /> <content type="html"><![CDATA[
You’ve found <a href="http://www.webhostingsearch.com/review/just-host.php#/JustPlan" target="_blank">cheap web hosting</a> for your personal or business website and you’re ready to go. A few simple considerations while designing your website layout will help bring new people to your site and make them want to recommend it to others.<br /> <br /> <strong>Attractive homepage</strong><br /> The first impression visitors get of your website is your homepage. Ask yourself what image you wish to present to your visitors. What kind of design gives the best idea of what your website is all about? If your site is a business site, does your homepage reflect a businesslike attitude? Your page's <a href="http://www.noupe.com/design/70-visually-impressing-header-graphics.html" target="_blank">header</a> is one of the few things that potential readers see in your homepage, so better make it impressive. Your homepage should be attractive, engaging, and interesting to look at in order to make visitors want to stay and see what the rest of your site has to offer.<br /> <br /> <strong>Visually interesting layout</strong><br /> The rest of your website should follow the example of your home page. Not only should your layout be interesting to look at, it should also be easy on the eyes. Too many images, widely-varying text sizes, and flashy designs will detract from your site’s layout and are likely to drive visitors away. Aim to draw visitor’s attention with well-placed blocks of text, and use images only where necessary.<br /> <br /> <strong>Easy navigation</strong><br /> Having the best content possible won’t make any difference if visitors can’t find it. If your site is difficult to navigate, chances are that visitors will give up and go to another site for what they want. Make sure that your menus are easy to use and that all of the links work. The more quickly visitors can find information on your site, the happier they will be, and the more likely to recommend your site to others. See <a href="http://www.smashingmagazine.com/2008/01/31/10-principles-of-effective-web-design/" target="_blank">tips from Smashing Magazine here</a>.<br /> <br /> <strong>Unique content</strong><br /> Why should people come to your website rather than other sites with similar information or products? Ask yourself this question as you build your design. Strive to present what your site has to offer as unique from everyone else’s and reflect that in your layout. Go for an eye-catching logo or header image that will stick in visitors’ minds. Arrange your most important content so that it immediately draws the eye. Give people a reason to use your site above all others. <br /> <br /> <strong>Clear information</strong><br /> Now that you have a good idea of how you want to present your products or information, make sure it is presented clearly. The look of your content is just as important as the overall look of your site. Work within the layout you’ve developed and position content accordingly. Make use of lists and section breaks to deliver information in a way that is quick and easy to read. Visitors will appreciate being able to find what they need without hassle. <br /> <br /> Having a website design that is easy to get around and nice to look at is the best way to attract new visitors to your site and keep them coming back. Coupled with a <a href="http://www.webhostingsearch.com/" target="_blank">reliable web hosting choice</a>, your site will draw traffic in no time.
]]></content> </entry><entry><title>Own dedicated G5 server II</title><link rel="alternate" type="text/html" href="http://www.4elements.com/blog/own_dedicated_g5_server_ii" /> <id>tag:4elements.com,2010:blog/3.151</id> <published>2010-06-18T12:47:13Z</published> <updated>2010-06-21T15:14: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>Today is the day.</strong><br /> The task has been completed. Our last client has just been moved to our own dedicated server.<br /> - All of our own websites, including 4elements.com, has been moved.<br /> - All our clients websites has been moved.<br /> <br /> One big advantage of webmin/virtualmin is that it allows you to import cpanel based accounts painless into webmin/virtualmin.<br /> <br /> Our next post will guide you in setting up a perfect working server on a PowerMac G5.<br /> Stay tuned.
]]></content> </entry><entry><title>Own dedicated G5 server I</title><link rel="alternate" type="text/html" href="http://www.4elements.com/blog/own_dedicated_g5_server" /> <id>tag:4elements.com,2010:blog/3.150</id> <published>2010-06-14T12:45:04Z</published> <updated>2010-06-21T15:16: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[
After months of preparation / installation and configuration it's finally done, 4elements.com has it's own dedicated server.<br /> <br /> <strong>Hardware:</strong><br /><blockquote>- PowerMac G5 Dual 2 Ghz 64Bit<br /> - 512 KB level 2 cache, per CPU<br /> - 1 Ghz Bus speed<br /> - 8 GB DDR SDRAM memory<br /> - 10 TB HD (1 internal jive)<br /> - 256 MB ATI RADEON 9600 video card</blockquote><br /> <br /> <strong>Network:</strong><br /><blockquote>- 2 x 1GB ethernet<br /> - Media Options: Full Duplex, flow-control<br /> - Media Subtype: 1000baseT<br /> 1 for extrenal (8 IP's)<br /> 1 for internal network</blockquote><br /> <br /> <strong>Main Software:</strong><br /><blockquote>- Mac OS X server 10.5.8<br /> - webmin.com, virtualmin.com</blockquote><br /> <br /> <strong>Server Software:</strong><br /><blockquote>- Apache 2.2.15<br /> - Php 5.2.9 <br /> -- Zend Engine v2.2.0<br /> -- eAccelerator v0.9.6<br /> -- ionCube v3.1.32<br /> -- Zend Optimizer v3.3.9<br /> -- Suhosin v0.9.31<br /> -- ffmpeg<br /> -- Ruby GEMS<br /> - Perl 5.8.8<br /> - MySQL 5.0.86 (64Bit)<br /> - Postgres 8.4.2 (64Bit)<br /> - Dovecot 1.1.19 (64Bit)<br /> - Postfix 2.4.3<br /> - SSH Server 5.2<br /> - BIND DNS 9.4.3<br /> - ProFTPd 1.33 (64Bit)<br /> - AMaVisD for virus and spam<br /> - CalDav, WebDav<br /> - and lots more....</blockquote><br /> <br /> <strong>Usage:</strong><br /><blockquote>- Web-, mail-, ftp-server, hosting<br /> - Local audio storage, private use<br /> - Local video storage, private use<br /> - Local photo storage, private use<br /> - Audio, Video and photo streaming, Local<br /> - TimeMachine backup, company and private comuters</blockquote><br /> <br /> The next thing to do is moving 4element.com and our clients websites to the new server.
]]></content> </entry></feed>
