forked from mathiasbynens/jsperf.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README.md, index.php: support Lighttpd
- Loading branch information
Showing
3 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
# jsPerf.com source code | ||
|
||
[jsPerf.com](http://jsperf.com/) runs on a Linux server with Apache, MySQL(i) and PHP installed. | ||
[jsPerf.com](http://jsperf.com/) runs on a server with Apache or Lighttpd, | ||
MySQL and PHP installed. | ||
|
||
## How to run a local copy of jsPerf for testing/debugging | ||
|
||
1. Download the source code, as located within this repository. | ||
2. The code expects things to be hosted at `/` and not a subdirectory. You might want to create a new virtual host, e.g. `dev.jsperf.com`. | ||
2. The code expects things to be hosted at `/` and not a subdirectory. You | ||
might want to create a new virtual host, e.g. `dev.jsperf.com`. | ||
3. Use `database.sql` to create the jsPerf tables in a database of choice. | ||
4. Rename `_inc/config.sample.php` to `config.php` and enter your database credentials and other info. | ||
5. Edit `.htaccess` (especially the first few lines) so it matches your current setup. | ||
4. Rename `_inc/config.sample.php` to `config.php` and enter your database | ||
credentials and other info. | ||
5. If you are using Apache, edit `.htaccess` (especially the first few lines) | ||
so it matches your current setup. If you are using Lighttpd, set up the | ||
`dev.jsperf.com` virtual host using the sample in `_inc/lighttpd.conf`. | ||
|
||
## License | ||
|
||
The source code for [jsPerf](http://jsperf.com/) is copyright © [Mathias Bynens](http://mathiasbynens.be/) and dual-licensed under the MIT and GPL licenses. | ||
The source code for [jsPerf](http://jsperf.com/) is copyright | ||
© [Mathias Bynens](http://mathiasbynens.be/) and dual-licensed under the MIT | ||
and GPL licenses. | ||
|
||
You don’t have to do anything special to choose one license or the other and you don’t have to notify anyone which license you are using. You are free to re-use parts of this code in commercial projects as long as the copyright header (as mentioned in `GPL-LICENSE.txt` and `MIT-LICENSE.txt`) is left intact. | ||
You don’t have to do anything special to choose one license or the other and | ||
you don’t have to notify anyone which license you are using. You are free to | ||
re-use parts of this code in commercial projects as long as the copyright | ||
header (as mentioned in `GPL-LICENSE.txt` and `MIT-LICENSE.txt`) is left | ||
intact. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
$HTTP["host"] == "dev.jsperf.com" { | ||
# Change this to match your location. | ||
server.document-root = "/var/www/dev.jsperf.com" | ||
server.error-handler-404 = "/404" | ||
|
||
# Set up PHP-CGI with FastCGI. | ||
fastcgi.server = ( | ||
".php" => (( | ||
# Change this to point to your php-cgi binary. | ||
"bin-path" => "/opt/local/bin/php-cgi", | ||
"socket" => "/tmp/php-fcgi.socket", | ||
"min-procs" => 1, | ||
"max-procs" => 4, | ||
"idle-timeout" => 20, | ||
"bin-environment" => ( | ||
"PHP_FCGI_CHILDREN" => "3", | ||
"PHP_FCGI_MAX_REQUESTS" => "1000" | ||
), | ||
"bin-copy-environment" => ( | ||
"PATH", "SHELL", "USER" | ||
), | ||
"broken-scriptfilename" => "enable" | ||
)) | ||
) | ||
|
||
# Make sure we are using one of the known hostnames. | ||
$HTTP["host"] !~ "^(a\.|dev\.)?jsperf\.com\.?$" { | ||
url.redirect += ( | ||
"^/(.*)" => "http://jsperf.com.kak/$1" | ||
) | ||
} | ||
|
||
url.rewrite-if-not-file += ( | ||
# Enable versioned CSS and JS resources. | ||
"^(.*).css$" => "_css/main.css", | ||
"^(.*)(-[0-9]+)?.js$" => "_js/$1.js", | ||
|
||
# Enable pretty URLs. | ||
"^/browse/([a-z0-9-]+).atom/?$" => "index.php?slug=browseAuthor&author=$1&atom=true", | ||
"^/browse/([a-z0-9-]+)/?$" => "index.php?slug=browseAuthor&author=$1", | ||
"^/(edit|delete)-comment/([0-9]+)/?$" => "index.php?slug=$1Comment&id=$2", | ||
"^/([a-z0-9-]+)/([0-9]+)/(edit|delete|publish|embed|dev)/?$" => "index.php?slug=$1&rev=$2&action=$3", | ||
"^/([a-z0-9-]+)/([0-9]+).atom/?$" => "index.php?slug=$1&rev=$2&atom=true", | ||
"^/([a-z0-9-]+)/([0-9]+)/?$" => "index.php?slug=$1&rev=$2", | ||
"^/([a-z0-9-]+)/(edit|delete|publish|embed|dev)/?$" => "index.php?slug=$1&action=$2", | ||
"^/([a-z0-9-]+).xml" => "index.php?slug=$1.xml", | ||
"^/([a-z0-9-]+).atom" => "index.php?slug=$1&atom=true", | ||
"^/([a-z0-9-]+)?" => "index.php?slug=$1", | ||
"^/api/(jsonp)$" => "_api/$1.php", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters