From: maxious Date: Sun, 20 Mar 2011 10:20:25 +0000 Subject: Use AWS resources for debugging X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=38f8e837721cf85d851f86b047f7244184455021 --- Use AWS resources for debugging --- --- a/about.php +++ b/about.php @@ -4,9 +4,14 @@ ?>

Busness Time - An ACT bus timetable webapp
-Based on the maxious-canberra-transit-feed (download, last updated download, +last updated )
-Source code for the transit feed and this site @ http://maxious.lambdacomplex.org/git
+Source code for the transit +feed and this +site available from github.
Uses jQuery Mobile, PHP, Ruby, Python, Google Transit Feed Specification tools, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service

Feedback encouraged; contact maxious@lambdacomplex.org
--- a/aws/awsStartup.sh +++ b/aws/awsStartup.sh @@ -4,7 +4,6 @@ #screen php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 #http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 -cp -rfv /tmp/busui/* /var/www cp /root/aws.php /tmp/ chcon -h system_u:object_r:httpd_sys_content_t /var/www chcon -R -h root:object_r:httpd_sys_content_t /var/www/* @@ -14,7 +13,8 @@ -O /var/www/cbrfeed.zip easy_install transitfeed easy_install simplejson -screen -d -m /var/www/view.sh +screen -S viewsh -X quit +screen -S viewsh -d -m /var/www/view.sh wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ -O /tmp/Graph.obj --- /dev/null +++ b/aws/compress.conf @@ -1,1 +1,33 @@ +####################################################################### +## +## Output Compression +## -------------------- +## +## see http://www.lighttpd.net/documentation/compress.html +## +server.modules += ( "mod_compress" ) +## +## where should the compressed files be cached? +## see the base config for the declaration of the variable. +## +## This directory should be changed per vhost otherwise you can +## run into trouble with overlapping filenames +## +compress.cache-dir = cache_dir + "/compress" + +## +## FileTypes to compress. +## +#compress.filetype = ("text/plain", "text/html") +compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml") + +## +## Maximum filesize that will be compressed. +## Default is 0, which means unlimited file size. +## +#compress.max-filesize = 0 + +## +####################################################################### + --- /dev/null +++ b/aws/expire.conf @@ -1,1 +1,29 @@ +####################################################################### +## +## Expire Module +## --------------- +## +## See http://www.lighttpd.net/documentation/expire.html +## +server.modules += ( "mod_expire" ) +## +## assignes a expiration to all files below the specified path. The +## specification of the time is made up of: +## +## +## +#expire.url = ( +# "/buggy/" => "access 2 hours", +# "/images/" => "access plus 1 seconds 2 minutes" +#) +etag.use-mtime = "enable" +etag.use-inode = "disable" +static-file.etags = "enable" +$HTTP["url"] =~ "\.(css|js|png|jpg|ico|gif)$" { + expire.url = ( "" => "access 7 days" ) +} + +## +####################################################################### + --- a/aws/modules.conf +++ b/aws/modules.conf @@ -76,7 +76,7 @@ ## ## mod_compress ## -#include "conf.d/compress.conf" +include "conf.d/compress.conf" ## ## mod_userdir @@ -106,7 +106,7 @@ ## ## mod_expire ## -#include "conf.d/expire.conf" +include "conf.d/expire.conf" ## ## mod_secdownload --- a/aws/php.ini +++ b/aws/php.ini @@ -1,4 +1,6 @@ [PHP] + +date.timezone = "Australia/Sydney" ;;;;;;;;;;;;;;;;;;; ; About php.ini ; @@ -288,7 +290,7 @@ ; Note: You need to use zlib.output_handler instead of the standard ; output_handler, or otherwise the output will be corrupted. ; http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression -zlib.output_compression = Off +zlib.output_compression = on ; http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression-level ;zlib.output_compression_level = -1 @@ -1264,7 +1266,7 @@ ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ; http://www.php.net/manual/en/session.configuration.php#ini.session.save-path -session.save_path = "/var/lib/php/session" +session.save_path = "/tmp" ; Whether to use cookies. ; http://www.php.net/manual/en/session.configuration.php#ini.session.use-cookies --- a/common-geo.inc.php +++ b/common-geo.inc.php @@ -51,7 +51,7 @@ if ($collapsible) $output.= ''; return $output; } -function distance($lat1, $lng1, $lat2, $lng2) +function distance($lat1, $lng1, $lat2, $lng2, $roundLargeValues = false) { $pi80 = M_PI / 180; $lat1*= $pi80; @@ -64,7 +64,10 @@ $a = sin($dlat / 2) * sin($dlat / 2) + cos($lat1) * cos($lat2) * sin($dlng / 2) * sin($dlng / 2); $c = 2 * atan2(sqrt($a) , sqrt(1 - $a)); $km = $r * $c; - return $km * 1000; + if ($roundLargeValues) { + if ($km < 1) return floor($km * 1000); + else return round($km,2)."k"; + } else return floor($km * 1000); } function decodePolylineToArray($encoded) { --- a/common-template.inc.php +++ b/common-template.inc.php @@ -1,28 +1,53 @@ - - - ' . $pageTitle . ''; + + + + ' . $pageTitle . ' + '; + if ($datepicker) echo ''; if (isDebugServer()) echo ' '; - else echo ' - - '; - echo ' - - + '; + if ($datepicker) echo ' - - - - + #jqm-homeheader { + text-align: center; + } + .viaPoints { + display: none; + text-size: 0.2em; + } + .min-width-480px .viaPoints { + display: block; + } + // source http://webaim.org/techniques/skipnav/ + #skip a, #skip a:hover, #skip a:visited +{ +position:absolute; +left:0px; +top:-500px; +width:1px; +height:1px; +overflow:hidden; +} + +#skip a:active, #skip a:focus +{ +position:static; +width:auto; +height:auto; +} +'; + if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) { + echo ' '; + } if ($geolocate) { echo " "; } - echo ' + echo ' + +

'; - if (isMetricsOn()) { - require_once ('owa/owa_env.php'); - require_once (OWA_DIR . 'owa_php.php'); - $owa = new owa_php(); - global $owaSiteID; - $owa->setSiteId($owaSiteID); - $owa->setPageTitle($pageTitle); - $owa->setPageType($pageType); - $owa->trackPageView(); - $owa->placeHelperPageTags(); - } if ($opendiv) { echo '