| 31 | | The configuration of the web server may differ between the local server and the production server. Two methods are proposed here, choose tha one that best fits your needs and constraints. |
|---|
| | 31 | The configuration of the web server may differ between the local server and the production server. Three methods are proposed here, choose the one that best fits your needs and constraints. |
|---|
| | 32 | |
|---|
| | 33 | ### Zero configuration |
|---|
| | 34 | |
|---|
| | 35 | This method requires no change in web server or database configuration. It should work out of the box on all systems and is a good way to test the application and see if it fits your needs. However, you should not use this method in production, as it gives access to scripts and data files that should remain hidden to the end user. |
|---|
| | 36 | |
|---|
| | 37 | The installation is really straightforward: Either unpack the motyle tarball, or do a checkout of the motyle trunk, under the web root folder of your web server. |
|---|
| | 38 | |
|---|
| | 39 | You should end up with a file structure similar to: |
|---|
| | 40 | |
|---|
| | 41 | Apache/ |
|---|
| | 42 | www/ |
|---|
| | 43 | motyle/ |
|---|
| | 44 | apps/ |
|---|
| | 45 | batch/ |
|---|
| | 46 | cache/ |
|---|
| | 47 | config/ |
|---|
| | 48 | data/ |
|---|
| | 49 | doc/ |
|---|
| | 50 | lib/ |
|---|
| | 51 | log/ |
|---|
| | 52 | plugins/ |
|---|
| | 53 | test/ |
|---|
| | 54 | web/ |
|---|
| | 55 | sf/ |
|---|
| | 56 | index.php |
|---|
| | 57 | frontend_dev.php |
|---|
| | 58 | ... |
|---|
| | 59 | |
|---|
| | 60 | |
|---|
| | 61 | That's all. Now test motyle by browsing to: |
|---|
| | 62 | |
|---|
| | 63 | http://localhost/motyle/web/frontend_dev.php |
|---|
| | 64 | |
|---|
| | 65 | ### Custom web root |
|---|
| | 66 | |
|---|
| | 67 | A better way to install motyle is to unpack the content of the motyle/web/ folder under your web root, and the rest under another directory outside of the web root. Let's assume that your host offers you two directories for yous applications: |
|---|
| | 68 | |
|---|
| | 69 | my_site/ |
|---|
| | 70 | cgi-bin/ |
|---|
| | 71 | www/ |
|---|
| | 72 | |
|---|
| | 73 | Unpack (or transfer by ftp) all directories but the `web/` one under `cgi-bin`, and unpack (or transfer) the files of the `web/` directory under `www/`. You should end up with a file structure similar to: |
|---|
| | 74 | |
|---|
| | 75 | my_site/ |
|---|
| | 76 | cgi-bin/ |
|---|
| | 77 | apps/ |
|---|
| | 78 | batch/ |
|---|
| | 79 | cache/ |
|---|
| | 80 | config/ |
|---|
| | 81 | data/ |
|---|
| | 82 | doc/ |
|---|
| | 83 | lib/ |
|---|
| | 84 | log/ |
|---|
| | 85 | plugins/ |
|---|
| | 86 | test/ |
|---|
| | 87 | www/ |
|---|
| | 88 | sf/ |
|---|
| | 89 | index.php |
|---|
| | 90 | frontend_dev.php |
|---|
| | 91 | ... |
|---|
| | 92 | |
|---|
| | 93 | Edit both the `index.php` and the `rontend_dev.php` files and change the third line to: |
|---|
| | 94 | |
|---|
| | 95 | define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/../cgi-bin')); |
|---|
| | 96 | |
|---|
| | 97 | Then, you need to change the motyle web root configuration by editing the file called `cgi-bin/apps/frontend/config/config.php`. You should ad the following lines at the end of the file: |
|---|
| | 98 | |
|---|
| | 99 | $sf_root_dir = sfConfig::get('sf_root_dir'); |
|---|
| | 100 | sfConfig::add(array( |
|---|
| | 101 | 'sf_web_dir_name' => $sf_web_dir_name = 'www', |
|---|
| | 102 | 'sf_web_dir' => $sf_root_dir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$sf_web_dir_name, |
|---|
| | 103 | 'sf_upload_dir' => $sf_root_dir.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$sf_web_dir_name.DIRECTORY_SEPARATOR.sfConfig::get('sf_upload_dir_name'), |
|---|
| | 104 | )); |
|---|
| | 105 | |
|---|
| | 106 | Check that the installation went fine by browsing to: |
|---|
| | 107 | |
|---|
| | 108 | http://www.mysite.com/frontend_dev.php |
|---|
| 54 | | http://motyle.mysite.com/ |
|---|
| 55 | | |
|---|
| 56 | | ### Zero Apache Configuration |
|---|
| 57 | | |
|---|
| 58 | | If you don't want to (or can't) modify the Apache configuration, you can still install motyle by unpacking the archive under the web root. |
|---|
| 59 | | |
|---|
| 60 | | Then, you will have to change the motyle web root configuration by editing the file called `motyle/apps/frontend/config/config.php`. You should ad the following lines at the end of the file: |
|---|
| 61 | | |
|---|
| 62 | | $sf_root_dir = sfConfig::get('sf_root_dir'); |
|---|
| 63 | | sfConfig::add(array( |
|---|
| 64 | | 'sf_web_dir_name' => $sf_web_dir_name = 'www', |
|---|
| 65 | | 'sf_web_dir' => $sf_root_dir.DIRECTORY_SEPARATOR.$sf_web_dir_name, |
|---|
| 66 | | 'sf_upload_dir' => $sf_root_dir.DIRECTORY_SEPARATOR.$sf_web_dir_name.DIRECTORY_SEPARATOR.sfConfig::get('sf_upload_dir_name'), |
|---|
| 67 | | )); |
|---|
| 68 | | |
|---|
| 69 | | Change '`www`' in the third line by the name of your web root folder (it could be '`web`' or '`public`' or anything else, depending on your host), and save the file. |
|---|
| 70 | | |
|---|
| 71 | | Depending on your host, you may also have to edit the rewriting rules located in `motyle/web/.htaccess`. Here is the default file: |
|---|
| | 126 | http://motyle.mysite.com/frontend_dev.php |
|---|
| | 127 | |
|---|
| | 128 | ### Troubleshooting |
|---|
| | 129 | |
|---|
| | 130 | If you can't see the welcome screen, start by clearing the cache. To do so, type the following command from the root of the motyle directory: |
|---|
| | 131 | |
|---|
| | 132 | $ php symfony clear-cache |
|---|
| | 133 | |
|---|
| | 134 | Try to reach the test page at `http://motyle.mysite.com/default/index`. If the problem persists, switch to the development environment to see explicit error messages by browsing to: |
|---|
| | 135 | |
|---|
| | 136 | http://motyle.mysite.com/frontend_dev.php |
|---|
| | 137 | |
|---|
| | 138 | Depending on your host, you may also have to edit the rewriting rules located in `web/.htaccess`. Here is the default file: |
|---|
| 98 | | |
|---|
| 99 | | Check that the installation went fine by browsing to: |
|---|
| 100 | | |
|---|
| 101 | | http://motyle.mysite.com/ |
|---|
| 102 | | |
|---|
| 103 | | ### Troubleshooting |
|---|
| 104 | | |
|---|
| 105 | | If you can't see the welcome screen, start by clearing the cache. To do so, type the following command from the root of the motyle directory: |
|---|
| 106 | | |
|---|
| 107 | | $ php symfony clear-cache |
|---|
| 108 | | |
|---|
| 109 | | Try again to reach the test page at `http://motyle.mysite.com/default/index`. If the problem persists, switch to the development environment to see explicit error messages by browsing to: |
|---|
| 110 | | |
|---|
| 111 | | http://motyle.mysite.com/frontend_dev.php |
|---|
| 112 | | |
|---|
| 113 | | If you still can't manage to setup the application correctly, refer to the [symfony documentation](http://www.symfony-project.com/book/1_0/03-Running-Symfony) or find help in the [symfony forum](http://www.symfony-project.com/forum/index.php/f/6/). |
|---|
| | 165 | |
|---|
| | 166 | If you still can't manage to setup the application correctly, refer to the [symfony documentation](http://www.symfony-project.com/book/1_0/03-Running-Symfony#Troubleshooting) or find help in the [symfony forum](http://www.symfony-project.com/forum/index.php/f/6/). |
|---|