Monday, July 30, 2012

How to view your VMware ESXi Host’s System Log, Config and Datastore via a web browser.

ESXi Configuration Files & System Logs:


 

http://<insert ESXi host name or IP here>/host

 

 

Click on any of the displayed items to view their contents.

Easily view your VMware ESXi Host’s System Log, Config via a web browser.

 


ESXi Datastores:


To view the ESXi host’s attached datastores and the total and consumed disk space enter:

 

http://<insert ESXi host name or IP here>/folder

 

How to view your VMware ESXi Host’s Datastore files via a web browser.

Tuesday, July 17, 2012

SARG on CentOS 6

[root@khan ~]# yum install gcc make wget httpd
[root@khan ~]# wget http://sourceforge.net/projects/sarg/files/sarg/sarg-2.3.1/sarg-2.3.1.tar.gz/download

[root@khan ~]# tar zxvf sarg-2.3.1.tar.gz
[root@khan ~]# cd sarg-2.3.1
[root@khan ~]# ./configure
[root@khan ~]# make
[root@khan ~]# make install

 

# vim /usr/local/etc/sarg.conf

 

#### sarg.conf####
access_log /var/log/squid/access.log
date_format e     ## since here we use date format DD-MM-YYYY
overwrite_report yes     ## because I don't want multiple sarg reports for the same day
output_dir /var/www/html/squid-reports

Monday, July 16, 2012

Webmin User Password Change

If you want to change root password in webmin use this included Perl script:

sudo /usr/share/webmin/changepass.pl /etc/webmin root

Saturday, July 14, 2012

How do I change my Webmin password if I can't login?

Included with the Webmin distribution is a program called changepass.pl to solve erecisely this problem. Assuming you have installed Webmin in /usr/libexec/webmin, you could change the password of the admin user to foo by running

/usr/libexec/webmin/changepass.pl /etc/webmin admin foo

 

sudo /usr/libexec/webmin/changepass.pl /etc/webmin root yourpassword

 

 

Tuesday, July 10, 2012

How to install Oracle JDK on Ubuntu 11 from repository.

With Oracle the acquisition of Sun the Oracle have retired the "Operating System Distributor License for Java" (JDL) and the only available JDK release will be the OpenJDK. I had previously some bad experience with the OpenJDK and I prefer to use the official Oracle version of JDK, but I don't want to install the JDK binaries manually – we are using Ubuntu! But the webupd8.org team have been nice to published the binaries in a Personal Package Archives (PPA) and so far I have no problem using it, so I can warmly recommend using it.

To install:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo mkdir -p /usr/lib/mozilla/plugins #just in case, this will be added to the package in the next version
sudo apt-get install oracle-jdk7-installer

And to uninstall:
sudo apt-get remove oracle-jdk7-installer


And to verify your installation:
java -version
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

And to verify the web browser installation:
http://java.com/en/download/installed.jsp
Verified Java Version
Congratulations!
You have the recommended Java installed (1.7.0_02).

And with maven 2:
mvn -version
Java version: 1.7.0_02
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.0.0-15-generic" arch: "amd64" Family: "unix"

Java Web Start
The only thing that did not work out of the box was the Java Web Start. To fix that open JNLP file link and when asked for application, brows to:
/usr/lib/jvm/java-7-oracle/bin/javaws

Monday, July 2, 2012

CentOS Linux system information - Boot Up information

dmesg

How To: Disable Firewall on RHEL / CentOS / RedHat Linux

First login as the root user.

Next enter the following three commands to disable firewall.
# service iptables save
# service iptables stop
# chkconfig iptables off


If you are using IPv6 firewall, enter:
# service ip6tables save
# service ip6tables stop
# chkconfig ip6tables off

Howto Red hat enterprise Linux 5 / CentOS configure the network card

Method # 1: GUI tool system-config-network


Type the following command at shell prompt (open x terminal):
$ system-config-network &

Red hat enterprise Linux 5 configure the network card - system-config-network

You will see Window as above. Now select your Ethernet card (eth0 or eth1) and click on Edit button. You can now setup IP address, netmask, default gateway and other properties.
setup IP address, netmask, default gateway and other properties

You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on Ok button to save the changes. You can activate card by clicking on Activate button.

Method # 2: Command line tool system-config-network-tui


If you don’t have X windows GUI installed type the following command at shell prompt:
# system-config-network-tui &
Command line tool system-config-network-tui
(click to enlarge image)

You will see text based GUI as above. Select your Ethernet card (eth0 or eth1) and hit [Enter] or [F12] special key.

Cent OS, Fedora Core, RHEL configure the network card - system-config-network-tui
(click to enlarge image)

You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on Ok button to save the changes

Method #3: Edit configuration files stored in /etc/sysconfig/network-scripts/


You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:

  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file

  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file


To edit/create first NIC file, type command:
# vi ifcfg-eth0
Append/modify as follows:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes


Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65


Save and close the file. Restart networking:
# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS Server as follows:
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222


Save and close the file. Now you can ping the gateway/other hosts:
$ ping 10.0.80.12
Output:
PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms

You can also check for Internet connectivity with nslookup or host command:
$ nslookup cyberciti.biz
Output:
Server:         10.0.80.11
Address: 10.0.80.11#53
Non-authoritative answer:
Name: cyberciti.biz
Address: 75.126.43.232

You can also use host command:
$ host nixcraft.in
Output:
nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.

Sunday, July 1, 2012

CentOS: Enable CentOS GNOME Desktop

Mostly the CentOS servers that I am using is run on CLI (Command-Line Interface) mode. But in some cases, I need to have a desktop to install some applications with GUI (Grapich User Interface) mode. In this case, I will use GNOME, the most popular user-friendly desktop for any UNIX based system.

Variable that I used as below:
OS: CentOS 6.2 64bit
Desktop environment: GNOME

1. Using yum, we will need to install X Windows System  as the based for GUI and rich input device capability:


$ yum groupinstall -y 'X Window System'



2. Only then we can install GNOME desktop environment on top of it:


$ yum groupinstall -y 'Desktop'



3. Since previously the server is running on CLI mode, we need to change some value to tell CentOS to boot up in the GUI mode. Open /etc/inittab via text editor and change following line:


id:3:initdefault:



To:


id:5:initdefault:



4. Reboot:


$ init 6



Note: You can switch from GUI to CLI mode manually by using following method:

GUI to CLI: Ctrl + Alt + F6
CLI to GUI: Ctrl + Alt + F1

If you want to start the desktop from CLI console (not SSH session), use following command:


$ startx



In some cases, when you login into the system via GUI, you will see some kind of weird boxes replacing the fonts. You can overcome this problem by installing fonts group via yum:


$ yum groupinstall -y fonts



Done!