server-configs/README.md

52 lines
2.7 KiB
Markdown
Raw Normal View History

# Base Config
Note: The Mail Server requires SSL certificates
## Web Server
### Package Requirements (FIXME: other php packages)
nginx, php, php-fpm, mariadb, bower, gulp, letsencrypt
### Folders (FIXME: add php folder and configs)
nginx, php, systemd
### Setup Instructions (FIXME: add mysql setup instructions)
1. Install the packages in the `Package Requirements` above
2. Copy the folders above that aren't already configured to their equivalent location in `/etc`
3. In `/etc/nginx/sites-available/REPLACEME.TLD.conf` and `/etc/systemd/system/letsencrypt.service`, replace instances of `REPLACEME.TLD` with the FQDN
4. Rename `/etc/nginx/sites-available/REPLACEME.TLD.conf` so that `REPLACEME.TLD` is replaced with the FQDN
5. Add your site files to `/srv/http/REPLACEME.TLD` where public assets are located in `/srv/http/REPLACEME.TLD/public` (replacing `REPLACEME.TLD` with the FQDN)
6. Create a symlink from `/etc/nginx/sites-available/REPLACEME.tld.conf` to `/etc/nginx/sites-enabled/REPLACEME.tld.conf` (replacing `REPLACEME.TLD` with the FQDN)
7. Run `systemctl start php-fpm nginx` to start the web services and `systemctl status php-fpm` and `systemctl status nginx` to check for errors
8. If there were no errors in the previous command, run `systemctl enable postfix dovecot` to enable the web services at boot
9. Ensure the public web directory exists and run `systemctl start letsencrypt` to generate the SSL certificates
10. Run `systemctl enable letsencrypt.timer` to enable the auto-renewal process
## Mail Server
### Package Requirements
dovecot, postfix, procmail
### Folders
dovecot, pam.d, postfix, procmailrc, skel, systemd
### Setup Instructions
1. Install the packages in the `Package Requirements` above
2. Copy the folders above that aren't already configured to their equivalent location in `/etc`
3. In `/etc/dovecot/dovecot.conf` and `/etc/postfix/main.cf`, replace instances of `REPLACEME.TLD` with the FQDN
4. In `/etc/postfix/aliases`, replace the instance of `REPLACEME` with the user that should receive domain-level emails
5. Run `newaliases` to update the aliases database with the contents of `/etc/postfix/aliases`
6. Run `systemctl start postfix dovecot` to start the mail services and `systemctl status postfix` and `systemctl status dovecot` to check for errors
7. If there were no errors in the previous command, run `systemctl enable postfix dovecot` to enable the mail services at boot
### Add Accounts
1. Create an account by running `useradd -m -d /home/REPLACEME -s /bin/bash REPLACEME` (replacing `REPLACEME` with the username associated with the mail account)
2. Set the password by running `passwd REPLACEME` (replacing `REPLACEME` with the username associated with the mail account)