Install Apache & PHP on window server 2008 R2

It would be very easy to install WAMP,LAMP, MAMP,XAMPP server but installing separate component for production server is little difficult process.Yes today I installed individual PHP ,Apache for window server 2008 R2  64 bit environment as per client requirement.Below is basic step to install.

Useful Links

Step-1: Install Apache

  1. First, download the latest version of Apache HTTP Server win32 binary without crypto MSI installer
  2. Select Next
  3. Select “I accept the terms in the license agreement”
  4. Select Next
  5. Fill in your server information if it is known. A typical setup will use the “for All Users, on Port 80, as a Service” option. If this is being setup as a test machine, you may use localhost as the Network Domain and the Server Name. Select Next.
  6. Select the Typical Setup
  7. Choose a Destination Folder for the Installer to place the program files into. Note: the default Apache Installer location is C:\Program Files\Apache Software Foundation\Apache2.2. Because of the spaces in the directory name, using this folder may cause cgi and php scripts to not find the paths correctly.
  8. Select Finish
  9. If a Firewall is enabled, make sure that port 80 and port 8080 are unblocked and open.
  10. To test if the Apache server is running, open up http:\\localhost in a browser. A plain black and white page should come up that reads “It Works!”

Step-2: Configuring Apache

  1. Using a text editor such as Notepad, open the httpd.conf file. This file is found in the /conf sub-directory under the directory that was set up during installation. Alternatively, a shortcut may be found in the start menu under the Apache HTTP Server folder.
  2. Note: Windows based systems uses backslashes \ and Unix based systems use slashes / for paths. In the Apache configuration files, slashes / should be used in path names.
  3. Change the DocumentRoot to point to the location of the root document folder. In the default httpd.conf file, this is found on line 149 and if the defaults were used during the installation, it would point to “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”.
    Note: Wrapping the path name in quotes will escape out any spaces that are used.
<Directory “C:/HASLMS”>DocumentRoot “C:/HASLMS”

4. Change the Directory path to match the one used in the previous step. This is found on line 177 of the default httpd.conf file.

5. Add to index.php to the DirectoryIndex. This is found on line 212 of the default httpd.conf file.

<IfModule dir_module>DirectoryIndex index.html index.php main.php index.html


6. Append the following lines to the end of the httpd.conf file:

LoadModule php5_module “c:/php/php5apache2_2.dll”
AddType application/x-httpd-php .php
PHPIniDir “C:/php”

7. Save and Close

Step-3: Installing PHP

  1. Download PHP and Unzip the PHP files to C:\php
  2. Copy c:\php\php-ini-recommended.ini and rename itc:\php\php.ini
  3. Update the extension_dir on line 520 to “C:\php\ext”
  4. Uncomment php_gd2.dll extension on line 637.
  5. Uncomment mysql.dll extension on line 651.
  6. Update the sessions.save_path to the Windows temporary files directory (i.e. C:\Temp).
  7. The PHP directory needs to be added to the Path Environment Variables
  8. Open the Control Panel
  9. Open System > Advanced > Environment Variables
  10. Append ;C:\php to the end of the Path System Variables list and Click OK.

11.  Restart Apache

All set to install PHP and Apache on OS 2008.Now You must have to test php script to sure that PHP script properly working or not.Cheers!!!!!

LoadModule php5_module “c:/php/php5apache2_2.dll”
AddType application/x-httpd-php .php
PHPIniDir “C:/php”

Posted in Apache | 6 Comments

WAMP Server configuration on XP

To install WAMP server on XP Machine is not easy while running lots of program in same machine. If you are facing same problem, here is solution.

