respberry pi 4 ubuntu setup scripts notes
How to install Ubuntu on your Raspberry Pi
- Download Raspberry Pi Imager for Windows
- Execute imager.exe; Select OS(Ubuntu 64bit 20.04) and Disk(MicroSD) then Write
- Insert Micro SD to Respberry Pi, then boot
- timedatectl set-timezone Asia/Taipei
- systemctl enable rc-local
- systemctl start rc-local
- vim /etc/netplan/50-cloud-init.yaml
- service networking restart
- apt install pppoeconf
- pppoeconf
- apt install hostapd
- vim /etc/network/interfaces
- vim /etc/hostapd/hostapd.conf
- systemctl unmask hostapd
- systemctl enable hostapd
- service hostapd start
- iptables -F -t nat
- iptables -F
- iptables --delete-chain
- iptables --delete-chain -t nat
- iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
- apt install isc-dhcp-server
- vim /etc/dhcp/dhcpd.conf
- service isc-dhcp-server restart
Raspberry Pi: Install Apache + MySQL + PHP (LAMP Server)
- apt install apache2
- apt install php
- apt install mariadb-server php-mysql
- mysql_secure_installation
- mysql
- CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
- GRANT ALL PRIVILEGES ON * . * TO 'admin'@'localhost' WITH GRANT OPTION;
- FLUSH PRIVILEGES;
- apt install phpmyadmin
- apt install monitorix
- vim /etc/monitorix/monitorix.conf
- service monitorix restart
- vim /etc/apache2/conf-available/monitorix.conf
- a2enconf monitorix
- a2enmod cgi
- systemctl reload apache2