Skip to content

Instantly share code, notes, and snippets.

@willywotz
Last active October 21, 2020 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willywotz/b548c77fdd97af075745206552a4f3b4 to your computer and use it in GitHub Desktop.
Save willywotz/b548c77fdd97af075745206552a4f3b4 to your computer and use it in GitHub Desktop.
sudo su
ip a
nano /etc/netplan/00-installer-config.yaml
```
network:
ethernets:
ens33:
addresses:
- 192.168.0.200/24
gateway4: 192.168.0.1
nameservers:
addresses:
- 1.1.1.1
- 1.0.0.1
optional: true
version: 2
```
netplan apply
ip a
ping google.com
apt-get update
apt-get install phpmyadmin mysql-server
เลือก apache2 กด ok
ในส้วนของ mysql phpmyadmin password ให้เลือก ok ได้เลย
mysql
alter user root@localhost identified with mysql_native_password by 'ใส่รหัสผ่านฐานข้อมูลที่ต้องการ';
flush privileges;
exit
แล้วเปิด browser ดูได้เลย
ลง wordpress
mysql -u root -p -e "create database ใส่ชื่อฐานข้อมูลที่ต้องการ" # แล้วใส่รหัสผ่านฐานข้อมูล
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar zxvf latest.tar.gz
chown -R www-data.www-data wordpress
ลง dhcp [อันนี้ไม่ต้องลง]
apt-get install dnsmasq
nano /etc/dnsmasq.conf
```
# line 158: add ranges of IP address to lease and term of lease
dhcp-range=10.0.0.200,10.0.0.250,12h
# line 332: add entries for Gateway, NTP, DNS, Subnetmask
dhcp-option=option:router,10.0.0.1
dhcp-option=option:dns-server,8.8.8.8
dhcp-option=option:netmask,255.255.255.0
```
systemctl restart dnsmasq
nano /etc/rc.local
```
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o การ์ดใบสอง -j MASQUERADE
exit 0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment