SSH
sudo systemctl status ssh
IP
ip a
Config SSH Listen on an address
sudo nano /etc/ssh/sshd_config
Restart SSH
sudo systemctl restart ssh
Enable Firewall
sudo ufw enable
Allow SSH From Firewall
sudo ufw allow "OpenSSH"
Update && Upgrade
sudo apt update && sudo apt upgrade
See Timezone
timedatectl
Edit TimeSync
sudo nano /etc/systemd/timesyncd.conf
NTP
NTP=fw.eng.ku.ac.th time.uni.net.th
Restart TimeSync
sudo systemctl restart systemd-timesyncd.service
Edit Timezone
sudo dpkg-reconfigure tzdata
Create Group
sudo groupadd -g 20000 webDeveloper && sudo groupadd -g 20001 dbDeveloper
Create User webAdmin
sudo useradd webAdmin
Setting Password webAdmin
sudo passwd webAdmin
Create User dbAdmin
sudo useradd dbAdmin
Setting Password dbAdmin
sudo passwd dbAdmin
Make Sure User was created
sudo cat /etc/passwd
Add User To Group
sudo usermod -aG webDeveloper webAdmin
Manage Permission webAdmin
sudo mkdir webAdmin
Manage Permission dbAdmin
sudo mkdir dbAdmin
Chown WebAdmin
sudo chown webAdmin:webDeveloper webAdmin/
Chown dbAdmin
sudo chown dbAdmin:dbDeveloper dbAdmin/
Permission webAdmin
sudo chmod 751 webAdmin/
Permission dbAdmin
sudo chmod 751 dbAdmin/
Docker Install
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt-cache policy docker-ce
sudo apt install docker-ce
sudo usermod -aG docker ${USER}
sudo usermod -aG docker webadmin
sudo usermod -aG docker dbadmin
Portainer
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Nginx Reverse Proxy Manager
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
MongoDB
version: "3"
services:
mongodb:
image: mongo:4.4.6
container_name: SPA_DBS
ports:
- 27018:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=dbAdmin
- MONGO_INITDB_ROOT_PASSWORD=123456789
restart: unless-stopped
Mongo Config
mongo -u dbAdmin -p --authenticationDatabase admin
Mongo Create User
db.createUser(
{
user: "spaAdmin",
pwd: passwordPrompt(),
roles: [ { role: "readWrite", db: "ceboostup" }]
}
)
Mongo Connect
mongo -u spaAdmin -p --authenticationDatabase ceboostup
Mongo Connect (Node Application)
mongodb://spaAdmin:[email protected]:27018/ceboostup?authSource=ceboostup
FRONTEND
git clone https://github.com/BarwSirati/FRONTEND_CEBOOSTUPX.git
BACKEND
git clone https://github.com/BarwSirati/BACKEND_CEBOOSTUPX.git
Grader
git clone https://github.com/BarwSirati/GRADER_CEBOOSTUPX.git