> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.bearsampp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bearsampp Directory Structure Explained

> A guided tour of every folder inside your Bearsampp installation — what each one contains, what you should edit, and what Bearsampp manages for you.

Bearsampp is fully self-contained: everything it needs — binaries, configuration, logs, SSL certificates, and your project files — lives inside a single root folder. You can place that folder anywhere on your machine or on a USB drive, and the entire stack moves with it. The structure below reflects the layout you see after a fresh installation.

```
bearsampp/
├── alias/
├── apps/
├── bin/
├── core/
├── logs/
├── ssl/
├── tmp/
├── tools/
├── vhosts/
├── www/
├── bearsampp.conf    ← main settings file
└── bearsampp.ini     ← module versions and ports
```

## Folder reference

<CardGroup cols={2}>
  <Card title="www/" icon="folder-open">
    Your web project files. Everything here is served by Apache at `http://localhost/`.
  </Card>

  <Card title="bin/" icon="server">
    Service binaries — Apache, PHP, MySQL, MariaDB, PostgreSQL, Node.js, Memcached, Mailpit, and Xlight.
  </Card>

  <Card title="tools/" icon="terminal">
    Command-line tools — Git, Composer, Ngrok, Python, Ruby, Perl, PowerShell, Ghostscript, and Bruno.
  </Card>

  <Card title="apps/" icon="browser">
    Web applications — phpMyAdmin and phpPgAdmin — served by Apache.
  </Card>

  <Card title="logs/" icon="file-lines">
    Log files for Bearsampp itself and for each running service.
  </Card>

  <Card title="alias/" icon="link">
    Apache alias configuration files, one per alias you create through the tray menu.
  </Card>

  <Card title="vhosts/" icon="globe">
    Apache virtual host configuration files, one per virtual host you create through the tray menu.
  </Card>

  <Card title="ssl/" icon="lock">
    SSL certificate files and the OpenSSL configuration (`openssl.cnf`).
  </Card>

  <Card title="core/" icon="gear">
    Bearsampp's internal engine — PHP classes, language files, and supporting assets. Do not modify.
  </Card>

  <Card title="tmp/" icon="clock">
    Temporary files created during operation. Bearsampp clears this folder on startup.
  </Card>
</CardGroup>

## Where to put your project files

Drop your project files into `bearsampp/www/`. Each subfolder becomes a URL path automatically:

```
www/
  myproject/         → http://localhost/myproject/
  anotherapp/        → http://localhost/anotherapp/
  index.php          → http://localhost/
```

<Tip>
  For projects that need a custom domain (like `myproject.local`), use a virtual host instead. See the [Virtual Hosts guide](/configuration/virtual-hosts) for step-by-step instructions.
</Tip>

## Inside the bin/ folder

Each binary module has its own subfolder under `bin/`, and within it a separate folder per installed version. A `current` symlink always points to the active version:

```
bin/
  apache/
    apache2.4.58/
    current -> apache2.4.58/
  php/
    php8.1.0/
    php8.2.0/
    current -> php8.2.0/
  mysql/
    mysql8.0.35/
    current -> mysql8.0.35/
```

Bearsampp manages these symlinks automatically when you switch versions from the tray menu.

## Alias and virtual host config files

The `alias/` and `vhosts/` folders contain Apache `.conf` files that Bearsampp generates and maintains for you. You should not edit these files manually — instead, use the tray menu actions **Add an alias** and **Add a virtual host**, which write the correct configuration and reload Apache for you.

If you do need to customise a generated file, use the **Edit** option from the alias or virtual host submenu in the tray menu, which opens the file in your default text editor.

## Log files

The `logs/` folder collects logs from all components:

| File                     | Contents                                 |
| ------------------------ | ---------------------------------------- |
| `bearsampp.log`          | General Bearsampp activity log           |
| `bearsampp-error.log`    | PHP and application errors               |
| `bearsampp-services.log` | Service start, stop, and install events  |
| `bearsampp-startup.log`  | Events recorded during Bearsampp startup |
| `bearsampp-batch.log`    | Output from internal batch operations    |

Individual service logs (Apache access/error, MySQL, etc.) are written into subfolders inside `logs/` or inside each module's versioned folder.

## Configuration files

The root folder contains Bearsampp's own settings files:

* `bearsampp.conf` — the main settings file. Stores your language, timezone, hostname, logging verbosity, startup behavior, and other global options. Bearsampp updates this file automatically when you change settings from the tray menu.
* `bearsampp.ini` — stores active module versions and port assignments. Bearsampp rewrites this file whenever you switch versions or change ports.

<Warning>
  Avoid hand-editing these files while Bearsampp is running. Use the tray menu to change settings so Bearsampp can update all dependent configuration files correctly. If `bearsampp.ini` becomes corrupted, use **Rebuild bearsampp.ini** from the tray menu to regenerate it.
</Warning>
