- PeterMoulding.com
- Author
- Trainer
- Speaker
- Business Coach
- How to write a How To book
- PHP Courses
- Speaking
- Web Architect
- Australia
- Books
- Authors
- Akkana Peck
- Alex Berenson
- Andrew Nugent
- Ben Sanders
- Brock Clarke
- Chris Simms
- David Mercer
- Dianna Mullet
- Don Winslow
- Dori Smith
- Harlan Coben
- Jack McDevitt
- James Wines
- Jerry Yudelson
- John Grisham
- Kevin Mullet
- L. E. Modesitt Jr.
- Laurell K. Hamilton
- Marshall Karp
- Martina Cole
- Michael Marshall Smith
- Michel Roux Jr
- Nadia Sawalha
- Philip Pullman
- Raymond Khoury
- Richard North Patterson
- Robert Masello
- Sally Roth
- Sarah Langan
- Stella Rimington
- Stephen Booth
- Stephen King
- Stephen Leather
- T.C. Boyle
- Tom Negrino
- Tony Hillerman
- Urban Waite
- Val McDermid
- Valerio Massimo Manfredi
- Beginning GIMP
- Beginning Visual C++
- Culturalism
- Fiction
- A Drink Before The War
- A Talent for War
- Bag of Bones
- Blood and Ice
- Burn
- Dark Lady
- Dead Line
- Eclipse
- Empress of Eternity
- Exley
- Flipping Out
- Just One Look
- Nightfall
- Pet Sematary
- Savage Moon
- Skinwalkers
- Starvation Lake
- The Fallen
- The Gardens of the Dead
- The Jump
- The Last Templar
- The Mermaids Singing
- The Midnight Mayor
- The Secret Soldier
- The Summons
- The Terror of Living
- The Testament
- The Tower
- Under the Dome
- Virus
- AJAX and PHP
- Aging with Grace
- Food books
- Green Architecture
- Life Is So Good
- SQL: The Complete Reference
- The Backyard Bird Lover's Ultimate How-to Guide
- The Garden Gurus
- Authors
- Sustainability
- -18 hours left to decide the future of Australia
- Campbells vegetable stock or Massel vegetable stock?
- Carbon Sequestration
- Carbon tax for Australia is a fraud
- Copenhagen will fail
- Cost of living in Australia
- Dick Smith jumps on the population bandwagon
- Dry Run: Preventing the Next Urban Water Crisis
- Energy Saving Lights
- Garlic
- How many people can live in Australia?
- Its obsolete, throw it out!
- Julia Gillard offers 9.9 billion dollars bribe to Rob Oakeshott
- Laundry detergent
- Petrol or Diesel?
- Reflective foil batts kill
- RoHS
- Sea level to rise 3mm due to climate change
- Solar power
- Spring again in Sydney
- Sustainable fuels
- The CRUD Tax is back
- The people who make building regulations do not own houses
- Water efficiency
- Which insulation is safer, foil or wool?
- Will Australia reduce greenhouse gas emissions?
- Technology
- Android or Blackberry or iPhone or a flip phone?
- Apple versus Google 2011
- Cameras
- Cars
- Colour
- Burgundy
- Colour Blindness
- Colour Names
- Dulux colours
- Pantone colours
- Safe Colours
- Seculine ProDisk Mini colour balance card
- What Causes Colour Blindness?
- Hardware
- Batteries for the Digital Age
- Cables
- Cases
- Computer reliability
- Computrace
- Disks
- Astone ISO Gear 481E
- Best SSD for your notebook computer
- Disk block size
- Hitachi disk HDS722020ALA330
- LaCie USB 2.0 250 GB mobile hard drive design by F.A. Porsche
- SMART disk
- Samsung 2 TB HD204UI quiet low power disk for mass storage
- Seagate and Samsung merge disk business
- Select the right disk for your RAID array
- USB disk speed
- Western Digital WD20EARX 2 GB SATA 3 disk
- How long should computer hardware last?
- Keyboards
- Mainframe
- Memory cards
- Monitors
- Netbooks, notebooks, tablets, and xPads
- Network Attached Storage
- OLED Displays
- PC's are a thing of the past
- Printers
- Quiet
- Samsung Galaxy S
- Speed
- Television
- Tools
- USB
- Worst computer movies
- Xserve is dead. What next?
- Your backup will not work
- Z68 motherboards
- iPad or Acer Aspire One?
- IQ
- LG Intello Washing Machine
- Lack of a challenge
- Networks
- 802.11n wireless networking
- D-Link DIR-655 wireless router
- D-Link DWA-160 Xtreme N dual band USB adapter
- D-Link DWA-556 Xtreme N PCI Express desktop adapter
- MIMO
- NBN spends another $12 billion of our tax money on nothing
- National Broadband Network
- Netgear wireless modem router DGND3300 with 300 Mbps 802.11n
- Refrigerator kills wireless broadband
- Small Wireless Network
- TP-LINK TL-SG10005D 5 port gigabit switch
- TP-Link TL-WR1043N wireless N gigabit router
- Telstra Pre-paid Mobile Wi-Fi
- Where are the router plus proxy server combinations?
- Open Source documentation
- Software
- 7-zip
- Accounting
- Asterisk
- Audacity
- Backup software
- Bloat only in Windows
- CAD
- CDex
- Disk imaging software for copying and backup
- Exact Audio Copy
- Filezilla
- Firefox
- Java
- LibreOffice or OpenOffice?
- Linux
- 1 in 5 servers will ship with Linux
- Android phones outsell iPhone
- Another Move to Linux
- CentOS 5.5 installation on SSD and RAID 5
- Debian
- Debian 5.0.5 AMD64 installation
- Debian 5.06 installation
- Fedora
- Fedora or Ubuntu?
- Gnome or KDE?
- K9copy
- Linux 2.6.38
- Linux Gnome login settings lost
- Linux Mint
- Linux RAID, a rant
- Linux Speed
- Linux Time
- Linux reliability as demonstrated by Ubuntu 10.10
- Linux reliability as demonstrated by Ubuntu 11.4
- Linux still a struggle in 2011
- Linux workstation disk RAID 1
- Linux, NT, Windows, and SETI
- Linux, three years of progress
- London Stock Exchange switches to Linux
- Mandrake Linux 9.2
- The partition is misaligned by 48128 bytes - warning from Linux RAID
- Ubuntu
- How to fix the scroll bars in Ubuntu 11.4 Gnome
- Kubuntu 10.10 alternate installation on desktop with RAID 1
- POWbuntu
- Ubuntu 10.10 after 6 months use
- Ubuntu 10.10 alternate installation
- Ubuntu 10.10 desktop RAID 1
- Ubuntu 10.10 desktop RAID 5
- Ubuntu 10.10 desktop install on a netbook
- Ubuntu 10.10 desktop installation
- Ubuntu 10.10 netbook install on a netbook
- Ubuntu 10.10 server AMD64
- Ubuntu 10.10 upgrade to version 11.4 beta 2
- Ubuntu 10.4
- Ubuntu 11.10
- Ubuntu 11.10 first upgrade
- Ubuntu 11.4 after one month use
- Ubuntu 12.04 beta1 desktop amd64
- Ubuntu One
- Ubuntu by Microsoft?
- Ubuntu desktop upgrade 10.4 to 10.10 failed because I did not check the media
- Ubuntu strikes again
- Upgrade Ubuntu to Linux Mint 12 LDXE for extra speed
- Yes, use Linux but not that distribution!
- Nero
- OpenOffice
- OpenOffice is now Apache Office
- Project management
- Scribus
- Software for Windows and Linux
- Text editors
- Time
- Todo applications
- Tomboy notes
- Top text editors
- Version control
- VideoLAN VLC media player
- Visio
- Webmin
- Webmin installation on CentOS for Web development
- Webmin installation on Ubuntu
- What is the most popular open source software today?
- Windows
- Another Windows person goes Linux
- BAD_POOL_CALLER
- Cygwin
- Microsoft Malicious Software Removal Tool cannot find a common virus
- One of the developers of Windows XP is criminally insane
- There are unused icons on your desktop
- W32time
- Which Windows version?
- Windows 7 Home Premium
- Windows XP Stop 0x0000007B during installation
- Windows XP is a disaster
- Windows processes
- XML
- Zip, bzip, gzip, or 7zip?
- configFree
- Technology Succession Planning
- VoIP
- Web Sites
- Drupal
- Do Drupal themes have to use the GPL?
- Drupal 7
- A better search facility for Drupal
- Drupal - performance or flexibility
- Drupal 7 Fields are hard to fix
- Drupal 7 new features
- Drupal 7 ships on January 5
- Drupal 7.14
- Drupal 7.4 hits PeterMoulding.com
- Drupal function sequence
- The evolution of a module
- Undefined index: headers in DefaultMailSystem->mail() (line 54 of /modules/system/system.mail.inc).
- Undefined index: to in DefaultMailSystem->mail() (line 83 of /modules/system/system.mail.inc).
- implode(): Invalid arguments passed in DefaultMailSystem->format() (line 23 of /modules/system/system.mail.inc).
- Drupal 8
- Drupal Code Load Cut
- Drupal How To
- Drupal Modules
- Backup and Migrate
- Browscap
- CKEditor with Drupal WYSIWYG
- Captcha
- Cel
- Colorbox
- Content Construction Kit
- Content type
- Devel module for Drupal
- Drupal Rules as an automation language
- Drupal Spam add-on module
- Form alter to node
- IMCE
- IMCE Wysiwyg bridge
- ImageAPI
- Jdog
- Lightbox2
- Module variable
- Node Gallery Access
- Node_Gallery
- Path
- Path redirect
- Pathauto
- Pet
- Search
- Service links
- Session Variable
- Statistics
- Taxonomy
- Token
- Token ex
- Transliteration
- Trigger
- Watch
- Other modules
- Drupal Training
- Drupal access controls need a major rewrite
- Drupal coding tricks
- Drupal performance
- Drupal themes for the future
- Drupal.org colours
- Import existing data into Drupal
- Multiple Web sites made easy using Drupal multisite and the right start
- drupal_lookup_path()
- Adobe PDF
- Apache
- Apache Mahout
- Audi.com
- Bleet
- CSS Strikes Again
- CSS or xCSS
- Can you believe Facebook or email?
- Content Management Systems
- Databases
- Facebook scam
- Font
- Fonts
- HTML
- Install Apache, MySQL, and PHP 5 in Ubuntu 11.4 using the Ubuntu Software Centre
- Language Codes
- Marketing
- Memcache
- Nginx
- Open source development hits another roadblock
- Oscars
- PHP
- SPDY
- Search software
- Techoni.com.au
- Theme themes
- Things to hate on Web sites
- U.S. Patent No. 6,985,875
- Virtual Private Server
- Visible Improvement
- Web 4.0
- Web browser usage
- Web browsers
- Web site development
- Bluefish
- Crying over spilt code
- Eclipse and PHP
- Getting a Git client, a story of ancient technology and pain
- HTTrack
- MVC
- Netbeans
- PHP or ..., CakePHP/Symfony/ZF versus ...
- Programming
- Superfish
- Web browser emulators for testing your Web site
- Web development frameworks
- Web site books
- Web site development on your own computer
- Webmin or phpMyAdmin or cPanel for creating databases?
- aiki framework
- jQuery
- Views development - Learn Fields first
- Views development - Learn Actions and Rules
- jQuery .each()
- jQuery .has()
- jQuery .is()
- jQuery and Firefox Firebug
- jQuery children
- jQuery for people not using Drupal - Installation and getting started
- jQuery hover
- jQuery hover de-duplication example
- jQuery or CSS?
- jQuery performance
- jQuery tests
- Web site hosting
- Westpac Web site still broken after two years and ten months
- Wordpress wins another CMS survey
- Drupal
Apache Configuration for Performance
You can make your Apache based Web server faster by cleaning up the Apache configuration files. The changes do have an effect when your Web server is close to overloaded and you need the extra margin of processing power.
You configure Apache by changing the settings in httpd.conf. In Windows, http.conf is located in directory C:\Program Files\Apache Software Foundation\Apache2.2\conf. http.conf includes other files that are stored in directory C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra. For most Apache installations, you change httpd.conf then you change extras/httpd-vhosts.conf. Everything else can remain unchanged.
Documentation
The Apache documentation for the latest Apache, 2.2, is available online at httpd.apache.org/docs/2.2/. When you install Apache, you can optionally install a copy of the documentation on your own machine so you can read the documentation when not online.
httpd.conf
httpd.conf is the important configuration file for performance. Look at the default you get when you install Apache. In Windows, the default is saved in C:\Program Files\Apache Software Foundation\Apache2.2\conf\default so you can always go back to the default.
ThreadsPerChild
Your Windows default httpd.conf contains the following two lines. 250 means 250 threads can run at once and each one takes up memory. The same applies to requests and the 0 means you can have unlimited requests but you will have no more requests than the number generated by a thread. That makes threads the limiting factor and a thread is approximately one page request; which means 250 pages requests at one time.ThreadsPerChild 250
MaxRequestsPerChild 0
There are some other settings that match with these. The more activity you allow, the faster your Web site becomes until the computer starts to run out of memory. If you have too many threads running, you can starve your database and get worse performance because every page waits on the database. Buy the maximum memory that will fit in your computer and adjust these settings up until performance starts to drop. Adjust the database memory settings up at the same time so you grow everything in parallel until you hit the limit of available memory.
LoadModule
Look for a long list of LoadModule lines, such as the following load of mod_actions. Every module uses memory and creates one extra thing that Apache has to check, sometimes for every page request. If you are not using a module, do not load it. Most of the modules are turned off in my sites.LoadModule actions_module modules/mod_actions.so
mod_autoindex
LoadModule autoindex_module modules/mod_autoindex.so
Use mod_autoindex as an example. mod_autoindex is used when a browser requests a directory without a page. On my site, you can request petermoulding.com/australia/ without specifying a page name. My software presents the main content page automatically. If I did not have that software installed and let Apache choose the default page, Apache would look for a page specified in DirectoryIndex. When Apache cannot find DirectoryIndex, or cannot find the page specified by DirectoryIndex, Apache can automatically build an index page. Usually you want the page generated by your software and do not want an Apache automatic index because the Apache automatic index can reveal files you do not want revealed. You turn off automatic indexing for security. If you are not using automatic indexing then do not load the module.
When you remove automatic indexes, you can remove the following line. If Options contains more than Indexes, remove Indexes and leave the other options.Options Indexes
mod_include
LoadModule include_module modules/mod_include.so
mod_include processes SSI, Server Side Includes. You do not need SSI when using PHP. SSI is loaded by default so turn it off.
What is SSI? SSI looks like the following line which displays the date. You can do more with PHP, achieve finer control with PHP, and reduce the duplicate processing of Web pages by doing everything once in PHP, not PHP then SSI.
AllowOverride
Look for the following AllowOverride. If it says anything other than none, change it to none. You have to remove .htaccess files an other settings to reach the point where you can set AllowOverride to none so read the rest of this page and work back towards removing overrides.AllowOverride None
.htpasswd
.htpasswd contains passwords for access to restricted parts of your Web site. You do not need .htpasswd files with a good content management system. If you do use a .htpasswd file, never place it within your Web site directories. If your Web site is hosted and your host will not let you place files outside your Web directory, change hosts.
.htaccess
Your Web site may contain files named .htacces. They slow down your Web server because your Web server has to read every directory looking for possible .htaccess files and the process is repeated for every page request.
What would happen if my site had .htaccess turned on and you visited petermoulding.com/australia/animals/ring_tailed_possum? Apache would look for .htaccess files in /australia/ then /australia/animals/.
Most .htaccess settings can be moved from .htaccess to httpd.conf and extras/httpd-vhosts.conf. httpd.conf and extras/httpd-vhosts.conf are read only once when Apache starts.When your Web site is stable, you can stop experimenting with setting in .htaccess, moce the settings to httpd.conf, and remove all the .htaccess files. You then set AllowOverride to none to stop Apache looking for .htaccess files.
After the .htaccess files disappear and the override option is turned off, you can remove the following setting.
Order allow,deny
Deny from all
AddType application
Your .htaccess file might contain a line similar to the following. The example is adding PHP processing to files of type .html and .php. Specify this in httpd.conf, not .htaccess.AddType application/x-httpd-php .html .php
FilesMatch
The following FilesMatch is placed in .htaccess by the default installation of Drupal to limit access to some of the files installed by Drupal. Move the Drupal settings to your virtual server definition in extras/httpd-vhosts.conf.# Protect files and directories from prying eyes.
Order allow,deny
Options
The following lines are also from the default Drupal settings. The indexing option should already be turned off in httpd.conf so delete this option.# Don't show directory listings for URLs which map to a directory.
Options -Indexes
The following lines are from Drupal and set values that are the default in PHP 5. Make sure your PHP settings are correct and remove them from here.# PHP 5, Apache 1 and 2.
php_value register_globals 0
For an explanation of the individual PHP settings, read one of the articles I wrote back when PHP 4 was first released; explaining how to make PHP secure. Fortunately the PHP developers responded and the right defaults were put in place for PHP 4.2. There is now an explanation of the settings in PHP's php.ini-recommended.
Database
If you have your database on the same server as Apache, they will fight for the same memory and you will have to tune both sets of software in parallel to share the memory. If you have your database on a separate server, you have double the memory and Apache gets unrestricted use of all the memory on the Web server but your system may be limited by the speed of the network connection between the two servers. When you change your Web server settings, measure the load on both the Web server and the database.
Conclusion
You can make your Apache based Web server faster by cleaning up the Apache configuration files. You may not see the difference because most changes have little visible effect on a lightly loaded system. The changes do have an effect when your Web server is close to overloaded and you need an extra margin of processing power.








