Often times, as server administrator, have to telnet or SSH to their server to restart the Apache Http services. The Apache http services are usually located at the following location, 1) init.d start script folder. issue “./apache restart” to restart it debian:/etc/init.d# ./apache restart Forcing reload of web server (apache)… waiting . debian:/etc/init.d# 2) usr/local/apache/bin […]

Read more How to restart apache services in unix?

The wget is a useful command to download a website in Linux. For example , wget [url]. [mkyong@snake ~]$ wget -r -p -k -E http://www.google.com –2009-07-19 14:07:27– http://www.google.com/ Resolving www.google.com… 64.233.189.104 Connecting to www.google.com|64.233.189.104|:80… connected. HTTP request sent, awaiting response… 302 Found Location: http://www.google.com.my/ [following] –2009-07-19 14:07:27– http://www.google.com.my/ Resolving www.google.com.my… 64.233.189.147 Connecting to www.google.com.my|64.233.189.147|:80… connected. […]

Read more How to download a website in Linux (wget)

CPULimit is a simple program to limit the CPU usage of certain application in Linux. It’s reside in the Ubuntu repositories by default. We can install it by issue the following command in Ubuntu sudo apt-get install cpulimit Output mkyong@mkyong:~$ sudo apt-get install cpulimit [sudo] password for mkyong: Reading package lists… Done Building dependency tree […]

Read more How to Limit the application CPU usage in Linux (CPUlimit)

The “dmidecode” is a handy tool in Linux to display the hardware specification detail. For example, memory, processor , BIOS and etc. man dmidecode DMI TYPES The SMBIOS specification defines the following DMI types: Type Information —————————————- 0 BIOS 1 System 2 Base Board 3 Chassis 4 Processor 5 Memory Controller 6 Memory Module 7 […]

Read more How to know the Hardware Details in Linux

In Unix system like Debian, Ubuntu or Red Hat, It is possible to set a static IP address with ifconfig command. My current Debian system IP address is 10.70.0.61 mkyong:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:15:17:1D:CE:2F inet addr:10.70.0.61 Bcast:10.70.3.255 Mask:255.255.252.0 I want change it to 10.70.0.66, just issue following command to set a static IP […]

Read more How to set static IP address on Unix

Today my boss ask me install a tomcat in linux machine. After i ssh into that machine, i wonder what is the Linux distribution version? Red Hat? Ubuntu? Fedora? Debian? However with a simple command, i can check what is linux distribution version mymachine:~# cat /proc/version Linux version 2.6.18-5-686-bigmem (Debian 2.6.18.dfsg.1-13etch3) ([email protected]) (gcc version 4.1.2 […]

Read more How to check Linux / Unix distribution version

Command is simple, here i provide two samples to show how to copy entire directory in linux. cp -r sourcedir targetdir for instance, 1) Copy anything from current directory to /usr/local/download cp -r * /usr/local/download 2) Copy whole directory (include content) /usr/local/fromdownload to target /usr/local/download cp -r /usr/local/fromdownload /usr/local/download

Read more How to copy Entire Directory in Linux

A very useful Java code, to open a web browser from Java application in windows or Linux. package com.mkyong; public class StartBrowser { public static void main(String args[]) { String url = "http://www.google.com"; String os = System.getProperty("os.name").toLowerCase(); Runtime rt = Runtime.getRuntime(); try{ if (os.indexOf( "win" ) >= 0) { // this doesn’t support showing urls […]

Read more Open Browser in Java windows or Linux

Default VI for Ubuntu is suck, i have to go install a full package of vi myself. However when i try to compile the vi source code, i hit following error error: C compiler cannot create executables It’s cause all my gcc compiler error, hmm…Ubuntu, why you have so many problem? Compiler also hit error….. […]

Read more error: C compiler cannot create executables – Ubuntu (Solution)

How to install java jdk on fedora core? here i provide few steps to demonstrate how it’s work. Installation Setup 1 ) Please visit sun java website to download any java jdk version you like. http://java.sun.com/javase/downloads/index.jsp 2 ) Click download, select Linux platform, language and accept license and continue. 3 ) Select “Linux RPM in […]

Read more How to install java jdk on fedora core (linux)