Apache / Server Tutorials

  • Create a Virtual Host in OSX

    As someone who had always developed on PCs, switching over to using Mac OS X was like going from peasant to prince.  Compared to Windows-based machines, Mac's OS X operating system is lightyears better.  One OS X feature I make much use of is the integrated Apache server.  Hosting websites on my local machine during development is a must.  Let me show you how to create multiple websites on your local machine.

  • Simple Apache Proxying

    I was recently working with Apache and a service running on Kris Zyp's Persevere project (which is beyond awesome).  Persevere was pushing messages to my application which was running on Apache; the problem was that Persevere and Apache were running on different ports which technically made them cross-domain.  In order to make the server believe the web service was on the same domain/port, I needed to use Apache proxying.  I opened the conf/httpd.conf file and added the following magic to make that possible:

  • Fix WordPress CRONs on Media Temple (dv) Servers

    When I switched from Dreamhost shared hosting to Media Temple (dv) server hosting, I had a hell of a time trying to figure out why CRONs weren't working correctly on the website. I had database backups being sent via CRON jobs so making sure CRONs were working was imperative. What's great is that the way to make these Wordpress CRONs work was by...setting up a CRON.

  • Fixing mod_rewrite and .htaccess on GoDaddy Hosting

    I recently launched a new website on GoDaddy shared hosting. The website required mod_rewrite for SEO-friendly URLs. GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error. Here's what I had:

  • Use FURL to Retrieve Website Headers

    It's important to know what headers your website and its files are communicating. For example, if your website is providing a 404 status, you're probably streaking toward your computer to fix the problem. Using the FURL library, you may retrieve website headers from the command line.

  • XAMPP Lite, Windows Vista, and php5apache2_2.dll

    I recently ran into a nightmare when needing to use my father's laptop for development.  My XAMMP Lite USB install, which worked perfectly on my Windows XP desktop, was giving the following error when trying to start Apache:

  • Set php.ini Values Using .htaccess

    Did you know that you can set php.ini values right inside the .htaccess file? It's actually very easy.

  • Increase PHP’s File Upload Limit Using php.ini

    The file upload size limit is usually set pretty low by shared hosting providers. Why? To save bandwidth, keep the server moving quickly, and think about it — how many customers really need a large upload limit? If you do need to increase the maximum upload limit, all you need to do is place the following code snippet in your php.ini file:

  • Advanced .htaccess Security – Allow or Block Specific IPs From Your Website

    The more I use the .htaccess file the more I appreciate its value. My next valuable lesson in .htaccess security deals with allowing and blocking access to a web server from a specific IP address. Reasons for doing this include:

  • Advanced .htaccess Security – Block Unwanted Referrers

    For some bloggers and web developers, Digg can be a huge boost in traffic and thus a huge bust in ad revenue. Unfortunately, the Digg Effect can kill a website's bandwidth and get the website shut down. Wouldn't it be great if a weary web developer could prevent his site from being shut down by blocking users referred by Digg, at least a while? Using a small bit of .htaccess code and mod_rewrite, the developer can do just that.