1 hour long. Attempt all sections; there are no trick questions. For optional questions, you may answer more than one option, the marks from the highest scored options will be awarded.
You may refer to the reference sheet on regular expressions(these were lost to the winds of time)
Section A - General Web “Stuff” (spot the question that’s been on the last 3 tests)
- Name the 3 browsers that one should consider “market leaders” that a site should definitely work in. (3 marks)
- Using HTML, how should you produce the “&” character in a browser. (2 marks)
- List the main differences between .jpg and .gif files, include an example of when you would use them. (3 marks)
- What is the “web safe palette”? Is it worth bothering with these days? (3 marks)
- Name some ways in which you could have your site indexed better by search engines such as google. (4 marks)
Section B - Regular Expressions
No smart (.*) answers! All regular expressions should match only the expected input specified.
Write a regular expression that will match:
/xxx/yy /xxxx/y /xxxxxxx/yyy.. etc (you get the idea)
- Write a regular expression that will match all /~[username]/ requests for files with the “.jsp” extension. You can consider the jsp the end of the string. (5 marks)
- Given the expression “.“ give 2 strings you would expect to match. *(2 marks)
- We.ve decided to reverse proxy an IIS machine through apache, write a regular expression that would catch all URL’s with “cmd.exe” in them anywhere. (5 marks)
Section C - Web serving
Give the official (as per RFC 2616) response-type name OR write a brief sentence on what any 3 of the following HTTP response codes indicate. (3 marks)
200, 404, 403, 400, 302, 500
Name 3 non-apache web-servers. (3 marks)
- What does APACI stand for ? (1 mark)
- List some differences in using php as cgi (e.g. #!/usr/local/bin/php) and mod_php. RedBrick uses both, but users cannot use the module, why? (3 marks)
- What is suexec? (2 marks)
- What is TomCat? (1 mark)
- What are http cookies? How are they useful? Give an example of their use. (2 marks)
Section D - CGI is fun
- Give 3 environment variables a CGI can make use of. Describe what each one indicates.(3 marks)
- What are the two main different methods of giving a CGI input from a html form? Give advantages and disadvantages of each. (5 marks)
- Write a CGI, in the language of your choice (indicate), to output the /etc/motd file. (2 marks)
The following shell script, named “query_test.cgi”, does not work and generates a “premature end of script headers” error document. Assuming the permissions and locations are correct, give two reasons. (2 marks)
#!/bin/sh echo "Content-type=text/html" eval echo "
" eval echo "query string is:" $QUERY_STRING eval echo ""
For the same shell script (after the two errors are fixed), describe how it is insecure, indicate an exploit. (3 marks)
Section E - “Sorry, wrong password”
- Some muppet asks you install weirdsh because they want to write scripts in it. You download a file called weirdsh.tar.gz, how do you extract it ? (2 marks)
- Without knowing anything specific about the weirdsh project, what two commands would you expect to have to run to build it from source? (2 marks)
- And the third command to install it? (1 mark)
- What is the difference between
"su -"? (2 marks)
- How would you disuser a user? (2 marks)
- How would you disable a users website permanently? (2 marks)
- What command would you run to find out how many sockets are active to port 80? (2 marks)
Section F - “The hard one”
What is reverse proxying? Give some benefits and drawbacks and an example of its use. Bonus marks if you can describe briefly its use on RedBrick. (20 marks)
Apache has an alternative to being compiled as large static binary called DSO support (using mod_so). What is this? Give some of its advantages. Bonus marks if you can describe briefly its use on RedBrick. (20 marks)
Section G - Brownie Points!
- What version of apache is currently running on RedBrick?
- Name a non-standard apache module in use on RedBrick.
- Where was ApacheCon Europe 2001 supposed to be?
Did you cry when it was cancelled?
Why not? !!!
- Name a good source of (hint) weekly news on Apache.
- Name 3 former RedBrick webmasters (a.k.a. people you can bother with questions ;p~)