When creating software for various systems Edoceo places our specific code, libraries, documentation, etc according to the following structure.
File Locations
Unless otherwise necessary in-house software should be created in /opt/edoceo
or c:\Program Files\Edoceo, Inc.
depending on platform.
Library files are component binaries or scripts, aka DLLs and WSC files.
Temporary files are ones that can be killed anytime, not important, not sensitive
Web files are any content or code to be visible over http.
- Executeable Files - ./bin
- Library Files - ./lib/
- Temporary Files - Use the System location
- Web Files - System specific location
Zend Framework Applications
Our Web-Applications are typically deployed using the Zend Framework at the following locations.
Apache Configuration, change example.com and IP as necessary.
<VirtualHost 216.162.208.165:80> DocumentRoot /var/www/example.com/webroot # Primary is sans-www ServerAlias www.example.com ServerName example.com # Force sans-www RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteRule (.*) http://example.com$1 [R=301,L] # Setup Zend Framework Handler <Directory /var/www/example.com/webroot> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /index.php/$1 [QSA,L] </Directory> </VirtualHost>
Application File Structure, what appears in /var/www/example.com/.
./approot ./approot/controllers ./approot/controllers/ErrorController.php ./approot/controllers/IndexController.php ./approot/etc ./approot/etc/config.ini ./approot/layouts ./approot/layouts/layout.phtml ./approot/lib ./approot/lib/AppController.php ./approot/lib/AppModel.php ./approot/lib/AppView.php ./approot/var ./approot/var/cache ./approot/views ./approot/views/elements ./approot/views/elements/menu.phtml ./approot/views/helpers ./approot/views/helpers/Image.php ./approot/views/helpers/Link.php ./approot/views/scripts ./approot/views/scripts/error ./approot/views/scripts/error/error.phtml ./approot/views/scripts/index ./approot/views/scripts/index/index.phtml ./webroot ./webroot/index.php ./webroot/robots.txt ./webroot/css ./webroot/css/base.css ./webroot/css/screen.css ./webroot/css/print.css ./webroot/img ./webroot/js ./webroot/js/base.js