[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Layout of a web application


I am currently developing a Web application for my employer. I'm developing on a Debian based system although we expect it may be installed on other distributions. We expect two types of installation of the application. Our internal installations will be done with this application being the primary application on the Web site. That is http://www.example.com/ should point to the application's main index.php file. But we also expect it to be placed in subdirectories s othat http://www.example.com/app/ would point to the application's main index.php file.

My question is how exactly should I lay out the directory structure, for Debian first and with compatability with other distros second? This is my current thinking:

  /usr/share/appname/ - Location of all application specific files
    ./doc/        - All documentation files
    ./include/    - PHP include files
    ./templates/  - PHP/HTML template files
    ./tools/      - tools for managing the system (maybe to /usr/bin/?)
    ./html/       - What actually gets mapped to the Web server
  /usr/share/doc/appname - Link to /usr/share/appname/doc
  /var/lib/appname/  - Location of files that may change
    ./downloads/  - Files available for end user download. May change
                   between actual application updates.
    ./uploads/    - User uploads. These will be maintained indefinately
                   and are accessible only by the uploading user and
                   certain individuals with review rights.
  /var/cache/appname/ - Location of cached template files.

I also would like a recomendation on how to actually add the application to the Web server. I know that Apache will be used (we've made it a requirement). So the choices are to add the appropriate directives to the configuration or to link the directories. The issue with either of these is how to handle other applications (I'm using lrrd right now, for instance) that add directories under /var/www.

Any suggestions would be greatly apprciated.


Michael Johnson < mjohnson@pitsco.com >
Internet Application Programmer, Pitsco, Inc.
** My opinions are my own, not my employer's **

Reply to: