# fresh install

## Install required apps
```
apt install git composer php8.1-curl -y
```

## Set-Up the SSL folder to keep things together

```
mkdir /etc/nginx/ssl/
```

- Now That you have the directory created, copy the `.key` and `.pem` files into the newly made ssl folder on the server.
- You will then need to modify the filer ownership and permissions

```
chmod -R 655 /etc/nginx/ssl
chown -R www-data:www-data /etc/nginx/ssl
```

## Add configs for the site

- First, copy `ttp.conf` into the `/etc/nginx/snippets/` folder.
- Next, copy the `joeykimsey.com.conf` file into the `/etc/nginx/sites-available/` folder.
- The next block will acomplish a few things: backup the old config, enable the new config, disable the old config, and restart the server.
```
mkdir /etc/nginx/sites-available/old/
sudo mv /etc/nginx/sites-available/* /etc/nginx/sites-available/old/
sudo ln -s /etc/nginx/sites-available/joeykimsey.com.conf /etc/nginx/sites-enabled/joeykimsey.com.conf
sudo rm -rf /etc/nginx/sites-enabled/*
sudo systemctl restart nginx.service
```

## Set-Up the files

```
cd /var/www/
git config --global credential.helper store
git clone https://git.thetempusproject.com/joeykimsey/joeykimsey-com.git joeykimsey.com
cd joeykimsey.com
git fetch
git checkout production
```

_You will be prompted for git creds, use the creds shared below_

```
git config --global --add safe.directory /var/www/joeykimsey.com
git config --global --add safe.directory /var/www/joeykimsey.com/vendor/joeykimsey/hermes
git config --global user.name "Production Server"
git config --global user.email webmaster@thetempusproject.com
cd joeykimsey.com
composer install
chmod -R 777 .
chown -R www-data:www-data .
```

#### GitLab Credentials:

User: `root`\
Password: `rdFtVPhzlu6u6orxN4NAsbgAE4AyqZPTXPXQTleyA5I=`

#### Logging

```
tail -f /var/log/nginx/*.log
```