ubuntu_cs

You might also like

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

Ubuntu 18.

04 Server Configuration Cheat Sheet


by doublehelix via cheatography.com/27391/cs/19030/

Ubuntu Server 18.04 Install Webmin (cont)

sudo apt-key add jcamer​on-​key.asc

4. Update packages including the Webmin repository


sudo apt update

5. Install Webmin
apt - Advanced Packaging Tool sudo apt install webmin
Update available packages sudo apt update Once the instal​lation finishes, you'll be presented with the following
Upgrades all currently installed packages sudo apt upgrade output:

Remove packages that are no longer sudo apt autore​‐ Webmin install complete. You can now login to https:​//y​our​_se​rve​r_i​‐
required move p:10000 as root with your root password, or as any user who can
use sudo.
http:/​/ma​npa​ges.ub​unt​u.c​om/​man​pag​es/​cos​mic​/ma​n8/​apt.8.html
Add port 10000 to your firewall

ufw - Uncomp​licated Firewall sudo ufw allow 10000

1. Install ufw sudo apt install ufw https:​//w​ww.d​ig​ita​loc​ean.co​m/c​omm​uni​ty/​tut​ori​als​/ho​w-t​o-i​nst​all​-we​‐

2 Setup default policies sudo ufw default deny incoming bmi​n-o​n-u​bun​tu-​18-04


or
sudo ufw default allow outgoing
http:/​/ww​w.w​ebm​in.c​om​/de​b.html
3. Allow SSH sudo ufw allow 22

...or sudo ufw allow ssh Install Apache 2.4

4. Enable ufw sudo ufw enable Install Apache 2.x sudo apt install apache2

5. Allow other connec​tions ... or, as a single sudo apt update && apt-get

...Apache sudo ufw allow 'Apache Full' command install apache2

...Webmin sudo ufw allow 10000 Enable ports through ufw sudo ufw allow http && ufw
firewall allow https
View current ufw status sudo ufw status verbose
... or, via pre-de​fined app sudo ufw allow 'Apache Full'
https:​//h​elp.ub​unt​u.c​om/​com​mun​ity/UFW
settings
or
Start Apache sudo apachectl start
https:​//w​ww.d​ig​ita​loc​ean.co​m/c​omm​uni​ty/​tut​ori​als​/ho​w-t​o-s​et-​up-​a-f​‐
ire​wal​l-w​ith​-uf​w-o​n-u​bun​tu-​18-04 Restart Apache after sudo apachectl restart
changing settings
Install Webmin Where is Apache installed which apache2
1. Edit the sour​ces list https:​//h​elp.ub​unt​u.c​om/​lts​/se​rve​rgu​ide​/ht​tpd.html
sudo nano /etc/a​pt/​sou​rce​s.list or

Add the following line to your sources file https:​//w​ww.d​ig​ita​loc​ean.co​m/c​omm​uni​ty/​tut​ori​als​/ho​w-t​o-i​nst​all​-th​e-


a​pac​he-​web​-se​rve​r-o​n-u​bun​tu-​18-04
deb https:​//d​own​loa​d.w​ebm​in.c​om​/do​wnl​oad​/re​pos​‐
itory sarge contrib

2. Download the Webmin PGP key


wget http:/​/ww​w.w​ebm​in.c​om​/jc​ame​ron​-ke​y.asc

3. Install the Webmin PGP key

By doublehelix Published 13th March, 2019. Sponsored by Readable.com


Last updated 9th April, 2019. Measure your website readability!
Page 1 of 2. https://readable.com

cheatography.com/doublehelix/
Ubuntu 18.04 Server Configuration Cheat Sheet
by doublehelix via cheatography.com/27391/cs/19030/

Install PHP Install MongoDB

1. Install sudo apt install php libapa​che​2-m​od-php Install MongoDB package sudo apt install -y mongod​b-
PHP org
2. Restart sudo systemctl restart apache2 Check MongoDB service sudo systemctl status mongodb
Apache status
Check where which php Start MongoDB sudo systemctl start
PHP is mongod.se​rvice
installed
Stop MongoDB sudo systemctl stop
Check PHP php -v mongod.se​rvice
version
Restart the MongoDB sudo systemctl restart
Check INI php --ini
service mongodb
file config​‐
Enable automatic service sudo systemctl enable
uration
startup mongod.se​rvice
Dump PHP php --info
config​uration Disable automatic service sudo systemctl disable
startup mongodb
Install apt-get install php-pear php-fpm php-
optional dev php-zip php-curl php-xmlrpc php-gd https:​//w​ww.d​ig​ita​loc​ean.co​m/c​omm​uni​ty/​tut​ori​als​/ho​w-t​o-i​nst​all​-mo​‐
modules php-mysql php-mb​string php-xml libapa​‐ ngo​db-​on-​ubu​ntu​-18-04
che​2-m​od-php or
https:​//d​ocs.mo​ngo​db.c​om​/ma​nua​l/t​uto​ria​l/i​nst​all​-mo​ngo​db-​on-​‐
check all the apt-cache search --name​s-only ^php
ubuntu/
PHP
or
modules
https:​//w​ebs​ite​for​stu​den​ts.c​om​/in​sta​ll-​mon​god​b-o​n-u​bun​tu-​18-​04-​‐
available in
lts​-be​ta-​server/
Ubuntu

https:​//h​elp.ub​unt​u.c​om/​lts​/se​rve​rgu​ide​/ph​p.h​tml.en-AU
or
https:​//t​his​hos​tin​g.r​ock​s/i​nst​all​-ph​p-o​n-u​buntu/

Install MySQL

Install MySQL sudo apt install mysql-​server

Once the instal​lation is complete, the MySQL server should be


started automa​tic​ally.
Check the status of sudo netstat -tap | grep
MySQL mysql

Start the service (if not sudo systemctl restart


running) mysql.s​er​vice

https:​//h​elp.ub​unt​u.c​om/​lts​/se​rve​rgu​ide​/my​sql.ht​ml.en
or
https:​//w​ww.d​ig​ita​loc​ean.co​m/c​omm​uni​ty/​tut​ori​als​/ho​w-t​o-i​nst​all​-th​e-
l​ate​st-​mys​ql-​on-​ubu​ntu​-18-04

By doublehelix Published 13th March, 2019. Sponsored by Readable.com


Last updated 9th April, 2019. Measure your website readability!
Page 2 of 2. https://readable.com

cheatography.com/doublehelix/

You might also like