22 Oct 2008
More Apache Hassles
I want to include the vertical menus on my webside by server side includes -
using the <!-- #include --> directive - this however took me a little while to cope with.
Firstly there are two forms -
<!--#include file="somefile.html" -->
<!--#include virtual="someotherfile.html"-->
/Users/someuser/Sites
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Library/WebServer/Documents"
and replace with the path to your sites folder, mine is "/Users/someuser/Sites"
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Library/WebServer/Documents">
And change there as well, e.g.
<Directory "/Users/someuser/Sites">
11 Oct 2008
TRUE and FALSE, YES and NO
I have always had trouble remembering which way the boolean values map in C (1 = TRUE, 0 = FALSE )
Although TRUE and FALSE are not actually defined unless you do a type_def
Of course it is worth remembering that C treat evaluation of any non-zero result as true.
So if ( 100 ) do something; // will mean always do it. and...
if (! 100) do something; // will mean never do it.
So ok fair enough, but then in objective C we do have a BOOL type with YES and NO as values
but how exactly do the two interrelate and can you assume YES is the same as TRUE?
Another few hours struggling to find an issue with displaying CSS on Apache2
The blog pages currently use two cascading style sheets - and some of the styles were rendering
properly and others not. PearsonMain.css was not rendering but OMWB.css was rendering. After hours of
trying to find in something that was wrong with the PearsonMain.css file I had a look int he Apache2 log file
In Mac OS 10.5 (at least for me) this meant going into terminal using the cd command to get to var/log/apache2
and then using the tail command - tail access_log to see the apache access log.
I got the following.....
192.168.1.69 - - [11/Oct/2008:18:22:48 +0100] "GET /~tim/Car/Car-OMWB.shtml HTTP/1.1" 200 1191
192.168.1.69 - - [11/Oct/2008:18:22:48 +0100] "GET /~tim/images/achnag_from_the_air.jpg HTTP/1.1" 200 6527
192.168.1.69 - - [11/Oct/2008:18:22:48 +0100] "GET /~tim/OMWB.css HTTP/1.1" 200 398
192.168.1.69 - - [11/Oct/2008:18:22:48 +0100] "GET /~tim/PearsonMain.css HTTP/1.1" 403 222
192.168.1.69 - - [11/Oct/2008:18:22:48 +0100] "GET /favicon.ico HTTP/1.1" 404 209
Tims-iMac:Sites tim$ chmod a+rwx PearsonMain.css
Tims-iMac:Sites tim$ ls -l
total 136
drwxr-xr-x 11 tim staff 374 11 Oct 18:15 Car
drwxr-xr-x 8 tim staff 272 11 Oct 10:48 Computing
-rw-r--r--@ 1 tim staff 398 11 Oct 18:08 OMWB.css
-rwxr-----@ 1 tim staff 1837 11 Oct 13:11 PearsonMain copy.css
-rwxrwxrwx@ 1 tim staff 1440 11 Oct 18:05 PearsonMain.css
-rw-r--r--@ 1 tim staff 1440 11 Oct 18:09 PearsonMain2.css
-rwxrwxrwx@ 1 tim staff 1466 5 Sep 18:59 family.css
-rwxrwxrwx 1 tim staff 1118 27 Apr 12:46 family_handheld.css
drwxrwxrwx 20 tim staff 680 8 Oct 10:08 images
-rwxrwxrwx@ 1 tim staff 2104 10 Oct 19:35 index.shtml
Tims-iMac:Sites tim$ <br />
Tims-iMac:apache2 tim$ tail access_log
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/Car/Car-OMWB.shtml HTTP/1.1" 200 1191
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/OMWB.css HTTP/1.1" 200 398
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/images/achnag_from_the_air.jpg HTTP/1.1" 200 6527
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/PearsonMain.css HTTP/1.1" 200 1440
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /favicon.ico HTTP/1.1" 404 209
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/images/header_fill_pic.jpg HTTP/1.1" 200 990
192.168.1.69 - - [11/Oct/2008:18:52:54 +0100] "GET /~tim/images/PFW_Title_Bar.jpg HTTP/1.1" 200 9843
Tims-iMac:apache2 tim$ <br />
Tims-iMac:Sites tim$ chmod o+r PearsonMain.css
10 Oct 2008
How to change the organization name in the objective C development environment
From Terminal
defaults write com.apple.xcode PBXCustomTemplateMacroDefinitions'{ ORGANIZATIONNAME = "Tim Pearson"; }'
9 Oct 2008
Relatively little done today, I have tidied up some of the code, and I have made some alterations
to allow the output to be put in the right locations - so that it links to the main site home page.
This generated me a new problem, in that it was the first time I had run the blog output under apache.
(as opposed to just opening the file from the computer - see yesterday's post if this doesn't make sense)
Running under apache2 browsing from safari gave me a problem that only one of the two style sheets
loaded by the header to each page - seemed to be having any effect - so the pages are rendering
poorly.
You can see the difference looking at the same test pages below - they are exaclty the same bit of
html/css, not even copies the same files in the same place - it's just one is being served by apache
and one is being opened directly from the file system.
Here is it loaded with Apache -
And here it is loaded as a straight file form the browser -
argh
Other things to do -
1/ Multiple Blogs - the code is really designed only to do one blog at a time at the moment, as I eventually
want it to do all the blogs then I think I should fix this soon.
2/ jpgs/pngs/gifs etc. - it doesn't move them around or put the links in for them at all yet
3/ filling up the navigation bar
4/ testing it on an online system
8 Oct 2008
Four hours for one configuration line!!
Is it really worth this part of my life - probably not.
OK, so more blah here