Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

sudo apt update

sudo apt upgrade


sudo hostnamectl set-hostname
sudo passwd root

###### Install MongoDB ######


wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
sudo apt-get install gnupg
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-
org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
sudo systemctl start mongod
####################
mongo
use admin
db.createUser({user:"username", pwd:"password!", roles:[{role:"root",
db:"admin"}]})
exit
sudo vim /lib/systemd/system/mongod.service

================================================================
##On the 'ExecStart' line 9, add the new option '--auth'.
ExecStart=/usr/bin/mongod --auth --config /etc/mongod.conf
================================================================

sudo vim /etc/mongod.conf

=======================================
# network interfaces
net:
port: 26016
bindIp: 0.0.0.0

security:
authorization: 'enabled'
=======================================
sudo systemctl daemon-reload
sudo service mongod restart
sudo systemctl status mongod
sudo systemctl enable mongod.service
sudo systemctl status mongod
mongo --port 26016 --authenticationDatabase "admin" -u username -p
db.enableFreeMonitoring()
db.enableFreeMonitoring({"userReminder": "username"})
copy the URL link
exit

###### Install Apache2 & Webmin ######


sudo apt update
sudo apt install apache2
sudo vim /etc/apt/sources.list
=======================================
deb http://download.webmin.com/download/repository sarge contrib [add this to the
bottom of the file]
=======================================
wget http://www.webmin.com/jcameron-key.asc
sudo apt-key add jcameron-key.asc
sudo apt update
sudo apt install webmin
sudo vim /etc/apache2/sites-available/......conf
=======================================
<VirtualHost *:80>
ServerAdmin your_email
ServerName your_domain
ProxyPass / http://localhost:10000/
ProxyPassReverse / http://localhost:10000/
</VirtualHost>
=======================================
sudo vim /etc/webmin/miniserv.conf
=======================================
ssl=0 [change from 1 to 0]
=======================================
sudo vim /etc/webmin/config
=======================================
referers=your_domain [add this to the bottom of the file]
=======================================
sudo systemctl restart webmin
sudo a2enmod proxy_http
sudo a2ensite ....conf
sudo systemctl restart apache2
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-apache
sudo certbot --apache --email email@email.com -d admin.username.com --agree-tos
--redirect --noninteractive
sudo reboot

You might also like