Check out code from CVS
cvs co -P -d v1 -rMOZILLA_UPDATE_1_0_BRANCH mozilla/webtools/update
cvs co -P -d v2 mozilla/webtools/addons
For CVS instructions, see the devmo page on CVS.
v1 and v2
- A server
- zzlib PHP extension (for inflating xpi's in additem.php)
Without these, the app will still run, but it will be slower than optimal. We should plan on managing these, even if it is a PITA.
- APC 3.x.x
- PECL PHP memcache extension (--enable-memcache[=DIR])
v2 Server Notes
- Copy contents of ./public/htaccess.dist into vhost conf file.
- If you are using a singular vhost to test multiple instances of AMO, you'll have to adjust the vhost to use .htaccess files, so you'd have to add "AllowOverride FileInfo" then restart httpd.
- Make sure mod_rewrite is installed
- When we move things forward we will need to import a mysqldump from production
We then will need to run ./shared/sql/v2.sql-- This was already completed in the v2 release, so if you have an access to the chameleon dump, using that should be adequate.
- php-mysql - PHP packages for mysql support, this is a basic package
- APC (optional, production only)
- PECL memcache extension (optional, production only)
- This involves adding a C extension to PHP and recompiling it.
- The INSTALL file offers instructions on how to do this using PHP utils and make.
- PEAR::DB -- This is a basic package.
- Smarty -- https://intranet.mozilla.org/AMO -- Only the /lib directory is needed, the rest doesn't really need to be extracted.
- In the past, it was helpful to just make symlink that was /usr/local/share/php/Smarty --> /usr/local/share/php/Smarty-2.x.x
- When you configure the application, you will point at the lib directory not the base directory for Smarty -- so be aware of the distinction.
- copy core/config-dist.php -> core/config.php
- Fill in the proper variables, see the comments in config.php for help
- Your server needs to have a previews directory containing add-on previews
- Find this directory (or contact morgamic if you don't have it)
- Symlink the previews directory from ./images:
$ ln -s /data/previews/ previews
- Your server needs to have a files directory containing the right .xpi's
- You'll want to do something similar to set up the xpi directory:
$ ln -s /data/amo/files/ files
The application is split into sections on purpose. The goal here was to:
- segregate public, private and backend pieces
- hide non-public scripts from the world by not having php includes in the webroot
The main directories we should be aware of:
- ./shared/bin - backend scripts are stored here, and use the config.php in this directory
- ./shared/sql - sql structure along with a v2.sql for migrating v1 to the new structure live here
- ./shared/lib - all php libs and dependencies that are central live here (class defninitions, etc.)
- ./public/inc - wrappers live here, like config.php, init.php and finish.php
- ./public/htdocs - this should be the webroot of the site
- ./public/tpl - this is the template directory, not stored in the webroot
- ./public/templates_c - this is where smarty stores compiled templates
- ./public/cache - this is the smarty cache dir, not really needed but config requires it
- ./public/configs - this is the smarty configs dir, not really needed but config requires it
Setting things up, permissions, etc.
- ./public/(templates_c, cache, and configs)
- These should be writeable by apache
- Copy config-dist.php to config.php and follow the instructions in the comments.
- Copy to .htaccess then set the rewrite base to the proper value.
- As with v1 you will have to create a symlink to the previews directory from images/:
$ cd public/htdocs/images $ ln -s /data/previews/ previews