Add this to the bottom of your lighttpd.conf file:
$HTTP["url"] =~ "/\.(git|svn)/" {
url.access-deny = ( "" )
}
Add this to the bottom of your lighttpd.conf file:
$HTTP["url"] =~ "/\.(git|svn)/" {
url.access-deny = ( "" )
}
Install lighttpd:
sudo aptitude install lighttpd
Install PHP and ImageMagick:
sudo aptitude install php5-common php5-dev php5-mysql php5-sqlite php5-cgi php5-curl php5-gd php-pear libmagick9-dev
Install iMagick:
sudo pecl install imagick
Press enter on prompt.
Add the following to the bottom of /etc/php5/cgi/php.ini:
extension=imagick.so
Then:
sudo lighttpd-enable-mod fastcgi
sudo /etc/init.d/lighttpd reload
You will probably want to ensure that curl supports https before getting underway:
curl -V
Check that the output contains https:
>: curl -V
curl 7.19.2 (i386-apple-darwin9.5.0) libcurl/7.19.2 OpenSSL/0.9.8i zlib/1.2.3
Protocols: tftp ftp telnet dict http file https ftps
Features: Largefile NTLM SSL libz
If it doesn’t:
sudo port deactivate curl
sudo port install curl +ssl
Once you have curl with https support:
sudo pecl install pecl_http
If you followed my previous howto, you’ll want to move the module to the location specified in your php.ini file:
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20060613/http.so /opt/local/lib/php/extensions
Restart lighttpd and then you’ll be good to go.
It’s a little tricky getting a nice clean install of PHP5 for OS X 10.5. The packages that I always used to depend on over at Entropy don’t seem to work anymore. At least not for Leopard. A great shame.
I’m now switching to lighttpd for my development server, so have come up with the following recipe to install PHP5 and the great Imagick extension for image manipulation.
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.