====== Apache, MySQL, PHP ====== Also known as AMP, or LAMP when running on Linux, those three services are by far the most widely used to deploy a local web development environment. ===== Looking for Flexibility ===== Although it is common to use those services, they often are deployed in a way that doesn't offer great flexibility. Specifically the Apache configuration as well as the php version that is used by Apache are monolithic and do no allow for a great deal of "per virtual host" configuration. The goal here will be to deploy the AMP base components in such a way that they will allow a greater deal of "per virtual host" configuration options. Basically what we'll aim at doing is run multiple instances of Apache with different configuration files, as well as allow "per virtual host" selection of the php version to run. ===== Running Multiple Apache Instances ===== If your virtual hosts have different requirements (e.g. mod_perl for one virtual host, mod_python for another, and maybe mod_php for a third virtual host), then your Apache instance is almost surely a RAM eater. Remember that httpd will instantly spawn new child processes of the same instance as needed...\\ If your perl web app is being frequently accessed, why spawn several instances of an httpd process that is also loaded with mod_python, mod_php and an assortment of other modules that, at least from the standpoint of the perl web app, are useless? What we'd need here is to have separate, lighter, Apache configurations for your mod_perl, mod_python and mod_php apps, listening on different ports (e.g. 81, 82, 83), and have a reverse proxy instance of Apache with virtual hosts configured to pass requests to the corresponding Apache instances. For detailled instructions on how to achieve this, please refer to the [[packages:amp:apache|Apache]] section of the wiki. ===== Installing Multiple Versions of PHP ===== One of hard to solve challenges is ensuring that a package do not only run on the specific PHP version the developers have installed on their machines (which often is the latest and greatest, maybe not even released version from SVN), but to cover the whole range of supported PHP versions. As far as I know, there is no single Linux distribution that supports installing multiple versions of PHP beside each other, we'll have to look for an alternative. A tool to solve all problems with the multiple-php-versions-on-one-machine solution is using [[https://github.com/cweiske/phpfarm|phpfarm]]. To follow a step by step guide on how to deploy multiple php versions onto your localhost, read the [[packages:amp:php|PHP]] section of the wiki. ===== Install and Manage MySQL ===== The last main brick of most standard web development environments is the database management system. Once again here, the established candidate is MySQL, we'll couple it with MySQL Workbench that offers a nice and powerful interface to manage local as well as remote engines. You can follow the installation instructions in the [[packages:amp:mysql|MySQL]] section of the wiki.