Past papers CSN09101: Word (answers)

General chat concerning linux or linuxzoo.

Moderator: drgrussell

Post Reply
dvb
Posts: 1
Joined: Sun Nov 07, 2010 11:56 am
Are you a robot or a human?: Human

Past papers CSN09101: Word (answers)

Post by dvb » Sun Nov 07, 2010 12:07 pm

Hi Gordon,

I went through the Past papers CSN09101 questions and tried to get proper answers from the answers documents after.
However I`m not sure whether all the answers are correct.
For example

question 1:
umask 226 the answer is 551 but according to the slides it should be 440

question 4: # ls –ld b drwxr-xr-x 3 root root 16 Oct 24 13:53 b the answer is The directory is “b” and the size cannot be detected from this information however the size is 16 bytes.

quetions 13: Supply mod_rewrite instructions for the above virtual host entry such that a request for web.tester.com or test.com will be redirected externally and permanently to http://www.test.com. You may use RewriteCond only once.

the answer is 13. RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.\.test\.com
RewriteRule ^(.*) http://www.test.com$1 [L,R=permanent]

but does the answer cover also web.tester.com address?

question 14 Is it from Apache 2 we didnt cover yet ?

question 15 An apache configuration file currently has no mod_rewrite commands. If the following is added to a virtual host area, what would the result be and why of handling the URL
http://www.napier.ac.uk/~gordon/hello.html
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.napier\.ac\.uk [NC]
RewriteCond %{REQUEST_URI} ^/~gordon
RewriteRule ^/(.*) http://www.live.napier.ac.uk/$1 [L,R=permanent]
RewriteRule ^((.*) http://www.soc.napier.ac.uk/$1 [L,R=permanent]

the answer is: The url will be rewritten externally to http://www.soc.napier.ac.uk/~gordon/hello.html, as the HOST matches and the URI does not start “/~neil”. The last RewriteRule is not done due to the first rule having the option “L”.

I am also not sure about the above answer.

Please advise.

drgrussell
Site Admin
Posts: 426
Joined: Sat Feb 12, 2005 8:57 pm
Are you a robot or a human?: Human

Re: Past papers CSN09101: Word (answers)

Post by drgrussell » Sun Nov 07, 2010 2:07 pm

I did say that the answers were not to be taken verbatum, but instead were for guideance to an experienced lecturer who may be doing the marking.

Yes you are right, the answers may not be accurate. The answers are written early on, but a second checking system is used to veryify the answers before they are actually used for marking the exams. If I remember correctly a number of errors were identified at that time, but those were on my own copy of the answers and not the published version you see.

Q1 - In the exam I ended up marking both as correct, but you are right.
Q4 - yes size is 16 bytes and the name is b.
Q13 - lots of ways to do this. My answer looks fine, as !www is not web or test.
Q14 is on email, which is a later lecture.
Q15 - To me the HTTP_HOST line is false, and the URI line is true, so first rewriterule is ignored (and therefore the L is ignored too). Last RewriteRule matches and so is indeed rewritten to the url shown in the answer. Or some said "((.*)" had unbalanced brackets (a typo) and thus no rewrite would happen...

I did warn people the answers were only a guide, and could not be taken to be the "right" answer.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest