/dev/trouble
Eric Roller's Development Blog

For a while now, I have been puzzled by the fact that Mobile Safari, the iOS version of Safari, opened any page on my web site at a much larger width than the CSS value for the main content area (570px).

It turns out, there are a number of Apple-Specific Meta Tags that can be used to provide background information for your web page, like how to scale it, or providing scaling limits.

To set the initial scaling of a window when presented on the iPhone or iPad, there is the viewport meta tag. If missing, a default width of 960 pixels will be used, or more if the web content is wider. Setting it to 590 pixels, thus adding a 10 pixel padding, works just fine for my particular case:

<meta name="viewport" content="width:590px">

phpMyAdmin

- Posted in General by

I see from my web-server log that people like to guess the path to phpMyAdmin in all different variations, colours, shapes and sizes. Now, this is exactly why I have not installed it in a fashion that makes it visible to anyone other than me. Better yet, come to think of it, I have not installed it at all and I don't think I ever will. But if I do, you should probably search for all variations, colours, shapes and sizes of phpMyNeatlyStashedAwayAndHiddenInstallationOfMyAdmin.

Google Search Tips

- Posted in General by

Added this blog post to get that piece of scrap paper off my desk and also to remember these tips by means of typing them in.

apples oranges Search for pages with both apples and oranges.

apples OR oranges -worms Either or, not others.

"candied apples" Exact phrase.

+fruit filetype:ppt Only the exact word, in PowerPoint presentations.

~fruit site:meals.com Include synonyms, but only on that site.

define:egoism Search after definitions.

BMW 318...328 Search for ranges, e.g. not the bad 316 model.

link:macworld.com Search after sites linking to macworld.com.

info:www.apple.com/se Show information about apple.se.

related:cdon.com Search for similar sites.

**mac*** All words beginning with mac, e.g. macworld, macintosh.

ARN BSL Search for routes between airports.

Harry Potter For books with harry potter, select the book icon.

stocks:AAPL Stock information.

weather Stockholm Search for weather information.

time Cupertino Get the current time for other places.

sunrise Kuusamo Get the sunrise times, try also "sunset".

5*9+(sqrt 10)^3= Evaluate calculations.

10.5 cm in inches Unit conversions.

66 GBP in EUR Currency conversions.

**Shakespeare wrote *** Let Google fill in the blanks.

P.S. Of course, Google has its own help page on this topic.

Let's first take a look at how Apache is configured (for Mac OS X 10.5.6 Leopard). In the Terminal:

> httpd -V
Server version: Apache/2.2.9 (Unix)
Server built:   Sep 19 2008 10:58:54
Server's Module Magic Number: 20051115:15
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

Notice where the configuration file is (see last line); this is the file we would use if we enabled the web server from the System Preferences : Sharing : Web Sharing. However, we much rather not change that configuration file; instead we shall simply supply a different one that we keep outside the /private/etc area.

[more]

Before we go ahead with our personal configuration file, it is a good idea to compare our settings to those provided by Apple; use a "diff" tool of your choice (I like twdiff that comes with BareBones' TextWrangler). Once our settings are complete, we shall begin with a syntax check:

> apachectl -f /path/to/conf/httpd-debug.conf -t
Syntax OK

To launch Apache with our own configuration, we run:

> sudo apachectl -f /path/to/conf/httpd-debug.conf -k start

To verify that it is running, we can issue this command (when o.k. we will get multiple lines for multiple httpd instances):

> ps -e | grep httpd | grep usr

Finally, to view the web site in Safari, we simply open the location: http://localhost/ .