| 1 |
# Installation |
# Installation |
| 2 |
|
|
| 3 |
The Chinese version of this changelog is available at [INSTALL.zh_CN.md](INSTALL.zh_CN.md). |
The Chinese version of this installation guide is available at [INSTALL.zh_CN.md](INSTALL.zh_CN.md). |
| 4 |
|
|
| 5 |
To install LBBS on Linux (e.g., Debian 13, CentOS Stream 10), please perform the following steps: |
To install LBBS on Linux (e.g., Debian 13, CentOS Stream 10), please perform the following steps: |
| 6 |
|
|
| 79 |
|
|
| 80 |
## 6. Modify Configuration Files |
## 6. Modify Configuration Files |
| 81 |
|
|
| 82 |
Default configuration files are saved as `*.default`. Rename them first: |
Default configuration files are saved as `*.default`. Copy and rename them first: |
| 83 |
|
|
| 84 |
- `$LBBS_HOME_DIR/conf/bbsd.conf` |
```bash |
| 85 |
- `$LBBS_HOME_DIR/conf/bbsnet.conf` |
cd $LBBS_HOME_DIR |
| 86 |
- `$LBBS_HOME_DIR/conf/badwords.conf` |
cp conf/bbsd.conf.default conf/bbsd.conf |
| 87 |
- `$LBBS_HOME_DIR/utils/conf/db_conn.conf.php` |
cp conf/bbsnet.conf.default conf/bbsnet.conf |
| 88 |
|
cp conf/badwords.conf.default conf/badwords.conf |
| 89 |
|
cp utils/conf/db_conn.conf.php.default utils/conf/db_conn.conf.php |
| 90 |
|
``` |
| 91 |
|
|
| 92 |
|
Then edit each file to match your environment: |
| 93 |
|
|
| 94 |
|
### bbsd.conf |
| 95 |
|
Key settings to adjust: |
| 96 |
|
- `db_host`, `db_username`, `db_password`, `db_database`: MySQL connection details |
| 97 |
|
- `bbs_server`, `bbs_port`, `bbs_ssh_port`: Network settings |
| 98 |
|
- `bbs_name`: Your BBS name |
| 99 |
|
- `bbs_max_client`: Maximum concurrent connections (adjust based on server capacity) |
| 100 |
|
|
| 101 |
|
### db_conn.conf.php |
| 102 |
|
Set the database connection parameters: |
| 103 |
|
- `$DB_hostname`, `$DB_username`, `$DB_password`, `$DB_database` |
| 104 |
|
|
| 105 |
|
### bbsnet.conf & badwords.conf |
| 106 |
|
Review and customize as needed for your BBS policies. |
| 107 |
|
|
| 108 |
## 7. Copy MySQL CA Certificate |
## 7. Copy MySQL CA Certificate |
| 109 |
|
|
| 121 |
|
|
| 122 |
## 9. Create SSH2 Certificates |
## 9. Create SSH2 Certificates |
| 123 |
|
|
| 124 |
|
Generate SSH host keys for the SSH server component. The `-N ""` flag sets an empty passphrase for the keys (required for automated service startup). |
| 125 |
|
|
| 126 |
```bash |
```bash |
| 127 |
ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key |
ssh-keygen -t rsa -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_rsa_key |
| 128 |
ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key |
ssh-keygen -t ed25519 -C "Your Server Name" -N "" -f $LBBS_HOME_DIR/conf/ssh_host_ed25519_key |
| 151 |
|
|
| 152 |
In case of unexpected failure or improper operation resulting in abnormal termination of the LBBS process, manual cleanup of shared memory/semaphore might be required before relaunching the process. |
In case of unexpected failure or improper operation resulting in abnormal termination of the LBBS process, manual cleanup of shared memory/semaphore might be required before relaunching the process. |
| 153 |
|
|
| 154 |
First, check with: |
### When Cleanup is Needed |
| 155 |
|
- After a crash or force-kill of the `bbsd` process |
| 156 |
|
- If `bbsd` fails to start with "shared memory already exists" errors |
| 157 |
|
- When `ipcs` shows resources owned by user `bbs` |
| 158 |
|
|
| 159 |
|
### Checking for Orphaned Resources |
| 160 |
|
First, check for any remaining shared memory segments or semaphores: |
| 161 |
```bash |
```bash |
| 162 |
sudo -u bbs ipcs |
sudo -u bbs ipcs |
| 163 |
``` |
``` |
| 164 |
|
|
| 165 |
There should be no items owned by `bbs`. Otherwise, clean up with: |
Look for entries in the "SHM" (shared memory) and "SEM" (semaphore) sections where the "OWNER" is `bbs`. |
| 166 |
|
|
| 167 |
|
### Cleaning Up |
| 168 |
|
If resources exist, remove them with: |
| 169 |
```bash |
```bash |
| 170 |
sudo -u bbs ipcrm -a |
sudo -u bbs ipcrm -a |
| 171 |
``` |
``` |
| 172 |
|
|
| 173 |
# For Docker Users |
This removes all shared memory and semaphore resources accessible to the `bbs` user. |
| 174 |
|
|
| 175 |
|
## 14. Docker Installation (Alternative Method) |
| 176 |
|
|
| 177 |
You may either build the Docker image from source code by running: |
For containerized deployment, LBBS provides Docker support. |
| 178 |
|
|
| 179 |
|
### Building from Source |
| 180 |
|
To build the Docker image from source code: |
| 181 |
```bash |
```bash |
| 182 |
docker compose up --build -d |
docker compose up --build -d |
| 183 |
``` |
``` |
| 184 |
|
|
| 185 |
or pull the Docker image per release from Docker Hub by running: |
### Using Pre-built Images |
| 186 |
|
To use pre-built images from Docker Hub: |
| 187 |
```bash |
```bash |
| 188 |
docker compose pull |
docker compose pull |
| 189 |
|
docker compose up -d |
| 190 |
``` |
``` |
| 191 |
|
|
| 192 |
You should always create/update the configuration files for local configuration (e.g., database connection, network port) as described above. |
### Configuration for Docker |
| 193 |
|
When using Docker, you still need to configure LBBS appropriately: |
| 194 |
|
|
| 195 |
|
1. **Configuration Files**: Create and customize the configuration files as described in Step 6. |
| 196 |
|
2. **Database Connection**: Ensure `db_conn.conf.php` points to your MySQL server (which should be accessible from the container). |
| 197 |
|
3. **Port Mapping**: By default, Docker Compose maps: |
| 198 |
|
- SSH port: 2322 → 2322 (container) |
| 199 |
|
- Telnet port: 2323 → 2323 (container) |
| 200 |
|
|
| 201 |
|
Adjust these in `docker-compose.yml` if needed. |
| 202 |
|
4. **Persistent Data**: The `data/` and `conf/` directories are mounted as volumes for persistence. |
| 203 |
|
|
| 204 |
|
### Docker Compose Management |
| 205 |
|
- Start: `docker compose up -d` |
| 206 |
|
- Stop: `docker compose down` |
| 207 |
|
- View logs: `docker compose logs -f` |
| 208 |
|
- Restart: `docker compose restart` |
| 209 |
|
|
| 210 |
|
For more details, refer to the `docker-compose.yml` file and Docker documentation. |