1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,180 +0,0 @@ |
1 |
-Raspbian 'stretch' - system build notes |
|
2 |
- |
|
3 |
-1. Copy os disk image to SD card. |
|
4 |
- |
|
5 |
-2. Mount the SD card to the host computer and navigate |
|
6 |
- to the boot volume of the SD card. |
|
7 |
- |
|
8 |
-3. If using wired Ethernet, skip to step 6. |
|
9 |
- |
|
10 |
-4. Edit the wpa_supplicant.conf file with your wifi ssid and |
|
11 |
- wifi password. |
|
12 |
- |
|
13 |
-5. Copy the wpa_supplicant.conf file to the root of the boot |
|
14 |
- volume. |
|
15 |
- |
|
16 |
-6. Create an empty file named "ssh" in the root of the boot |
|
17 |
- volume. |
|
18 |
- |
|
19 |
-7. Unmount the SD card and install in the Pi Zero. Apply |
|
20 |
- power and boot up the Pi Zero. |
|
21 |
- |
|
22 |
-8. Secure shell into the Pi Zero by running |
|
23 |
- ssh pi@raspberrypi.local |
|
24 |
- The password is 'raspberry' |
|
25 |
- |
|
26 |
-9. Configure the following by running |
|
27 |
- sudo raspi-config |
|
28 |
- In System Options modify the following |
|
29 |
- hostname: nodepower |
|
30 |
- password: YOUR_PASSWORD |
|
31 |
- In Interface Options modify the following |
|
32 |
- I2C: ON |
|
33 |
- In Localisation Options modify the following |
|
34 |
- Locale: en_US.UTF-8 UTF-8 |
|
35 |
- Timezone: PACIFIC |
|
36 |
- Keyboard: US |
|
37 |
- WLAN: US |
|
38 |
- |
|
39 |
-10. If using wired Ethernet, disable wifi by adding the following |
|
40 |
- line to the end of the /boot/config.txt file |
|
41 |
- dtoverlay=disable-wifi |
|
42 |
- This helps to conserve power. |
|
43 |
- |
|
44 |
-11. Disable Bluetooth by adding the following line to the end of |
|
45 |
- the '/boot/config.txt' file: |
|
46 |
- dtoverlay=disable-bt |
|
47 |
- This helps to conserve power. |
|
48 |
- [Optional] Run the once off command: |
|
49 |
- sudo systemctl disable hciuart |
|
50 |
- |
|
51 |
-12. Set up ssh keys on client and import the public key |
|
52 |
- to the Pi Zero .ssh directory. Create .ssh directory |
|
53 |
- on the Pi Zero. In .ssh create a file authorized_keys |
|
54 |
- and copy the public key to it. |
|
55 |
- |
|
56 |
-13. Backup and then modify /etc/ssh/sshd_config as follows |
|
57 |
- |
|
58 |
- #PermitRootLogin prohibit-password |
|
59 |
- PermitRootLogin no |
|
60 |
- |
|
61 |
- #X11Forwarding yes |
|
62 |
- X11Forwarding no |
|
63 |
- |
|
64 |
- Optionally turn off password authentication |
|
65 |
- |
|
66 |
- #PasswordAuthentication yes |
|
67 |
- PasswordAuthentication no |
|
68 |
- |
|
69 |
-14. Setup tmpfs by backup and then modifying /etc/fstab. Add |
|
70 |
- the following lines to the bottom of the file. |
|
71 |
- |
|
72 |
- # uncomment if needed for web apps |
|
73 |
- # These changes store all non-essential logs in ram to reduce |
|
74 |
- # stress on the SD card due to frequent writes. |
|
75 |
- tmpfs /tmp tmpfs nodev,nosuid,size=20M 0 0 |
|
76 |
- tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=20m 0 0 |
|
77 |
- tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=20m 0 0 |
|
78 |
- tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=20m 0 0 |
|
79 |
- |
|
80 |
-15. Reboot the Pi Zero by running |
|
81 |
- sudo reboot |
|
82 |
- |
|
83 |
-16. Run updates by running the commands |
|
84 |
- sudo apt-get update |
|
85 |
- |
|
86 |
- Optionally run all software updates |
|
87 |
- sudo apt-get upgrade |
|
88 |
- sudo reboot |
|
89 |
- |
|
90 |
-17. Install vim |
|
91 |
- apt-get install vim |
|
92 |
- |
|
93 |
-18. Optionally copy pi backup archive from the ssh client to |
|
94 |
- the /home/pi folder |
|
95 |
- scp pi.zip pi@nodepower.local:~ |
|
96 |
- |
|
97 |
-19. Restore files and directories from backup archive by running |
|
98 |
- unzip pi.zip |
|
99 |
- Use 'mv' to move folders and files to their appropriate locations. |
|
100 |
- |
|
101 |
-20. Make backups of /etc/rc.local, /etc/motd. Then, acting as superuser |
|
102 |
- copy to /etc from the unzipped directory the files rc.local and motd. |
|
103 |
- |
|
104 |
-21. Install rrdtool |
|
105 |
- sudo apt-get install rrdtool |
|
106 |
- |
|
107 |
-22. Install web server |
|
108 |
- |
|
109 |
- Apache2 |
|
110 |
- ====== |
|
111 |
- sudo apt-get install apache2 -y |
|
112 |
- sudo a2enmod rewrite |
|
113 |
- sudo service apache2 restart |
|
114 |
- |
|
115 |
- PHP |
|
116 |
- === |
|
117 |
- sudo apt-get install php libapache2-mod-php -y |
|
118 |
- sudo service apache2 restart |
|
119 |
- |
|
120 |
-23. Acting as superuser, backup and then modify |
|
121 |
- /etc/apache2/mods-available/userdir.conf |
|
122 |
- |
|
123 |
- # changed {date} by {name} to allow user .htacess file |
|
124 |
- #AllowOverride FileInfo AuthConfig Limit Indexes |
|
125 |
- AllowOverride All |
|
126 |
- |
|
127 |
-24. Enable user directories in apache2 |
|
128 |
- sudo a2enmod userdir |
|
129 |
- |
|
130 |
-25. Acting as superuser, backup and then modify |
|
131 |
- /etc/apache2/sites-available/000-default.conf |
|
132 |
- |
|
133 |
- # changed 12-06-2019 by JLO to make user pi the html document root |
|
134 |
- #DocumentRoot /var/www/html |
|
135 |
- DocumentRoot /home/pi/public_html |
|
136 |
- |
|
137 |
-26. Acting as superuser, backup and then modify |
|
138 |
- /etc/apache2/mods-available/php7.3.conf to allow user directories |
|
139 |
- by commenting the lines at bottom of file. E.g., |
|
140 |
- |
|
141 |
- #<IfModule mod_userdir.c> |
|
142 |
- # <Directory /home/*/public_html> |
|
143 |
- # php_admin_flag engine Off |
|
144 |
- # </Directory> |
|
145 |
- #</IfModule> |
|
146 |
- |
|
147 |
-27. Enable php in apache2 |
|
148 |
- sudo a2enmod php7.3 |
|
149 |
- |
|
150 |
-28. Acting as superuser, backup and then modify /etc/apache2/envvars |
|
151 |
- to create apache2 logs in tmpfs. Add the following lines at the top |
|
152 |
- of the file |
|
153 |
- |
|
154 |
- if [ ! -d /var/log/apache2 ]; then |
|
155 |
- mkdir /var/log/apache2 |
|
156 |
- fi |
|
157 |
- |
|
158 |
-29. Acting as superuser, enable apache2 to access files the tmpfs /tmp |
|
159 |
- directory by backing up and then modifying |
|
160 |
- /lib/systemd/system/apache2.service |
|
161 |
- |
|
162 |
- # changed {date} by {name} to allow apache to follow symlinks |
|
163 |
- # to the /tmp folder in tmpfs |
|
164 |
- #PrivateTmp=true |
|
165 |
- PrivateTmp=false |
|
166 |
- |
|
167 |
-30. Reload system deamons |
|
168 |
- sudo systemctl daemon-reload |
|
169 |
- |
|
170 |
-31. Restart apache2 service |
|
171 |
- sudo systemctl restart apache2 |
|
172 |
- |
|
173 |
-32. Install i2c smbus python library by running |
|
174 |
- sudo apt-get install python-smbus |
|
175 |
- |
|
176 |
-33. Reboot the Pi Zero by running 'sudo reboot'. |
|
177 |
- |
|
178 |
-34. Test all above modifications. |
|
179 |
- |
|
180 |
- |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,180 @@ |
1 |
+Raspbian 'stretch' - system build notes |
|
2 |
+ |
|
3 |
+1. Copy os disk image to SD card. |
|
4 |
+ |
|
5 |
+2. Mount the SD card to the host computer and navigate |
|
6 |
+ to the boot volume of the SD card. |
|
7 |
+ |
|
8 |
+3. If using wired Ethernet, skip to step 6. |
|
9 |
+ |
|
10 |
+4. Edit the wpa_supplicant.conf file with your wifi ssid and |
|
11 |
+ wifi password. |
|
12 |
+ |
|
13 |
+5. Copy the wpa_supplicant.conf file to the root of the boot |
|
14 |
+ volume. |
|
15 |
+ |
|
16 |
+6. Create an empty file named "ssh" in the root of the boot |
|
17 |
+ volume. |
|
18 |
+ |
|
19 |
+7. Unmount the SD card and install in the Pi Zero. Apply |
|
20 |
+ power and boot up the Pi Zero. |
|
21 |
+ |
|
22 |
+8. Secure shell into the Pi Zero by running |
|
23 |
+ ssh pi@raspberrypi.local |
|
24 |
+ The password is 'raspberry' |
|
25 |
+ |
|
26 |
+9. Configure the following by running |
|
27 |
+ sudo raspi-config |
|
28 |
+ In System Options modify the following |
|
29 |
+ hostname: nodepower |
|
30 |
+ password: YOUR_PASSWORD |
|
31 |
+ In Interface Options modify the following |
|
32 |
+ I2C: ON |
|
33 |
+ In Localisation Options modify the following |
|
34 |
+ Locale: en_US.UTF-8 UTF-8 |
|
35 |
+ Timezone: PACIFIC |
|
36 |
+ Keyboard: US |
|
37 |
+ WLAN: US |
|
38 |
+ |
|
39 |
+10. If using wired Ethernet, disable wifi by adding the following |
|
40 |
+ line to the end of the /boot/config.txt file |
|
41 |
+ dtoverlay=disable-wifi |
|
42 |
+ This helps to conserve power. |
|
43 |
+ |
|
44 |
+11. Disable Bluetooth by adding the following line to the end of |
|
45 |
+ the '/boot/config.txt' file: |
|
46 |
+ dtoverlay=disable-bt |
|
47 |
+ This helps to conserve power. |
|
48 |
+ [Optional] Run the once off command: |
|
49 |
+ sudo systemctl disable hciuart |
|
50 |
+ |
|
51 |
+12. Set up ssh keys on client and import the public key |
|
52 |
+ to the Pi Zero .ssh directory. Create .ssh directory |
|
53 |
+ on the Pi Zero. In .ssh create a file authorized_keys |
|
54 |
+ and copy the public key to it. |
|
55 |
+ |
|
56 |
+13. Backup and then modify /etc/ssh/sshd_config as follows |
|
57 |
+ |
|
58 |
+ #PermitRootLogin prohibit-password |
|
59 |
+ PermitRootLogin no |
|
60 |
+ |
|
61 |
+ #X11Forwarding yes |
|
62 |
+ X11Forwarding no |
|
63 |
+ |
|
64 |
+ Optionally turn off password authentication |
|
65 |
+ |
|
66 |
+ #PasswordAuthentication yes |
|
67 |
+ PasswordAuthentication no |
|
68 |
+ |
|
69 |
+14. Setup tmpfs by backup and then modifying /etc/fstab. Add |
|
70 |
+ the following lines to the bottom of the file. |
|
71 |
+ |
|
72 |
+ # uncomment if needed for web apps |
|
73 |
+ # These changes store all non-essential logs in ram to reduce |
|
74 |
+ # stress on the SD card due to frequent writes. |
|
75 |
+ tmpfs /tmp tmpfs nodev,nosuid,size=20M 0 0 |
|
76 |
+ tmpfs /var/tmp tmpfs defaults,noatime,nosuid,size=20m 0 0 |
|
77 |
+ tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=20m 0 0 |
|
78 |
+ tmpfs /var/spool/mqueue tmpfs defaults,noatime,nosuid,mode=0700,gid=12,size=20m 0 0 |
|
79 |
+ |
|
80 |
+15. Reboot the Pi Zero by running |
|
81 |
+ sudo reboot |
|
82 |
+ |
|
83 |
+16. Run updates by running the commands |
|
84 |
+ sudo apt-get update |
|
85 |
+ |
|
86 |
+ Optionally run all software updates |
|
87 |
+ sudo apt-get upgrade |
|
88 |
+ sudo reboot |
|
89 |
+ |
|
90 |
+17. Install vim |
|
91 |
+ apt-get install vim |
|
92 |
+ |
|
93 |
+18. Optionally copy pi backup archive from the ssh client to |
|
94 |
+ the /home/pi folder |
|
95 |
+ scp pi.zip pi@nodepower.local:~ |
|
96 |
+ |
|
97 |
+19. Restore files and directories from backup archive by running |
|
98 |
+ unzip pi.zip |
|
99 |
+ Use 'mv' to move folders and files to their appropriate locations. |
|
100 |
+ |
|
101 |
+20. Make backups of /etc/rc.local, /etc/motd. Then, acting as superuser |
|
102 |
+ copy to /etc from the unzipped directory the files rc.local and motd. |
|
103 |
+ |
|
104 |
+21. Install rrdtool |
|
105 |
+ sudo apt-get install rrdtool |
|
106 |
+ |
|
107 |
+22. Install web server |
|
108 |
+ |
|
109 |
+ Apache2 |
|
110 |
+ ====== |
|
111 |
+ sudo apt-get install apache2 -y |
|
112 |
+ sudo a2enmod rewrite |
|
113 |
+ sudo service apache2 restart |
|
114 |
+ |
|
115 |
+ PHP |
|
116 |
+ === |
|
117 |
+ sudo apt-get install php libapache2-mod-php -y |
|
118 |
+ sudo service apache2 restart |
|
119 |
+ |
|
120 |
+23. Acting as superuser, backup and then modify |
|
121 |
+ /etc/apache2/mods-available/userdir.conf |
|
122 |
+ |
|
123 |
+ # changed {date} by {name} to allow user .htacess file |
|
124 |
+ #AllowOverride FileInfo AuthConfig Limit Indexes |
|
125 |
+ AllowOverride All |
|
126 |
+ |
|
127 |
+24. Enable user directories in apache2 |
|
128 |
+ sudo a2enmod userdir |
|
129 |
+ |
|
130 |
+25. Acting as superuser, backup and then modify |
|
131 |
+ /etc/apache2/sites-available/000-default.conf |
|
132 |
+ |
|
133 |
+ # changed 12-06-2019 by JLO to make user pi the html document root |
|
134 |
+ #DocumentRoot /var/www/html |
|
135 |
+ DocumentRoot /home/pi/public_html |
|
136 |
+ |
|
137 |
+26. Acting as superuser, backup and then modify |
|
138 |
+ /etc/apache2/mods-available/php7.3.conf to allow user directories |
|
139 |
+ by commenting the lines at bottom of file. E.g., |
|
140 |
+ |
|
141 |
+ #<IfModule mod_userdir.c> |
|
142 |
+ # <Directory /home/*/public_html> |
|
143 |
+ # php_admin_flag engine Off |
|
144 |
+ # </Directory> |
|
145 |
+ #</IfModule> |
|
146 |
+ |
|
147 |
+27. Enable php in apache2 |
|
148 |
+ sudo a2enmod php7.3 |
|
149 |
+ |
|
150 |
+28. Acting as superuser, backup and then modify /etc/apache2/envvars |
|
151 |
+ to create apache2 logs in tmpfs. Add the following lines at the top |
|
152 |
+ of the file |
|
153 |
+ |
|
154 |
+ if [ ! -d /var/log/apache2 ]; then |
|
155 |
+ mkdir /var/log/apache2 |
|
156 |
+ fi |
|
157 |
+ |
|
158 |
+29. Acting as superuser, enable apache2 to access files the tmpfs /tmp |
|
159 |
+ directory by backing up and then modifying |
|
160 |
+ /lib/systemd/system/apache2.service |
|
161 |
+ |
|
162 |
+ # changed {date} by {name} to allow apache to follow symlinks |
|
163 |
+ # to the /tmp folder in tmpfs |
|
164 |
+ #PrivateTmp=true |
|
165 |
+ PrivateTmp=false |
|
166 |
+ |
|
167 |
+30. Reload system deamons |
|
168 |
+ sudo systemctl daemon-reload |
|
169 |
+ |
|
170 |
+31. Restart apache2 service |
|
171 |
+ sudo systemctl restart apache2 |
|
172 |
+ |
|
173 |
+32. Install i2c smbus python library by running |
|
174 |
+ sudo apt-get install python-smbus |
|
175 |
+ |
|
176 |
+33. Reboot the Pi Zero by running 'sudo reboot'. |
|
177 |
+ |
|
178 |
+34. Test all above modifications. |
|
179 |
+ |
|
180 |
+ |