Server School
Learn to setup, configure, manage, and run state-of-the-art servers for cutting-edge cloud-based enterprise data systems.
7 November 2017 python and ipython notebook
# as root
su -l
apt-get install python-pip
apt-get install python3-pip
pip install --upgrade pip
pip3 install --upgrade pip
pip install jupyter
pip3 install jupyter
apt-get install texlive-xetex
exit
# as user
python2 -m pip install ipykernel
python2 -m ipykernel install --user
python3 -m pip install ipykernel
python3 -m ipykernel install --user
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
cd ~j/.jupyter
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
jupyter notebook --generate-config
jupyter notebook password
emacs jupyter_notebook_config.py
Then edit the config file and add these lines underneath the top line, which is a comment that states: "Configuration file for jupyter-notebook"
c = get_config()
c.NotebookApp.certfile = u'/home/j/.jupyter/mycert.pem'
c.NotebookApp.keyfile = u'/home/j/.jupyter/mykey.key'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 1234 # pick a random port number here above 1024 -- don't just use 1234
Then run the server:
jupyter notebook
24 October 2017 Enterprise Data Systems Software
# update
apt-get update
apt-get upgrade
apt-get dist-upgrade
# test perl version
perl -v # 5.24.1
# test r version
apt-cache search '^r-.*' | more
apt-get install r-base
# and do python and python3
apt-get install python{,3}-numpy python{,3}-matplotlib python{,3}-pandas
apt-get install libjpeg-turbo-progs
Debian tricks
- su -l
- login to root
-
17 October 2017: KVM SolusVM
When you buy a new KVM server, it's "pre-configured" and may be running. Let's shut it down and start over doing things the right way.
- Check the IP address. Write it down. Then set the identifier of your server to clearly distinguish it from all your others. Believe me, you don't want to ever wipe the wrong server! For me, this ends with .190.150.
- Click manage. Click hostname. Change it. For me, I chose, eds1, for enterprise data systems one.
- Now click Settings / Boot Order / 1 CDROM 2 Hard Disk. Click CDRom / Debian 9 64-bit, and click Mount.
- Click Shutdown (good in case any outside network settings have been improved in the interim). Wait. Then click Boot. Success! Virtual Server Booted!
- Click VNC / HTML 5 VNC Client SSL. Let it open.
- Choose Graphical Install. (Press return.)
- Select a language. Click continue. Location (yours) / (mine) United States. Continue. American English keyboard. Continue. Detect and mount CDROM. (Automatic).
- Configure the network. Choose ens3 (or ens4) network interface.
- Host name: enter eds1 (or your own name)
- Domain name: enter your own name such as yourwebsite.com
- Root password: enter a random password 15-20 characters long. Write it down on paper, not digitally. Hackers in Russia cannot find that piece of paper.
- Real name of user. Enter.
- User name of user. I choose one letter "a" for the www root account. I choose one letter my first initial for my own account.
- Password. Likewise.
- I choose Pacific Time. I like to choose time a few hours ahead of my own time zone. Early morning is a more convenient time for daily rotation tasks to happen. And for real world events as well. For example, if I'm photographing a wedding, it might run after midnight, and when organizing the photos I wouldn't want the event to be artificially broken apart into two separate photo catalogs.
- Paritioning. Guided - use entire disk.
- Virtual disk 1 - 184.7 GB Virtio Block Device
- All files in one partition. Finish partitioning and write changes to disk. Continue. Choose "Yes." Continue again.
- Scan another CD or DVD? Check No. Continue. Package manager. Choose your country (United States). ftp.us.debian.org. Proxy: blank.
- Popularity contest. I choose Yes.
- Choose software to install. I choose Xfce, SSH server, and standard system utilities and leave all but these three checkboxes blank. (Uncheck print server and the regular desktop environment.)
- Retrieving file x of 1078...
- Install GRUB boot loader to master boot record. Yes. Choose /dev/vda
- Go back to the SolusVM window.
- Click on CDRom and click "Unmount" below the mountec CD.
- Instead of clicking Continue on the "Installation is complete screen", choose Reboot in the Solus VM window. Are you sure? Click yes.
- You'll need to click in the URL bar of the VNC window and do Control-R to refresh.
- Login as yourself (for me, the one letter user name mentioned above).
- If you want to make VNC more efficient, you can download VNC viewer from here
Download VNC Viewer.
Same with Linode
Do add linode. Choose 64-bit / Debian 9.
Software to install
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install nginx