1 # Checking Out the Code and Installing Required Applications
3 Note: These instructions assume you're using Mac OS X Mountain Lion as the host server, and assume that we're installing
4 this application at `/Volumes/Data/test-results`.
6 1. Install Server (DO NOT launch the Server app)
7 2. Install Xcode with command line tools (only needed for svn)
8 3. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/test-results /Volumes/Data/test-results`
12 Always use apachectl instead of the Server App to start or stop Apache.
13 - Starting httpd: `sudo apachectl stop`
14 - Stopping httpd: `sudo apachectl restart`
16 ## Edit /private/etc/apache2/httpd.conf
18 1. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"`
19 2. Update ServerAdmin to `rniwa@apple.com`
21 3. Change DocumentRoot to `/Volumes/Data/test-results/public/`
22 4. Change the directives for the document root and / to point to `/Volumes/Data/test-results/public/`
23 5. Add Add the following directives to enable zlib compression and MultiViews:
25 Options Indexes MultiViews
26 php_flag zlib.output_compression on
28 6. Delete or comment out directives on CGI-Executables
29 7. Add the following directives to enable gzip:
31 <IfModule mod_deflate.c>
32 AddOutputFilterByType DEFLATE text/html text/xml text/plain application/json application/xml application/xhtml+xml
35 Note: If you've accidentally turned on the Server app, httpd.conf is located at `/Library/Server/Web/Config/apache2/` instead.
36 Delete the Web Sharing related stuff and include `/private/etc/apache2/httpd.conf` at the very end.
38 By default, the Apache error log will be located at `/private/var/log/apache2/error_log`.
41 # Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
43 By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests,
44 builders, and other entities in the database and may even execute arbitrary JavaScript on the server via aggregators.
46 We recommend protection via Digest Auth on https connection.
48 Generate a password file via `htdigest -c <path> <realm> <username>`, and then add the following directive:
50 <Directory "/Volumes/Data/test-results/public/admin/">
53 AuthDigestProvider file
58 where <realm> is replaced with the realm of your choice.
61 # Configuring PostgreSQL
63 1. Create database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/initdb /Volumes/Data/test-results/database`
65 `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/test-results/database
66 -l logfile -o "-k /Volumes/Data/test-results/database" start`
68 ## Creating a Database and a User
70 1. Create a database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createdb test-results-db -h localhost`
71 2. Create a user: `/Applications/Server.app/Contents/ServerRoot/usr/bin/createuser -P -S -e test-results-user -h localhost`
72 3. Connect to database: `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql test-results-db -h localhost`
73 4. Grant all permissions to the new user: `grant all privileges on database "test-results-db" to "test-results-user";`
74 5. Update config.json.
76 ## Initializing the Database
78 Run `init-database.sql` in psql as `test-results-user`:
79 `/Applications/Server.app/Contents/ServerRoot/usr/bin/psql test-results-db -h localhost --username test-results-user -f init-database.sql`