Check your Apache server is running or not

  • goto Apache>Service
  • Start Service Clickable (Stop Service will be grey because it’s not running)


  • GOTO start>run>cmd
    type in netstat –aon
  • looking for a line with :80 as in the line belowTCP LISTENING 4072
  • If you cannot find 4072 PID then lots of program using Port 80.Please check below
    • Disable Skype.
    • Disable NIS (Norton Internet Security).
    • Disable IIS (Internet Information Service).
    • Change your Firewall settings (Norton, McAfee, Windows,).
    • Turn-off all services that could use port 80.
    • Change the string “Listen 80” in the httpd.conf files to something else.
    • Re-install WAMP without the PHP4 add-on.
    • Re-install WAMP without the MySQL add-on.
    • Re-install WAMP alone many times.
    • Re-boot Windows many times.
  • Type telnet localhost 80 on command prompt.

See list of open port information

  • Go to Start Menu & open RUN.
  • In RUN write “cmd” & press Enter.
  • After Opening Command Prompt type “netstat -an” & press Enter
  • & then it will show you all the listing of ports…!
Posted in Categories, PHP | 2 Comments

Mobile Device Design and Dimensions

In current market, everybody having smart phone and want to surf website using mobile. Apparently this trend comes from largely used Apple Iphone. Apple introduced new era for using mobile device and people are using smart phone…

Dimensions for Mobile Design.

Rapidly change mobile market, Screen resolution and dimensions could be changed. The life time of mobile device is much smaller than desktop application.

Resolution PPI(Pixels per Inch) Devices
  • Blackberry Devices: Curve 8530, Pearl Flip
  • Android Devices: Motorola Charm, Sony Ericsson Xperia X10 Mini, others
  • Symbian OS Devices: Nokia E63, others
320×480 164ppi
  • Apple OS Devices: iPhone3, iPod
  • Android devices: HTC Dream, HTC Hero, Droid Pro, i7500 Galaxy, Samsung Moment, others…
480×360 Blackberry Devices: Torch, Storm, Bold
360×640 Symbian OS Devices: Nokia N8, Nokia C6-01, others
  • Android Devices: Liquid A1, HTC Desire, Nexus One, i9000 Galaxy S, others
  • Maemo (Linux) Devices: Nokia 900, others
  • Windows Mobile 6 Devices: Sharp S01SH
  • Windows 7 Phone Devices Venue Pro, Samsung Omnia 7, HTC 7 Pro, others
768×1024 132ppi iPad
640×960 326ppi iPhone 4 (Should be mutiply 2 by iphone3 Dimensions)
  • Android Devices: Motorola Xoom, Samsung Galaxy Tab 10.1
  • Windows OS Devices: Asus Eee Pad EP121
  • Apple OS Devices: Axiotron Modbook

Designing for Mobile Device

CSS2 allows you to specify stylesheet for specific media type such as screen or print.Now CSS3 making more efficicent in media query

View area smaller than 550px…

