Requirements
- An USB stick with more than 4 GB of free storage
- A 64 bits server machine with plenty RAM and HDD storage
- Connectivity with CentOS Internet repositories or LAN mirrors
- A Linux client machine with an installed desktop environment: CentOS, Debian, Ubuntu, etc. + Gnome, KDE, etc.
Steps
- Download a CentOS-6.2-x86_64-bin-DVD1.iso (4.1GB) from the DVD mirrors or alternative download a minimal (322M), netinstall (227M), LiveCD (698M) or LiveDVD (1.6G) version. This how to uses CentOS-6.2-x86_64-bin-DVD1.iso (4.1GB).
- Store the downloaded ISO into de USB key via this guide. I prefer the alternatives section with livecd-iso-to-disk script.
- Connect the USB stick to one of the USB ports on the server machine and boot. Ensure that USB boot is enabled on the setup.
- On the CentOS installation wizard select Server and customize.
- Choose a wise partition schema depending on your hardware, for example 6 GB RAM + 2 x 500GB HDD:
- On the package selection step ensure that no desktop environment is selected and ensure that ssh is installed. Select any additional package you want.
- Choose a complex root password.
- Once the OS installation is completed, reboot, login as root and ensure that ssh is working via:
- By default, the eth0 network interface is disabled. Configure networking settings:
- Login as root
- Edit the archive /etc/sysconfig/network-scripts/ifcfg-eth0 and configure the network interface to look like:
- Restart networking daemon and test for connectivity with ping or other tool.
- Add a sudoer user -for example bozz- to avoid the use of root.
- Login as root
- Create a new user and add it to wheel group:
- Reset the password for bozz user (NOTE: choose a password you won't forget):
- Edit /etc/sudoers and uncomment the line starting with %wheel, it shall look like:
- Logout, login again with bozz user and test sudoer's privileges:
- Login as bozz user
- Configure CentOS repositories via LAN mirrors:
- Ensure you can connect to the LAN mirror, example: http://mirrors.home.dev/centos
- Create a new repo file at /etc/yum.repos.d/CentOS-Mirror.repo
- Append the following entries pointing to the mirror:
- Comment or delete existing repository archives
- comment every line of /etc/yum.repos.d/CentOS-Base.repo with # or just:
- delete the repository file
- Update the system using the mirror:
- Install Java JRE 7u1 64 bit on the server [Not required for Oracle Database, required for Oracle Fusion Middleware Suite]:
- Goto http://www.oracle.com/technetwork/java/javase/downloads/index.html and download jre-7u1-linux-x64.rpm
- Copy jre-7u1-linux-x64.rpm to the server via scp or other. Via scp from the Linux client:
- Login into server and run installer:
- Make use of Java JRE absolute version (/usr/java/jre1.7.0_01) in the alternatives configuration for java and javaws:
- Ensure the correct java version:
- Ensure that the alternatives is properly configured:
- Configure JRE_HOME system-wide environment variable. Edit /etc/environment:
- Append the following content:
- Logout and login again and test if JRE_HOME environment variable is correct:
- Prepare the CentOS server for installing Oracle products without sacrifice performance with a graphical environment. Oracle Fusion Middleware products use an X11 graphical environment on installation wizards. So the SSH X11 Forwarding should be installed and enabled.
- On the server, edit /etc/ssh/sshd_config:
- Set the following values:
- On the server, install the packages xorg-x11-xauth and libXtst:
- On the client, install the fontconfig packages xorg-x11-fonts-base and liberation-fonts:
- On the client, try to login to the remote server using "-Y" option:
- Remotely logged, try to run your X program, such as the xterm or other:
/ ext4 60GB /boot ext4 130M /home xfs ~403GB /opt xfs ~240GB /var xfs ~210GB swap swap 12GB
$ ssh localhost
DEVICE="eth0" HWADDR="00:1C:C0:95:59:55" NM_CONTROLLED="yes" ONBOOT="yes" NETWORK=192.168.192.0 NETMASK=255.255.255.0 IPADDR=192.168.192.201 GATEWAY=192.168.192.1 DNS1=192.168.192.2 DNS2=192.168.192.2 PEERDNS="yes"
$ adduser -G wheel bozz
$ passwd bozz
%wheel ALL=(ALL) ALL
$ sudo ls -hal
NOTE: From now, I only use the bozz user instead of root. You can also (optionally) disable the root account from remote access for security reasons.
$ pushd /tmp $ wget http://mirrors.home.dev/centos $ popd
$ sudo nano /etc/yum.repos.d/CentOS-Mirror.repo
[base] name=CentOS-$releasever - Base baseurl=http://mirrors.home.dev/centos/$releasever/os/$basearch/ gpgcheck=0 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.home.dev/centos/$releasever/updates/$basearch/ gpgcheck=0 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.home.dev/centos/$releasever/extras/$basearch/ gpgcheck=0
$ sudo rm /etc/yum.repos.d/CentOS-Base.repo
$ sudo yum update
$ scp jre-7u1-linux-x64.rpm bozz@SERVER:~/
$ sudo rpm -Uvh jre-7u1-linux-x64.rpm
$ sudo alternatives --install /usr/bin/java java /usr/java/jre1.7.0_01/bin/java 20000 $ sudo alternatives --install /usr/bin/javaws javaws /usr/java/jre1.7.0_01/bin/javaws 20000
$ java -version java version "1.7.0_01" Java(TM) SE Runtime Environment (build 1.7.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
$ alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jre1.7.0_01/bin/java Enter to keep the current selection[+], or type selection number: $ alternatives --config javaws There is 1 program that provides 'javaws'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jre1.7.0_01/bin/javaws
$ nano /etc/environment
export JRE_HOME=/usr/java/jre1.7.0_01
$ echo $JRE_HOME /usr/java/jre1.7.0_01 $ ls -1 $JRE_HOME bin COPYRIGHT lib LICENSE man plugin README release THIRDPARTYLICENSEREADME.txt Welcome.html
$ sudo nano /etc/ssh/sshd_config
X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes
$ sudo yum install xorg-x11-xauth libXtst
for a CentOS client:
for Ubuntu client:$ sudo yum install xorg-x11-fonts-base liberation-fonts
$ sudo apt-get install xfonts-base ttf-liberation
$ ssh -Y bozz@SERVER
And you shall see the X program pop up in your local desktop. You can also add the following into your $HOME/.ssh/config :$ sudo yum install xterm $ xterm
ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes
References
- Networking on CentOS: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-networkscripts-interfaces-eth0.html
- For Java: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/ and http://wiki.centos.org/HowTos/JavaOnCentOS
- SSH X11 Forwarding: http://www.imminentweb.com/technologies/centos-ssh-x11-forwarding, http://wiki.centos.org/HowTos/VNC-Server and http://www.ndchost.com/wiki/server-administration/centos5-vnc-x11
Hello Eduardo,
ReplyDeleteThank for sharing this information, It is helps me too much.
I want to notify that the URL:
http://mirrors.home.dev/centos
I guess now is:
http://mirror.centos.org/centos
Thx very much. By mirror.home.dev I mean any in home/business self-hosted mirror of the official CentOS repo.
DeleteHi Eduardo,
ReplyDeleteAs a developer, I am wondering if I can just install Oracle database just on a standalone server without using a client machine. So I is it Ok to install some desktop element as well? Besides some system resource is going to be used for the GUI, is there any other problem with it?
Of course. You can install the Oracle in standalone mode in your own development machine w/ Desktop environment. Besides resource consumption nothing else happens.
DeleteYou can write an article very much. Thank you for making a great article to read.
ReplyDeleteSa gaming สมัคร
ReplyDeleteI would like to show you about my blog.
สูตรบาคาร่า สูตรบาคาร่า สูตรบาคาร่า
How to write great blogs.
ReplyDeleteสูตรบาคาร่า สูตรบาคาร่า สูตรบาคาร่า สูตรบาคาร่า
This blog appeals to me much. It really moved me, and I think everyone should read it. Thank you for sharing this fantastic concept with us and for providing us with such valuable information. I'm using BSL Shaders for Minecraft on my Mac. This will improve your gaming experience, and I am confident that you will appreciate it.
ReplyDeleteObrigado por este site. Eu aprecio seu trabalho. muito bom eu tenho um site que muda sua fonte no Insta, Facebook, Snapchat, e outras redes sociais se você quiser mudar seu nome de usuário Visite letras personalizadas
ReplyDeleteHello, I read this amazing blog with such great content, I feel very happy to have connected your post and also I feel lucky to share an incredible article about digital marketing. Search engine optimization (SEO) is the practice of getting targeted traffic to a website from a search engine's organic rankings.
ReplyDelete