Apache / Server Archives
Published by David Walsh on Thursday, November 12, 2009 •
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.
To get things working, you should:
- Log into your Media Temple (dv) control panel.
- Navigate to the domain and click the “Crontab” icon.
- Click “Schedule a Task”
Published by David Walsh on Thursday, November 5, 2009 •
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:
# Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]The fix to this problem was to add the following directive before my mod_rewrite directives:
#Fix Rewrite
Options -Multiviews
Tada! The URLs began working and the website’s SEO has taken off!
Published by David Walsh on Friday, June 26, 2009 •
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.
The Shell Script
furl http://davidwalsh.name
Simple and quick — just like every shell directive.
The Sample Response
HTTP/1.1 200 OK
Date: Thu, 25 Jun 2009 01:50:50 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.6
X-Pingback: http://davidwalsh.name/xmlrpc.php
Cache-Control: max-age=1, private, must-revalidate
Expires: Thu, 25 Jun 2009 01:50:51 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8
Don’t have FURL? Install it by scripting this:
Published by David Walsh on Friday, May 22, 2009 •
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:
apache.exe: Syntax error on line 477 of E:/xampplite/apache/conf/httpd.conf:
Syntax error on line 7 of E:/xampplite/apache/conf/extra/httpd-xampp.conf:
Cannot load E:/xampplite/apache/bin/php5apache2_2.dll into server: The specified module
could not be found.
After 20 minutes of frustration, I finally found the golden solution. I needed to download and place msvcr71.dll in my \xampplite\apache\bin folder. Apparently it’s a Microsoft runtime file that Vista doesn’t have. Disaster averted!
Published by David Walsh on Tuesday, November 4, 2008 •
Did you know that you can set php.ini values right inside the .htaccess file? It’s actually very easy.
The .htaccess Code
#format
php_value setting_name setting_value
#example
php_value upload_max_filesize 10M
Of course you could simply place these in the .htaccess file, but .htaccess is a viable alternative if your host doesn’t allow you to touch the php.ini file.