Update:Archive/2.0/Installation: Difference between revisions
(→Core) |
No edit summary |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{AmoArchive}} | |||
= Check out code from CVS = | = Check out code from CVS = | ||
Line 5: | Line 5: | ||
== v1 == | == v1 == | ||
<pre> | <pre> | ||
cvs co - | cvs co -P -d v1 -rMOZILLA_UPDATE_1_0_BRANCH mozilla/webtools/update | ||
</pre> | </pre> | ||
== v2 == | == v2 == | ||
<pre> | <pre> | ||
cvs co - | cvs co -P -d v2 mozilla/webtools/addons | ||
</pre> | </pre> | ||
Line 22: | Line 22: | ||
* php4.x | * php4.x | ||
* php-mysql | * php-mysql | ||
== v1 == | == v1 == | ||
Line 29: | Line 28: | ||
== v2 == | == v2 == | ||
* Smarty | * Smarty | ||
* PEAR::DB | |||
== Enhancements == | == 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. | 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 | * APC 3.x.x | ||
Line 36: | Line 36: | ||
* PECL PHP memcache extension (--enable-memcache[=DIR]) | * PECL PHP memcache extension (--enable-memcache[=DIR]) | ||
== Server | == v2 Server Notes == | ||
* Apache | * Apache | ||
** Prod | ** Prod | ||
Line 57: | Line 57: | ||
*** 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 | *** 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. | *** 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 = | = v1 Installation = | ||
Line 68: | Line 65: | ||
* Symlink the previews directory from ./images: | * Symlink the previews directory from ./images: | ||
<pre> | <pre> | ||
$ ln -s /data | $ ln -s /data/previews/ previews | ||
</pre> | </pre> | ||
* Your server needs to have a files directory containing the right .xpi's | * Your server needs to have a files directory containing the right .xpi's | ||
Line 102: | Line 99: | ||
* ./public/htdocs/htaccess.dist | * ./public/htdocs/htaccess.dist | ||
** Copy to .htaccess then set the rewrite base to the proper value. | ** 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> |
Latest revision as of 05:32, 29 April 2007
Check out code from CVS
v1
cvs co -P -d v1 -rMOZILLA_UPDATE_1_0_BRANCH mozilla/webtools/update
v2
cvs co -P -d v2 mozilla/webtools/addons
For CVS instructions, see the 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
- Prod
- MySQL
- 4.1.x+
- 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
- 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:
$ 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
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/:
$ cd public/htdocs/images $ ln -s /data/previews/ previews