lighttpd and PHP on CentOS 5

Here’s a quick run down on getting lighttpd and php running on CentOS 5.

yum install lighttpd lighttpd-fastcgi php
mkdir /var/run/lighttpd
touch /var/run/lighttpd/php-fastcgi.socket
chown -R lighttpd:lighttpd /var/run/lighttpd/
vim /etc/php.ini

Add in php.ini the following; cgi.fix_pathinfo = 1. Save and close the file.

Now open up /etc/lighttpd/lighttpd.conf. Uncomment the following line "mod_fastcgi", from the server.modules option. Then ensure that the following is uncommented:

fastcgi.server  = ( ".php" =>
    ( "localhost" =>
        (
            "socket" => "/var/run/lighttpd/php-fastcgi.socket",
            "bin-path" => "/usr/bin/php-cgi"
        )
    )
)

Save the file. Now create a test file, /srv/www/lighttpd/index.php and just include <?php phpinfo(); ?>. Now open your favourite browser and visit http://localhost/index.php. You should be greeted with a friendly PHP page, and you’re set to go.

2008-06-22 [, , , ] 6 Comments

Remove Floppy Icon from Gnome

Floppy drive. Who uses them anymore? I haven’t in about 5 years at least, and I certainly don’t want it making my Gnome environment looking messy. To make the icon disappear from the Places etc, simply comment out the /dev/fd0 line in your fstab file:

sudo gvim /etc/fstab
/fd0
I
#
<esc>
:wq

That should do it. Check out Nautilus.

For those interested about the vim commands I used in this post, read here.

2008-02-29 [, , ] No Comments

GDM Login Screen Resolution Too Big

If you’ve noticed that the login screen for Ubuntu Gutsy (GDM) is too big, and that you can use the mouse to move the screen around, you’ll need to update your xorg.conf file.

sudo gvim /etc/X11/xorg.conf

When gVim opens, type in the following:

/Virtual

Then hit enter. That’ll search the file for the line that we need to comment out. When it’s found, hit i on the keyboard to enter the Insert mode of gVim. Now prepend a # before the Virtual keyword to comment out the entire line.

Hit escape on the keyboard, then type in :wq to save and quit.

Next time you have the login screen in front of you, it should be using the correct screen resolution.

2008-02-26 [, , , , , , ] No Comments

Convert a Binary Property List to XML

Since Mac OS X Tiger 10.4, preference files for applications have been stored as binary property lists. This really reduces the file size for preferences, and makes application access a lot faster. However, if you ever want to read the file as XML, you’ll need to convert it.

plutil -convert xml1 path/to/preferences.plist

Now open the file and it’ll be in beautiful, human readable, XML.

2008-02-16 [, , , , , ] 1 Comment

DVB and Mplayer

As a follow up to yesterday’s post, here is a quick run through of how to use Mplayer to view DVB channels.

Basically, you just need to generate a channels.conf file (see this article) and place it inside ~/.mplayer/. Then run mplayer dvb:// in a terminal window. You’ll get a video window appear, and the first channel within your channels.conf file will start playing. To switch up and down between channels, you can press h and k. There’s a bunch of other helpful keyboard commands though not all of them will work with DVB.

While using Mplayer this way isn’t very user friendly, it may be helpful for some.

2008-02-09 [, , , , ] 2 Comments

Watching Freeview (DVB-T) TV with VLC Player on Ubuntu

Watching TV on my desktop. What do I want to be able to do?

  • Watch all Freeview (DVB-T) channels.
  • Be able to pause, rewind, and forward to live TV.
  • Schedule programs to record.
  • See the TV listings for the channels I have.
  • Fullscreen or windowed viewing.

I was able to do all of the above using EyeTV on my Mac. However, I’m trying to make the complete switch to Ubuntu, and an open-source alternative is needed.

(more…)

2008-02-08 [, , , , ] 29 Comments

mod_rewrite and Mac OS X Personal Web Sharing

It was very frustrating installing a fresh WordPress on my Mac and finding that the permalinks didn’t work. Turns out the default Apache settings for personal web sharing on OS X disable .htaccess overriding.

sudo mate /etc/httpd/users/yourusername.conf

Now you’ll want to enable Apache to follow symbolic links:

Options Indexes MultiViews FollowSymLinks

And to allow .htaccess overriding:

AllowOverride All

The file should then look like:

<Directory "/Users/yourusername/Sites/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Now in System Preferences, stop and start ‘Personal Web Sharing’. Things should work perfectly now.

2007-05-20 [, , , ] 8 Comments