Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nginx.md #926

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docs/guides/webserver/nginx.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
### Notes & Warnings

- **This is an unsupported configuration created by the community**
- **Replace `7.3` with the PHP version you installed, e.g. if you're using Raspbian Stretch (Debian 9) replace `7.3` with `7.0`.**
- The `php7.3-sqlite3` package must be installed otherwise Networking and Querying will throw an error that it can't access the database.
- The `php-sqlite3` package must be installed otherwise Networking and Querying will throw an error that it can't access the database.

### Basic requirements

1. Stop default lighttpd

```bash
service lighttpd stop
systemctl stop lighttpd
```

2. Install necessary packages
1. Install necessary packages

```bash
apt-get -y install nginx php7.3-fpm php7.3-cgi php7.3-xml php7.3-sqlite3 php7.3-intl apache2-utils
apt-get -y install nginx php-fpm php-cgi php-xml php-sqlite3 php-intl apache2-utils
```

3. Disable lighttpd at startup
1. Disable lighttpd at startup

```bash
systemctl disable lighttpd
```

4. Enable php7.3-fpm at startup
1. Enable php8.2-fpm at startup
*Note:* The name of this service includes the version of `php-fpm` installed. To find yours, run `sudo apt list --installed | grep php.*fpm`

```bash
systemctl enable php7.3-fpm
systemctl enable php8.2-fpm
```

5. Enable nginx at startup
1. Enable nginx at startup

```bash
systemctl enable nginx
```

6. Edit `/etc/nginx/sites-available/default` to:
1. Edit `/etc/nginx/sites-available/default` to:

```nginx
server {
Expand Down Expand Up @@ -82,40 +82,40 @@
}
```

7. Create a username for authentication for the admin - we don't want other people in our network change our black and whitelist ;)
1. Create a username for authentication for the admin - we don't want other people in our network change our black and whitelist ;)

```bash
htpasswd -c /etc/nginx/.htpasswd exampleuser
```

8. Change ownership of the html directory to nginx user
1. Change ownership of the html directory to nginx user

```bash
chown -R www-data:www-data /var/www/html
```

9. Make sure the html directory is writable
1. Make sure the html directory is writable

```bash
chmod -R 755 /var/www/html
```

10. Grant the admin panel access to the gravity database
1. Grant the admin panel access to the gravity database

```bash
usermod -aG pihole www-data
```

11. Start php7.3-fpm daemon
1. Start php8.2-fpm daemon

```bash
service php7.3-fpm start
systemctl restart php8.2-fpm
```

12. Start nginx web server
1. Start nginx web server

```bash
service nginx start
systemct restart nginx
```

### Optional configuration
Expand Down