Wednesday, January 20, 2016

Setting Up a Home Centos 7 Server

I have a little Zotac Zbox server at home that I've been running for several years with Ubuntu server.  It has a 500 GiB hard drive, 2 Gigs of RAM, and a dual-core 1.8 GHz Atom processor.  It is small, quiet (silent, actually) and sits unobtrusively on a shelf. It is truly a wonderful little device, and I've made good use of it for learning server administration in a safe and inexpensive way. DynDNS provides me with a domain name that I can use to access it from the outside world since it is sitting at home on my Comcast connection.

Since I am preparing for the RHCSA this Spring, I figured I should install Centos 7 on it. To do the install, I needed to connect it to a monitor, keyboard, and mouse. I setup the following LVM partitions:
/boot 500 MiB xfs
swap 1 GiB
/ 20 GiB xfs
/var 197 GiB ext4
/home 241 GiB ext4
and did a minimal install, then ran:
# yum update
# yum install net-tools
# yum install vim
The next task was to configure it to have a static IP address, after which I could unplug it from the monitor, keyboard, and mouse and put it back on the shelf. To set a static IP address, I used this and this web pages as guides.  I ran:
# vi /etc/sysconfig/network-scripts/ifcfg-ens32
and changed:
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens32"
UUID="aed7d424-7293-4db7-8a89-c25f77557bf9"
DEVICE="ens32"
ONBOOT="yes"
to:
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens32"
UUID="aed7d424-7293-4db7-8a89-c25f77557bf9"
DEVICE="ens32"
ONBOOT="yes"
HWADDR="00:01:2e:bd:15:e3"
IPADDR="10.0.0.254"
PREFIX="24"
GATEWAY="10.0.0.1"
DNS="10.0.0.1"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"

I tested that I could connect to the new server from outside, and it worked, but it actually took more than 2 minutes to connect.  I'll have to look into why that is.

 

Symlinking python3 to python3.4


Next I installed Python 3.4 (since what use is a computer without Python 3?) using the steps I described in my previous post.

To be able to type python3 instead of python3.4 to launch this version of Python, I made a symbolic link.  First I took a look at the .bash_profile file, which contained the following:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
.local/bin is being added to the PATH, but I didn't yet have this directory, so I made it and then changed directories to it:
$ mkdir .local$ mkdir .local/bin
$ cd .local/bin
from here I ran:
$ which python3.4
to find out where it was located, and then made the symlink:
$ ln -s /usr/bin/python3.4 python3
after which I could launch Python 3 they way I wanted, as the following screenshot shows:


No comments:

Post a Comment