@media screen and (min-width: 500px) and (max-width: 550px) {    .class {      background: #ccc;    }  }

If you want to link to a separate stylesheet, put the following line of code in between the <head> tag.

Additional Resources :-

Posted in Categories, Mobile Design | Comments Off on Mobile Device Design and Dimensions

Browsers Safe Fonts

Today my client gave me list of fonts but some reason I could not able to find in my window PC so I started to ask other Web designer and found answer that every fonts are not available on window & Mac…hmmmmm

Actually by default, Window and Mac have been installed very limited fonts…if I will use beyond these limited fonts, may be some web users does not have fonts in their window or Mac environment and could not able to view their web page properly…Finally Common fonts for all versions of window and Mac environment are listed in below link.

– Windows fonts are in black, Mac fonts are in blue.

Note that not all fonts are available on both Mac and PC. So be careful before using them.

Lot more Fonts are coming up such as Google font API[web service] and html5 fonts but all having browsers issues…I would like to implement internet typography but without loading external web service or installing font on different environments.

Posted in Others | 10 Comments

CSS hack for Internet Explorer

As Web Developer, I don’t like to deal with CSS for IE but all about Microsoft rigid policy to make internet explorer. I have three options to handle CSS for IE

1. IE conditional Comments

Most common way to to fix IE bug for using conditional CSS.

#2 CSS Rules Specific to Explorer (IE CSS hacks)

These is neither valid CSS hack not recommended but most of people use as second option to handle IE bugs.

* IE8 or below: to write CSS rules specifically to IE8 or below, add a backslash and 9 (\9) at the end before the semicolon.
* IE7 or below: add an asterisk (*) before the CSS property.
* IE6: add an underscore (_) before the property.

.box {
background: gray; /* standard */
background: pink\9; /* IE 8 and below */
*background: green; /* IE 7 and below */
_background: blue; /* IE 6 */

#3 Conditional HTML Class

I have found third option from Paul Irish , where having conditional comments for targeting specific browsers with different classes.As simply IE class taget as Parent selector.

Posted in CSS2 | Comments Off on CSS hack for Internet Explorer

404 Error Pages

Displaying error in websites as much important for developer especially in different ways to represent text.Basic question,when this error come.Well browser request for webpage and server could not able to find web page either database problem or wrong content.By default say “404 Page not found” in your browsers.

Most of well know website represent 404 error in versatile way.

Resources :-

Posted in Categories, Design, Layouts | 2 Comments

Small Icon for all website….

For small icon we don’t have to worry about it.Below websites have been provided bunch of small icons for any websites..Just download….Very Nice…

IconArchive – List of different categories icon available in this website which is really nice.

IconFinder – Icon Finder is an search engine for finding will get any size of icon image and customize with colors.

Xiao Icon

Web Iconset

Fam Fam Fam

Web Application Icon set..

Additional Resources :–

Posted in Categories, Others | 1 Comment

Create Virtual Host using WHM [Web Hosting Manager]

Here are the steps to create the virtual host:

1. On WHM, click Apache Configuration under Service Configuration
2. Click on Include Editor
3. Under Pre Main Include, select from dropdown 2.0.63
4. At the bottom of the file text area, include this for the new site virtual host:

DocumentRoot “/usr/local/apache/htdocs/sitename/wwwroot” AllowOverride All allow from all Options +Indexes ServerName<>

5. Click update to save.
6. Click HTTP Server (Apache) under Restart Services.
7. Click Yes.

Very Easy to follow step and Virtual host will be ready for your site….

Posted in Apache, Categories | 2 Comments

Checking All browser compatibility….

On desktop or laptop does not have any capability to store all browsers.As software programmer, we should have to check website in all browsers so people are finding solution to this problem either Virtual host connection or using different PC environment. Adobe Browser lab website provide nice facility to check website in all browsers

Really Cool features and free account which is very nice…..

Posted in Categories, Others | Comments Off on Checking All browser compatibility….

Exporting and Importing Large database using SSH


I got problem with large database to import and i decided to share my knowledge with you…

Exporting a MySQL database via the command line

I confess to having little problem exporting via phpMyAdmin, but large db’s do sometimes not like being zipped or gzipped that way, so here’s the run down:

  • login to your web site using Puty or similar.
  • navigate to the directory where you want to store your extracted database file. This can be a temporary directory you create just for the purpose. Note that after the MySql dump is created, it shouldn’t be left in a publically accessible directory longer than necessary.
  • run the following on the command line: mysqldump -a -u USERNAME -pDATABASE_NAME > FILENAME.sql
  • If you want to, check the size of your file (command: ls -al)
  • gzip your file to make the download faster using the command:
    gzip FILENAME.sql
  • download your file in ftp to your local pc to upload and import into your new database

Importing a MySQL database via the command line

  • create a new blank database using phpMyAdmin or your web server control panel. Take careful note of the server host name, db name, username and password.
  • upload your *.sql file to your new web site (I create a temporary directory for the purpose)
  • Fire up Putty, log in and navigate to the directory with the uploaded sql file.
  • If you gzipped the sql file, unzip your database file with this command:
    gzip -d FILENAME.mysql
  • run the following on the command line to import:
  • The system will ask you the password for the database, enter it.
  • If all goes well, the command line prompt will sit there for anything from a few seconds to several minutes as the db is processed. When prompt changes, check your database in phpMyAdmin to make sure all the tables imported properly.

you are done after following these steps…………Cheers!!!!!!

Posted in Categories, Mysql | 2 Comments