canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,043
edits
No edit summary |
No edit summary |
||
| (21 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{AmoArchive}} | |||
= | = Check out code from CVS = | ||
== | == v1 == | ||
<pre> | |||
cvs co -P -d v1 -rMOZILLA_UPDATE_1_0_BRANCH mozilla/webtools/update | |||
</pre> | |||
== | == v2 == | ||
<pre> | |||
cvs co -P -d v2 mozilla/webtools/addons | |||
</pre> | |||
For CVS instructions, see the [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS devmo page on CVS]. | |||
== | = Server Requirements = | ||
== v1 and v2 == | |||
* A server | |||
* mysqld | |||
* apache2 | |||
* php4.x | |||
* php-mysql | |||
== v1 == | |||
* zzlib PHP extension (for inflating xpi's in additem.php) | |||
== v2 == | |||
* Smarty | |||
* PEAR::DB | |||
== v2 Enhancements == | |||
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 | |||
* memcached | |||
* PECL PHP memcache extension (--enable-memcache[=DIR]) | |||
== v2 Server Notes == | |||
* Apache | |||
** Prod | |||
*** Copy contents of ./public/htaccess.dist into vhost conf file. | |||
** Dev/Testing | |||
*** 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 | |||
* MySQL | |||
** 4.1.x+ | |||
** When we move things forward we will need to import a mysqldump from production | |||
** <strike>We then will need to run ./shared/sql/v2.sql</strike> -- This was already completed in the v2 release, so if you have an access to the chameleon dump, using that should be adequate. | |||
* PHP | |||
** 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. | |||
= v1 Installation = | |||
* 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: | |||
<pre> | |||
$ ln -s /data/previews/ previews | |||
</pre> | |||
* 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: | |||
<pre> | |||
$ ln -s /data/amo/files/ files | |||
</pre> | |||
= v2 Installation = | |||
== Application Config == | |||
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 | |||
== Directory Structure == | |||
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 | |||
* ./public/inc/config.php | |||
** Copy config-dist.php to config.php and follow the instructions in the comments. | |||
* ./public/htdocs/htaccess.dist | |||
** Copy to .htaccess then set the rewrite base to the proper value. | |||
== Previews == | |||
* As with v1 you will have to create a symlink to the previews directory from images/: | |||
<pre> | |||
$ cd public/htdocs/images | |||
$ ln -s /data/previews/ previews | |||
</pre> | |||