Ubuntu 16.04

apt | apt-get

  • Package management

List install packages

apt list --installed

Search packages

apt-cache search python3.6
apt search python3.6

Install packages



apt-get update
apt-get install nginx

# start
systemctl restart nginx

Python3.6 on 16.04

  • Ubuntu 17.10 already comes with Python 3.6 as default. Just run python3 to invoke it.
  • Keep existing Python3.5
    add-apt-repository ppa:jonathonf/python-3.6
    apt-get update
    apt-get install python3.6 python3.6-venv python3.6-dev
  • setup pip3.6
    #download get-pip.py
    curl -OL https://bootstrap.pypa.io/get-pip.py
    sudo python3.6 get-pip.py

MongoDB 3.6.2

  • ref:
  • Import the public key used by the package management system.
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
  • Create a list file for MongoDB
    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
  • Reload local package database
    sudo apt-get update
  • Install the MongoDB packages.
    sudo apt-get install -y mongodb-org
  • Default Locations
    • conf: /etc/mongod.conf
    • storage location: /var/lib/mongodb/
    • log: /var/log/mongodb
  • Update default conf
    sudo mkdir -p /mnt/mongodb/log
    sudo chown -R mongodb:mongodb /mnt/mongodb
  • Start mongoDB
    sudo service mongod restart
  • Check if it's up
    cat /mnt/mongodb/log/mongod.log


Change Hostname

hostname "www.abc.com"
echo "www.abc.com" > /etc/hostname

# to point to local: edit /etc/hosts localhost abc.com www.abc.com


Check Firewall Status

sudo ufw status
sudo ufw status verbose

Check iptables status

service iptables status
service ip6tables status

Setup WSGI with Apache24

Setup SSL with Apache24

Setup mod_wsgi complied with python3.6 on 16.04

  • ref: https://github.com/ceos-seo/data_cube_ui/issues/2
  • uninstall libapache2-mod-wsgi-py3 and libapache2-mod-wsgi
    apt-get remove libapache2-mod-wsgi-py3 libapache2-mod-wsgi
  • On System ( not in virtualenv )
    # First make sure if pip is up-to-date ( pip3.6.3 install --upgrade pip )
    pip3.6 install mod_wsgi
  • Print apache conf which need to be appended
    sudo sh -c 'mod_wsgi-express module-config > /etc/apache2/conf-enabled/mod_wsgi363.conf';cat /etc/apache2/conf-enabled/mod_wsgi363.conf
  • reboot apache
    sudo systemctl restart apache2
  • check mod_wsgi and apache
    cat /var/log/apache2/error.log | grep mod_wsgi

Setup cron

sudo service cron restart|stop|start

Init Ubuntu 16.04

Last modified 2 years ago Last modified on 02/05/18 21:24:26