Sunday, November 22, 2015

2015-11-22 Sunday - CentOS 7 Setup

I'm experimenting with setting-up a minimal CentOS 7 environment (within Oracle VirtualBox) on a Windows 7 laptop...this posting is a placeholder of information that others may find useful.

Goals:
  • 'Sharpen the saw' with regards to my hands-on skills to configure and maintain a Linux virtual machine.
  • Create a pre-configured, reusable image, that I can use for future client engagements - and in preparation for some new product development I have planned for 2016.
  • As a foundation master/controller for experimenting with Ansible and Docker.

1) Install VirtualBox (I'm using the current 5.0.10 release)

2) Download CentOS (I'm using version 7)

3) Create Your CentOS virtual machine
  • For this experiment, I chose: CentOS-7-x86_64-Minimal-1503-01.iso

4) Update your packages
  • >yum update

5) Modify Network Interface Config Files
  • Locate the appropriate files in the /etc/sysconfig/network-scripts/ directory
    • For my particular installation environment, this happened to be ifcfg-enp0s03
    • Modify the following entries in the file to have these values:
      • ONBOOT=yes
      • BOOTPROTO=dhcp
    • Restart network service
      • >sudo systemctl restart network
    • Verify that you have network access
      • >ping -c 5 google.com

6) Configure NTP Synchronization
  • Check your current system time configuration
    • >sudo timedatectl
  • Set your desired timezone, for example:
    • >sudo timedatectl set-timezone America/Los_Angeles
  • Install ntp
    • >sudo yum install ntp
  • Start and Enable the ntp service
    • >sudo systemctl start ntpd
    • >sudo systemctl enable ntpd

7) Install some networking tools...
  • >sudo yum install net-tools
  • >sudo yum install nmap

8) Enable Outside Access (e.g. from the Windows 7 machine that is running VirtualBox)

9) Ansible install
  • {TODO}

10) Java install

11) Go install
  • >sudo yum install golang
    • currently appears to install v1.4

12) Python install
  • {TODO}

13) Git install
  • >sudo yum install git.x86_64

14) Connecting to a CentOS virtual machine with Eclipse

15) Install Apache Web Server (http)
  • >sudo yum install htttpd
  • >sudo service start httpd 
  • >sudo chkconfig httpd on

16) Enable Outside Access to Apache Web Server
  • Configure firewall
    • >sudo firewall-cmd --permanent --zone=public --add-service=http
    • >sudo firewall-cmd --permanent --zone=public --add-service=https
    • >sudo firewall-cmd --reload
  • Configure iptables 
    • >sudo iptables -I INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT
    • To persist the changes, go to /etc/sysconfig/ - and add the following line to iptables
      • "-A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT"
    • >sudo service iptables restart
  •  >sudo service httpd restart
The following resource links were helpful to me, and may also be of interest to others:
You may also want to consider ordering a digital copy of this book:

No comments:

Copyright

© 2001-2021 International Technology Ventures, Inc., All Rights Reserved.