PHP may suck, but Drupal is awesome

PHP gets a lot of well-deserved flak for its relatively poor language design, but Jeff Atwood makes a good observation:

The only conclusion I can draw is that building a compelling application is far more important than choice of language. While PHP wouldn’t be my choice, and if pressed, I might argue that it should never be the choice for any rational human being sitting in front of a computer, I can’t argue with the results.

http://www.codinghorror.com/blog/2008/05/php-sucks-but-it-doesnt-matter.html

While PHP may be a poor choice for new applications, there are some amazing applications written in PHP. Namely, the Drupal CMS/Framework is an excellent example of a mature application written in PHP. If Drupal, or a Drupal clone were to be written in another language, I would switch in a heartbeat. Don’t get me wrong, there are CMS applications for Python and Ruby, but they require a great deal of development just to get the basic features that Drupal has now. 

Umbraco (.NET, mostly C#) is another semi-mature CMS. It’s not as full-featured as Drupal, but its XML-driven content system is promising. 

Python and Ruby developers: If you build it, they will come.

Need to add your new tab to your Facebook page?

Visit this URL:

https://www.facebook.com/dialog/pagetab?app_id=(your app id)&next=http://apps.facebook.com/(your app url)/

Font Icons Provided By: Font Awesome

This blog makes use of font icons. This set was provided by:

http://fortawesome.github.com/Font-Awesome/

Firefox 3.5 doesn’t allow @font-face to reference a font that is hosted on a remote server, although Safari does. Firefox simply doesn’t show the font and uses the next font in the font stack. In order to use @font-face on a blog like Tumblr, the .htaccess file on your server that hosts the font file needs to be edited to allow the blog to use the font.

Edit your server .htaccess file. Add the following to limit the use of your font files to only your Tumblr blogs:

<FilesMatch "\.(eot|ttf|otf)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin: http://yourblog.tumblr.com
Header set Access-Control-Allow-Origin: http://yourblog2.tumblr.com
</IfModule>
</FilesMatch>

Install Varnish on CentOS with Plesk 10

This tutorial is for these software packages:

  • CentOS
  • Plesk 10
  • Apache
  • Varnish 3
  • Drupal

Install Varnish

rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm
yum install varnish

Set Varnish Configuration

vim /etc/varnish/new.vcl
backend default {
.host = "x.x.x.x"; #your server's IP
.port = "8080";
.connect_timeout = 60s;
.first_byte_timeout = 10s;
.between_bytes_timeout = 10s;
}

I used the config options in this repo for the rest of new.vcl: https://github.com/halcyonCorsair/varnish-for-drupal

Point Varnish At Your Config File

vim /etc/sysconfig/varnish
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/new.vcl \
-u varnish -g varnish \
-S /etc/varnish/secret \
-s file,/var/lib/varnish/varnish_storage.bin,1G"

Point Apache At A Non-Standard Port

vim /etc/httpd/conf/httpd.conf
Change the Listen directive to:
Listen: 8080

Tell Plesk To Use Your Non-Standard Port For VHosts

Log into mysql.

use psa;
//plesk database
replace into misc (param, val) values ("http_port", 8080);

(http://kb.parallels.com/11232)

Flush Plesk VHosts Config

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Restart Apache and Varnish

service httpd restart
service varnish restart