How to install CentOS 6 in SXL Cloud VDC

CentOS is a popular Linux server distribution. This article will show you how to install a minimal CentOS-6 64-bit OS in SXL Cloud Virtual Data Centre.

== Prepare for the installation ==
Please read [[How to use SXL Virtual Data Center]] if you haven't read it yet.
# Login to SXL VDC using your own username and password.

# Change to Folder View and open the Virtual Machine group.

# Select the virtual machine you want to change. In this example, we choose "server".
# Open the Hardware tab, verify the hardware configuration is the same as what you ordered.

# Now, we will insert the CentOS ISO image to our CDROM.
## Double-click the CD/DVD Drive.

## Select Use CD/DVD disc image file (ISO).
## In Storage, select "nas".
## In ISO Image, select "CentOS-6.4-x86_64-minimal.iso"
## Click OK.

== Install CentOS 6 ==
# Open the Console. (You need to have [[http://www.java.com|Java]] installed. Click Accept if you receive warnings from Java that wants to run).

# Click Start. The virtual machine will start up.

# The CentOS installer should start. If not, you may need to press the [F12] function key immediately after start, and then choose to boot from CD/DVD ROM.
# Install CentOS as you would on a physical machine. We bet you already know how to do it.
## Select "Install or Upgrade an existing system" and wait for the CentOS installer to start, it may take 1-2 minutes.

## On the Disc Found screen, press the right arrow key [→] to choose [Skip] and then press Enter.

## On the next screen, click Next.

## Choose English and then click Next.

## Choose US English and then click Next.

## Choose Basic Storage Device and click Next.

## Click Yes, discard my data.

## Input fully qualified domain name, in my example is "erp.example.local", then click Next.

## Choose Asia/Hong_Kong, click Next.

## Input your desired password twice, click Next.

## Choose Use all space, click Next.

## Click Write changes to disk.

## The installation will begin. Please wait patiently until it is completed.

## Click Reboot after the installation is done.

## If there is something wrong during the installation and you want to start over, click [Stop], wait 5 seconds for the server to clean up temporary files, and then click [Start] again.

== Setting up CentOS 6 ==
By default, CentOS 6 minimal edition does not come with network and any packages installed. So we are going to configure the network and install some basic packages on our new virtual machine.

# Start the virtual machine, login as ##root## with the password you specified during the installation.
# Start the network.
##ifconfig eth0 up##
# Start the DHCP client.
##dhclient##
# Now, your virtual machine should got an IP address and should be able to connect to the internet. Verify it by ##ping hk.yahoo.com##. If you can't get an IP address, verify that you have DHCP server enabled on your pfSense firewall or another server on your vLAN.
# We will install the package to manage network and the ACPI daemon. The "acpid" package is necessary because it let you nicely shutdown the virtual machine from the Java console.
##yum -y install system-config-network-tui acpid##
# Edit the network script to make the eth0 device to start up on every boot.
##vi /etc/sysconfig/network-scripts/ifcfg-eth0##
# Change ONBOOT to yes.
##ONBOOT=yes##
# Change our virtual machine to use a static IP address and configure DNS, gateway, etc.
##system-config-network##
# Choose Device Configuration.

# Choose ##eth0##.

# Input your own network configuration and choose OK.

# Choose Save.

# Choose Save and Quit.
# Now, we are done with our network setup. Let's reboot our virtual machine.
##reboot##

== Install Gnome graphical desktop ==
# If you want to have Gnome graphical desktop, run this command.
##yum groupinstall basic-desktop desktop-platform x11 fonts##

== Manage your server by SSH ==
The recommended way to manage your servers is to use VPN. We don't need to open any un-necessary ports by using VPN. Please read the following article on how to do it.
* [[How to setup pfSense OpenVPN for Remote Access]]
* [[How to install and use pfSense OpenVPN Client for Windows]]

Another method is to open the SSH port on your pfSense firewall and forward it to your virtual machine. Please make sure you use strong password (for all accounts) if you do this. Please read the following article on how to do it.
* [[How to forward ports to your virtual machine]]

== Install additional packages ==

Install Apache, MySQL, PHP5 (LAMP)
* Please refer to [[http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-centos-6.4-lamp|this article]].

Install Gnome graphical desktop
* Run this command:
##yum groupinstall basic-desktop desktop-platform x11 fonts##

Permanent link to this article: https://www.sxl.net/how-to-install-centos-6-in-sxl-cloud-vdc/