|
42 | 42 | > This setup ensures that your user as well as the `www-data` user are allowed to write files to web directory (the minimum need of permissions) |
43 | 43 |
|
44 | 44 | The following configuration is the commonly recommended set-up for your web server folder: |
45 | | -(Source: https://dev.to/phlash909/comment/ahf6) |
46 | 45 |
|
47 | 46 | 1. First, make sure `www-data` group exists and add your current login: |
48 | | -_(if you are using another distro than Raspbian/Raspberry Pi OS the username of web server can differ)_ |
49 | | -`sudo groupadd www-data` |
50 | | -`sudo usermod -a -G www-data www-data` |
| 47 | +_(if you are using another distro than Raspbian/Raspberry Pi OS the username of web server can differ)_<br> |
| 48 | +`sudo groupadd www-data`<br> |
| 49 | +`sudo usermod -a -G www-data www-data`<br> |
51 | 50 | `sudo usermod -a -G www-data <yourlogin>` (replace `<yourlogin>` with your username) |
52 | 51 |
|
53 | | -2. Second, give the ownership of web folder to the `www-data` group and user. The following commands ensure that group members (including your own login) are able to write/edit files: |
54 | | -`sudo chgrp -R www-data /var/www/html` |
55 | | -`sudo chown -R www-data /var/www/html` |
56 | | -`sudo chmod -R 775 /var/www/html` |
| 52 | +2. Second, give the ownership of web folder to the `www-data` group and *your* user. The following commands ensure that you have _full_ access on the files and group members (www-data) are able to write/edit files _only in the dashboard folder_:<br> |
| 53 | +`sudo chown -R <yourlogin>:www-data /var/www/html` (replace `<yourlogin>` with your username)<br> |
| 54 | +`sudo chmod -R 755 /var/www/html` |
57 | 55 |
|
58 | 56 | 3. Reboot your RPi (for permission changes to take effect) |
59 | 57 |
|
60 | | -> An erroneous permission typically results in the situation where the user responsible for web server (e.g. `www-data`) does not have rights to create/modify the local config file for saving your dashboard adjustments (your custom thresholds, password etc.). In this case, the dashboard won't work at all and throwing this error (see #22). |
| 58 | +> An erroneous permission typically results in the situation where the user responsible for web server (e.g. `www-data`) does not have rights to create/modify the local config file for saving your dashboard adjustments (your custom thresholds, password etc.). In this case, the dashboard won't work at all and throwing this error. |
61 | 59 |
|
62 | 60 | ### Setup project |
63 | 61 |
|
64 | 62 | - navigate to your web folder (`cd /var/www/html`) |
65 | 63 | - clone this Github repository: `git clone https://github.com/femto-code/Rasberry-Pi-Dashboard.git {your_subfolder_name}` |
66 | | -- **DONE!** Open web browser with URL: `http://IP_OF_YOUR_RPI/{your_subfolder_name}` |
67 | | -> Note: replace {your_subfolder_name} with your choice accordingly. You can also rename the base folder at any time afterwards. |
| 64 | +- Run `sudo chmod -R 775 /var/www/html/<your_subfolder_name>` to set correct permissions |
| 65 | +- **DONE!** Open web browser with URL: `http://IP_OF_YOUR_RPI/<your_subfolder_name>` |
| 66 | +> Note: replace <your_subfolder_name> with your choice of subfolder name accordingly. You can also rename the base folder at any time afterwards. |
68 | 67 |
|
69 | 68 | ## Configuration / Help |
70 | 69 |
|
|
0 commit comments