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/WebKitPerfMonitor`.
6 1. Install Server (DO NOT launch the Server app)
8 3. Install Xcode with command line tools (only needed for svn)
9 4. `svn co https://svn.webkit.org/repository/webkit/trunk/Websites/perf.webkit.org /Volumes/Data/WebKitPerfMonitor`
10 5. Inside `/Volumes/Data/WebKitPerfMonitor`, run `npm install pg`.
15 Don't use the Server App to start or stop Apache. It does weird things to httpd configurations. Use apachectl instead:
16 - Starting httpd: `sudo apachectl stop`
17 - Stopping httpd: `sudo apachectl restart`
19 ## Edit /private/etc/apache2/httpd.conf
21 1. Update ServerAdmin to your email address
22 2. Change DocumentRoot to `/Volumes/Data/WebKitPerfMonitor/public/`
23 3. Uncomment `"LoadModule php5_module libexec/apache2/libphp5.so"`
24 4. Modify the directives for the document root and / to allow overriding `"All"`
25 5. Delete directives on CGI-Executables
26 6. Add the following directives to enable gzip:
28 <IfModule mod_deflate.c>
29 AddOutputFilterByType DEFLATE text/html text/xml text/plain application/json application/xml application/xhtml+xml
32 7. Add the following directives to enable zlib compression and MultiViews on WebKitPerfMonitor/public:
34 Options Indexes MultiViews
35 php_flag zlib.output_compression on
37 Note: If you've accidentally turned on the Server app, httpd.conf is located at `/Library/Server/Web/Config/apache2/` instead.
38 Delete the Web Sharing related stuff and include `/private/etc/apache2/httpd.conf` at the very end.
40 The log is located at `/private/var/log/apache2`.
43 # Protecting the Administrative Pages to Prevent Execution of Arbitrary Code
45 By default, the application gives the administrative privilege to everyone. Anyone can add, remove, or edit tests,
46 builders, and other entities in the database and may even execute arbitrary JavaScript on the server via aggregators.
48 We recommend protection via Digest Auth on https connection.
50 Generate a password file via `htdigest -c <path> <realm> <username>`, and then create admin/.htaccess with:
54 AuthDigestProvider file
55 AuthUserFile "<Realm>"
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/WebKitPerfMonitor/PostgresSQL`
65 `/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_ctl -D /Volumes/Data/WebKitPerfMonitor/PostgresSQL
66 -l logfile -o "-k /Volumes/Data/WebKitPerfMonitor/PostgresSQL" start`
68 ## Creating a Database and a User
70 1. Create a database: `createdb webkit-perf-db -h localhost`
71 2. Create a user: `createuser -P -S -e webkit-perf-db-user -h localhost`
72 3. Connect to database: `psql webkit-perf-db -h localhost`
73 4. Grant all permissions to the new user: `grant all privileges on database "webkit-perf-db" to "webkit-perf-db-user";`
74 5. Update database/config.json.
76 ## Initializing the Database
78 Run `database/init-database.sql` in psql as `webkit-perf-db-user`:
79 `psql webkit-perf-db -h localhost --username webkit-perf-db-user -f database/init-database.sql`