Website
Installing the FaT website locally
Update Mar 2019. This page is totally out of date. Please don't try to follow any of the information on it. I've left it here both for historical interest and incase there are any useful gems of knowledge
This guide was written for Windows XP and Vista.
If you choose to install anything in other directories make sure that you change the appropriate paths.
If you have any problems please contact Pedro, Bryn or Martin.
Subversion client TortoiseSVN
- Install Tortoise 1.5.3.13783 (or the latest version). You can download it from the TortoiseSVN website. It comes as a MSI installer so simply follow the on-screen instructions.
Apache HTTP server
- Install Apache HTTP server 2.2.9 (or the latest version). You can download it from the Apache website. It comes as a MSI installer so simply follow the on-screen instructions.
- Point your web browser at http://127.0.0.1/ to check it works!
PHP
- Install PHP 5.2.6 (or the latest version). It comes with and without an installer but download the non-installer version from the PHP website. Unpack the files into a new directory in your 'Program Files' folder - e.g. 'C:\Program Files\PHP 5.2.6'.
MySQL
- Install MySQL 5.0.67 (or the latest version). It comes with and without an installer but download the installer version from the MySQL website and follow the on-screen instructions. It will ask you for a root password during the installation procedure which I recommend that you set.
Textpad
- We recommend using Textpad to edit pages on the site. This is a plain text editor which can be configured to display useful PHP syntax colouring and has infinite 'undo', block indenting and other useful features. Please do not use html editors because these typically add html tags and/or formatting that are not needed on the site's content pages.
Configuration
- TortoiseSVN configuration
- Contact the webmaster and request a subversion username and password. (Ask to also be added to the developers group to have visibility of the developers forum on the Message Board.)
- Create a directory in a location of your choice for the website files. For the purpose of this example we'll assume it's in 'C:\FaT Website', but it works perfectly well anywhere else - somewhere in My Documents for example.
- Right click inside this directory and select 'SVN Checkout...'. Enter
https://www-bc.trin.cam.ac.uk/svn/trunk
in the 'URL of repository' textbox. The 'Checkout directory' textbox should sayC:\FaT Website
Leave everything else as it is and click OK. You will be asked for your subversion username and password and the download will then start (approx. 600MB in total).
- Apache configuration file ('C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf')
- Notice the use of slashes instead of back-slashes in paths.
- Configure PHP to work with Apache by adding the following lines to the end of the Apache config file:
#PHP LoadModule php5_module "C:/Program Files/PHP 5.2.6/php5apache2_2.dll" AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .css AcceptPathInfo on PHPIniDir "C:/Program Files/PHP 5.2.6"
- Tell Apache to load settings from the virtual host configuration file by uncommenting
Include conf/extra/httpd-vhosts.conf
- Add a Virtual Host for 'localhost' by adding the following lines to the virtual host configuration file conf/extra/httpd-vhosts.conf.
#Virtual Hosts NameVirtualHost localhost <VirtualHost localhost> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" ServerName localhost DirectoryIndex index.html index.phtml </VirtualHost>
- Add a Virtual Host for the FaT website by adding the following lines to the end of the Apache config file:
<VirtualHost localhost> DocumentRoot "C:/FaT Website/fat" ServerName fatlocal DirectoryIndex default.phtml default.shtml ErrorLog logs/error.log CustomLog logs/access.log custom RewriteEngine on RewriteOptions Inherit <Directory ~ "\.svn"> AllowOverride None Order allow,deny deny from all </Directory> <Directory "C:/FaT Website/fat"> Order allow,deny allow from all </Directory> RewriteRule ^/framemenu/.+/.+html /phtml/framemenu.phtml RewriteRule ^/framemenu/.+/.+/.+html /phtml/framemenu.phtml RewriteRule ^/frames/.+/.+phtml /phtml/page.phtml RewriteRule ^/tables/.+/.+phtml /phtml/page.phtml RewriteRule ^/plain/.+/.+phtml /phtml/page.phtml RewriteRule ^/frames/.+/.+/.+phtml /phtml/page.phtml RewriteRule ^/tables/.+/.+/.+phtml /phtml/page.phtml RewriteRule ^/plain/.+/.+/.+phtml /phtml/page.phtml RewriteRule ^/frames/.+/.+shtml /phtml/page.phtml RewriteRule ^/tables/.+/.+shtml /phtml/page.phtml RewriteRule ^/plain/.+/.+shtml /phtml/page.phtml RewriteRule ^/frames/.+/.+php /phtml/page.php RewriteRule ^/tables/.+/.+php /phtml/page.php RewriteRule ^/plain/.+/.+php /phtml/page.php </VirtualHost>
- If necessary, uncomment the line 'LoadModule rewrite_module modules/mod_rewrite.so' to enable the 'RewriteRule' commands.
- PHP configuration file ('C:\Program Files\PHP 5.2.6\php.ini')
- Copy C:\Program Files\PHP 5.2.6\php.ini-recommended to php.ini
- Set 'register_long_arrays = on' to overcome the issue of variables such as '$HTTP_SERVER_VARS' being deprecated in PHP5.
- Edit 'extension_dir' to = "C:/Program Files/PHP 5.2.6/ext/"
- Uncomment the line which loads the mysql PHP extension by removing the semicolon from before extension=php_mysql.dll
- Turn on displaying errors by setting display_errors = On
- Adjust the level of error reporting by setting "error_reporting = E_ALL & ~E_NOTICE. (When writing new PHP pages you may find it useful to set this to E_ALL.)
- If you are installing PHP5 onwards, mysql is no longer the default in the windows version, so you need to copy the file libmysql.dll from the PHP folder to the folder C:\Windows\system32
- MySQL
- Open the MySQL Command Line Client from the Start Menu and enter the password you chose during installation to login.
- Create the FaT database using the command 'create database fatdata;'.
- Add 'mcp21' as user to the MySQL server using the command 'grant all on *.* to 'mcp21' identified by 'mcp21pass';'
- Apply the changes using the command 'flush privileges;'
- Quit the mysql command line client by typing 'quit'.
- Set up the site's table structure and data by importing the sql commands contained in 'C:\FaT Website\sql\complete\fatdata.sql' into the MySQL database using the following command from a Command prompt (using Start > Run > cmd)
mysql -h localhost -u mcp21 --password=mcp21pass fatdata < "C:\FaT Website\sql\complete\fatdata.sql"
- hosts file
- Open the file 'C:\Windows\System32\drivers\etc\hosts' (you need Admin rights to save this file). Add the line '127.0.0.1 fatlocal' to the end of the file.
- Timestamp files
- Create two files in the root directory ('C:\FaT Website\fat') called sitestatictimestamp and sitedynamictimestamp.
- Restarting
- Restart the Apache server by starting the Apache Server Monitor and clicking Restart.
Start your favourite browser and try to access http://fatlocal/ which should put you through to the welcome page of the website. Congratulations, you now have your own working copy of www.firstandthird.org!!
Note that the gallery does not work, because the gallery pictures are stored in neither Mysql nor Subversion. Most of the rest of the site should be working correctly.
Once you have made any changes and checked them locally, you can commit the changes to the server by right clicking the file and selecting 'Commit...'. Remember to add a self-explanatory comment describing what you have changed and why and then click OK to send the changed file to the server. The change will appear immediately on http://firstandthird.soc.ucam.org.
Pushing changes onto the live website has to be done manually by contacting the webmaster. When you have finished work contact the rest of the development team to get your edits reviewed and arrange to have them put live.
Good luck!
Pedro, Rich & Martin, Autumn 2008