Build Your Own Browser is a web application that helps people configure and distribute customized versions of Firefox.
BYOB has a number of moving parts, so installation may be a bit more complex than the usual LAMP stack PHP app.
-
Prerequisites
- MySQL 5.0+
- PHP 5.3+, with at least the following modules:
- gearman, curl, gd, mcrypt, mysql, mysqli
- Gearman 0.7.0
- An OS X server, at least for the gearman repack worker
-
Filesystem
- Ensure the following directories exist and are writable by the web server:
application/cacheapplication/logsdownloadsworkspace
- For a clustered environment:
- Unique per web server:
application/cacheandapplication/logs - Can be on a shared mount:
downloadsandworkspace
- Unique per web server:
- Ensure the following directories exist and are writable by the web server:
-
MySQL
- Create a new database using the current schema:
application/config/schema-mysql/current.sql
- Though
current.sqlshould always contain the latest schema, changes to the DB will appear here:application/config/schema-mysql/changes/
- Create a new database using the current schema:
-
Recaptcha
- Visit
recaptcha.netto obtain a public / private key pair for the domain where you intend to install the app.
- Visit
-
Application config
- All editable configuration files reside under
application/config - Copy
config-local.php-disttoconfig-local.phpand edit to make installation-specific changes.- The
database.localstructure should be given the MySQL credentials to access the database created in the previous step. - The
database.shadowstructure should be given the same MySQL credentials asdatabase.local, or configured to point at a read-only replica ofdatabase.local. - Change the
recaptchasettings to reflect the domain, public key, and private key data acquired fromrecaptcha.net - Change the email.* settings to reflect local email environment.
- Set
email.driverto 'native' if PHP itself is setup to send email - Set
email.driverto 'smtp' and updateemail.optionsif an external SMTP server is to be used.
- Set
- Set
core.display_errorstoFALSEto prevent verbose error messages - Set
core.log_thresholdto 0 to disable logging toapplication/logs - Change
core.site_domainto the domain name of the web host, deleting the code to guess the domain name for dev servers.
- The
- Copy
repacks.php-disttorepacks.phpand edit to make installation-specific changes.- In particular, the locations of the
downloadsandworkspacedirectories can be changed.
- In particular, the locations of the
- All editable configuration files reside under
-
Create first admin user:
- At the command line, execute this command from the application directory:
php index.php util/createlogin admin someaddress@mozilla.com admin- Replace
someaddress@mozilla.comwith a real email address
- Replace
- You should see output like the following:
Profile ID 1 created for 'admin' with role 'admin'Password: mnm518x
- The last line is the temporary password for the admin account - someone should use it and change it immediately.
- At the command line, execute this command from the application directory:
-
Gearman and repack worker
- Important details:
- BYOB performs browser customizations asynchronously from the web application by using a gearman job server and a worker process.
- Although the web application can run on a Linux server, the gearman worker itself must currently run on an OS X server.
- This is because the browser repack script requires access to OS X utilities in order to build OS X disk images for browser distribution.
- Configure the addresses of gearman servers:
application/config/config-local.php
- A shell script wrapper that runs the gearman repack worker is here:
modules/gearman_events/bin/gearman-worker.sh- This shell script repeatedly restarts the PHP worker, which allows the PHP worker to exit occasionally in order to clean up and refresh its code.
- This shell script should be started up as a daemon when the server boots up, after MySQL, gearman, and apache are all available.
- Important details: