Deny access to .svn directories with lighttpd
$HTTP["url"] =~ "/\.svn/" { url.access-deny = ( "" ) }
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
$HTTP["url"] =~ "/\.svn/" { url.access-deny = ( "" ) }
install darwinports package Add 'export PATH=/opt/local/bin:$PATH' to ~/.bashrc sudo port -d selfupdate sudo port install ruby sudo port install rb-rubygems sudo gem install rails --include-dependencies sudo port install readline sudo port install lighttpd vi /opt/local/etc/lighttpd.conf [edit lighttpd.conf to your liking] set up launchd item for lighttpd -- restart lighttpd: sudo launchctl stop net.lighttpd sudo launchctl start net.lighttpd sudo port install fcgi sudo port install rb-fcgi install official OS X MySQL package (not darwinports) sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
$HTTP["host"] =~ "textdrive.(org|com)" { server.indexfiles = ( "dispatch.fcgi", "index.php" ) server.document-root = "/users/home/website/web/public/" url.redirect = ( "^/forum/(.*)" => "http://forum.textdrive.com/$1", "^/support/(.*)" => "http://support.textdrive.com/$1" ) #url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" ) server.error-handler-404 = "/dispatch.fcgi" fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/tmp/textdrive-new.socket", "bin-path" => "/users/home/website/web/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "production" ) ) ), ".php" => ( "localhost" => ( "socket" => "/tmp/textdrive-php5-fcgi.socket", "bin-path" => "/usr/local/www/cgi-bin/php5-fcgi", "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "5000" ) ) ) ) }
#### SSL engine $SERVER["socket"] == "207.7.108.166:443" { ssl.engine = "enable" ssl.pemfile = "/usr/local/openssl/certs/wildcard.textdrive.com.pem" }
fastcgi.server = ( ".fcgi" => ( "localhost" => ( "socket" => "/tmp/textdrive-new.socket", "bin-path" => "/users/home/website/web/public/dispatch.fcgi", "bin-environment" => ( "RAILS_ENV" => "production" ) ) ), ".php" => ( "localhost" => ( "socket" => "/tmp/textdrive-php5-fcgi.socket", "bin-path" => "/usr/local/www/cgi-bin/php5-fcgi", "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "5000" ) ) ) )
#!/bin/sh # Author: Nathaniel Brown # Date: December 16, 2005 # URL: http://nshb.net/lighttpd-restart-script.html # Version: 1.0 # License: MIT #Binary Paths CAT="/bin/cat" PS="/bin/ps" HTTPD="/usr/local/sbin/lighttpd" # Modifiy this line for each install PATH="/home/httpd/vhosts/domain.com/lighttpd/" LIGHTTPD_CONF=$PATH"lighttpd.conf" PIDFILE=$PATH"var/run/lighttpd.pid" PID=0 if [ -e $PIDFILE ]; then PID=`$CAT $PIDFILE` if [ "x" == "x$PID" ]; then PID=0 fi fi case "$1" in start) if [ 0 -ne $PID ]; then running=`$PS --pid $PID | grep $PID` if [ $running ]; then echo "lighttpd is already running" exit 1 fi rm $PIDFILE PID=0 fi $HTTPD -f $LIGHTTPD_CONF ;; stop) if [ 0 -eq $PID ]; then echo "lighttpd was not running" exit 1 fi kill $PID tries="" while [ -e $PIDFILE ]; do if [ "x$tries" == "x.........." ]; then break fi sleep 2 tries=".$tries" done if [ -e $PIDFILE ]; then echo "lighttpd did not go gentle into that good night, murdering" kill -9 $PID rm $PIDFILE fi ;; restart) $0 stop $0 start ;; reload) if [ 0 -eq $PID ]; then echo "lighttpd was not running" fi kill -HUP $PID ;; status) if [ 0 -eq $PID ]; then echo "lighttpd is not running" fi if [ 0 -ne $PID ]; then echo "lighttpd (pid $PID) is running..." fi ;; *) echo "Usage: "`basename $0`" (start|stop|restart|reload|status)" exit 1 ;; esac
#!/bin/sh USERNAME=username LIGHTTPD_CONF=/home/$USERNAME/service/lighttpd.conf PIDFILE=/home/$USERNAME/service/logs/lighttpd.pid HTTPD=/home/$USERNAME/lighttpd/sbin/lighttpd PID=0 if [ -e $PIDFILE ]; then PID=`cat $PIDFILE` if [ "x" == "x$PID" ]; then PID=0 fi fi case "$1" in start) if [ 0 -ne $PID ]; then running=`ps --pid $PID | grep $PID` if [ $running ]; then echo "lighttpd is already running" exit 1 fi rm $PIDFILE PID=0 fi $HTTPD -f $LIGHTTPD_CONF ;; stop) if [ 0 -eq $PID ]; then echo "lighttpd was not running" exit 1 fi kill $PID tries="" while [ -e $PIDFILE ]; do if [ "x$tries" == "x.........." ]; then break fi sleep 2 tries=".$tries" done if [ -e $PIDFILE ]; then echo "lighttpd did not go gentle into that good night, murdering" kill -9 $PID rm $PIDFILE fi ;; restart) $0 stop $0 start ;; reload) if [ 0 -eq $PID ]; then echo "lighttpd was not running" fi kill -HUP $PID ;; *) echo "Usage: "`basename $0`" (start|stop|restart|reload)" exit 1 ;; esac
"^(/[^media]/.*)$" => "/main.fcgi$1"
"^(/[^media].*)$" => "/main.fcgi$1"
#!/bin/sh LIGHTTPD_CONF=/home/USERNAME/etc/lighttpd.conf PIDFILE=/home/USERNAME/var/run/lighttpd.pid case "$1" in start) # Starts the lighttpd deamon echo "Starting Lighttpd" /usr/local/sbin/lighttpd -f $LIGHTTPD_CONF ;; stop) # stops the daemon bt cat'ing the pidfile echo "Stopping Lighttpd" kill -9 `cat $PIDFILE` # kills the dispatch.fcgis ps axww | grep dispatch | egrep -v 'grep' | awk '{ print $1 }' | xargs kill -9 ;; restart) ## Stop the service regardless of whether it was ## running or not, start it again. echo "Restarting Lighttpd" $0 stop $0 start ;; reload) # reloads the config file by sending HUP echo "Reloading config" kill -HUP `cat $PIDFILE` ;; *) echo "Usage: lighttpdctl (start|stop|restart|reload)" exit 1 ;; esac