Tuesday, June 10, 2014

How to Install the Apache Web Server on a Windows PC

The Apache HTTP Server is one of the most widely used web server softwares available. It is an open-source software that can be run on a large number of different operating systems, including Windows. This article will teach you how to install the Apache web server on your Windows PC.
Steps
1If you haven't done so already, download the Apache HTTPD Web Server from the Apache web site . Be sure to download the apache_2.2.16-win32-x86-no_ssl MSI installer here: (http://httpd.apache.org/download.cgi)


2.Save the file to your Windows Desktop.


3.Double click the msi file saved on your Windows Desktop. You will see a window that looks like this:


4.Click "Next>".


5.Click the radio button "I accept the terms in the license agreement"


6.Click "Next>".


7.On the next window, again click "Next>".


8.Next, fill in all the text boxes with the following information:
"Network Domain": localhost
"Server Name": localhost
"Administrator's Email Address": your email address


9.Make sure the radio button "for all users, on port 80, as a service - recommended" is selected.


10.Click "Next>".


11.On the next window, click the radio button "Custom", and then click "Next>".


12.On the next window highlight "Apache HTTP Server" and click the "change" button.


13.We are going to install all the packages and scripts in the path C:\Server\Apache2\ (assuming C: is your main hard drive). So in the text box "Folder name:" type in "C:\Server\Apache2\". The ending backslash is important.


14.After you have typed in the path, click "OK" and then click "Next>". At this point, you should see a window that looks like this:


15.Click "Install" to begin the installation.


16.Once the Apache installation software has finished installing all the files on your computer, you will see a final window letting you know the installation was a success. Click the "Finish" button.

To check that the software was in installed successfully, open your favorite browser and type "http://localhost/" into the address bar. 

Thursday, May 29, 2014

How to find the number of physical CPUs in Linux

1. How many physical CPUs does the server have?
2. How many cores on each CPU? Duo/Quad


In Linux it’s actually quite easy to get this info.
You could go through the /var/log/dmesg file or the /proc/cpuinfo file. We’ll look at the /proc/cpuinfo file.

Output of cat /proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
stepping : 5
cpu MHz : 2933.548
cache size : 8192 KB
physical id : 1
siblings : 8
core id : 0
cpu cores : 4
apicid : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips : 5867.09
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: [8]
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
stepping : 5
cpu MHz : 2933.548
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc nonstop_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips : 5866.85
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: [8]

1. To get Physical CPU count?
Run “cat /proc/cpuinfo | grep “physical id” | sort | uniq | wc -l”.
$ cat /proc/cpuinfo | grep "physical id" | sort | uniq|wc -l
Output : 2
The machine has two Physical CPU.

2. How many cores?

Run “cat /proc/cpuinfo | grep “cpu cores” | uniq”.
$ cat /proc/cpuinfo | grep "cpu cores" | uniq
Output: cpu cores : 4
The machine has four Cores
4 mean that each physical CPU has 4 cores on it. If cpu cores was 1 then the CPU’s single core.

How many virtual processors?

Run “cat /proc/cpuinfo | grep “^processor”"
$ cat /proc/cpuinfo | grep "^processor"
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
processor : 8
processor : 9
processor : 10
processor : 11
processor : 12
processor : 13
processor : 14
processor : 15
We have 2 physical CPUs x 4 cores each = 8 virtual processors. So there should be 8 Virtual Processors. But here the Output is 16. Why is it showing 16.

The processor number is showing 16, due to HT (Hyper-Threading) enablement.

However, it’s a bit different for HT (Hyper-Threading). If you get cpu core = 1 but the virtual processors = 2 then the CPU’s running HT. HT will only work with the SMP kernel.