---
title: "Passenger application layout"
date: "2015-03-01"
category: "cgi-passenger"
slug: "passenger-application-layout"
---

## Overview

All [[passenger-supported-apps]] require a specific filesystem layout. Every Passenger application needs four components:

1. **Startup file**: Passenger loads this file to launch the application. The filename varies by language.
2. **`public/` directory**: The [[where-is-site-content-served-from]] for static assets (images, JavaScript, CSS).
3. **`.htaccess` file**: An Apache configuration file (see [[htaccess-guide]]) that tells the web server to treat this directory as a Passenger application.
4. **`tmp/` directory**: Used primarily for [[restarting-passenger-processes]].

## Example Layout

A sample Node.js application at `/var/www/nodejs`:

+-- app.js        <-- startup file
+-- public        <-- html-accessible document root
|   +-- .htaccess <-- apache configuration
+-- tmp           <-- miscellaneous folder

## Startup Files by Application Type

All application types expect the startup file one level above `public/`, except legacy Ruby on Rails (1.x/2.x) which places it in `config/`.

| Application Type | Startup File |
|---|---|
| Ruby on Rails >= 3.0, Ruby Rack | `config.ru` |
| Ruby on Rails 1.x and 2.x | `config/environment.rb` |
| Python | `passenger_wsgi.py` |
| Node.js, Meteor | `app.js` |
