Sunday, November 15, 2009

Setting up Virtual Hosts(Shared Host) with Apache2.2 running on Windows XP




Setting up virtual hosts with Apache2.2 is very straight forward and could be done in less than 5 minutes. Although, your local Apache2.2 server will still work even if virtual hosts are not configured. You might want to ask, is there a need for my local Apache2.2 setup to configure virtual hosts? Apparently, virtual hosts are needed when

* your on multiple domains
* your need to test your projects with same configuration with the server
* test your projects without touching your public server
* your just organizing your projects into groups
* or setup a local copy of your blog or website

What do we need?
Actually , i would prefer individual installation rather than WAMP or XAMPP package.
Install apache2.2 ,php and Mysql into your c:\www. Usually its a better practice for storing file in to specific selected path like c:\www or d:\www
Installation something like this
1. c:\www\Apache2.2 - Apache files
2. c:\www\php - PHP files
3. c:\www\zend - PHP Zend Files
4. c:\www\public_html - html/php files (this is your website root)

Configuring Apache2.2 to accecpt Virtual Hosts

1. Got to your Apache folder which is under c:\www\Apace2.2 and locate the conf files. The are usually located at c:\www\apache\conf
2. Open the file named httpd.conf with a text editor
3. if u want u can add all virtual host(multiple domain, subdomain) things on here otherwise u just include httpd-vhosts.conf file and add your settings there before that just comment it what ever documentroot and server root configuration at the httpd.conf cos virtual hosting setting to be placed inside the httpd-vhosts.conf file.
example
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
2. Open the file named c:\www\Apache2.2\conf\extra\httpd-vhosts.conf with a text editor
3. If posible read the instructions so may have the idea on what you are doing
4. Now paste the following code at the bottom of the file without touching the document.

#
# Use name-based virtual hosting.
#

NameVirtualHost *:80

#

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<VirtualHost www.iatahni.com:80>
DocumentRoot "C:/WWW/public_html"
ServerName www.iatahni.com
ServerAlias www.iatahni.com
ErrorLog logs/iatahni/host1.iatahni.com-error_log
CustomLog logs/iatahni/host1.iatahni.com-access_log common

<Directory "C:/WWW/public_html">
Options -FollowSymLinks -Indexes
AllowOverride None

Order allow,deny
Allow from all
</Directory>

</VirtualHost>


NameVirtualHost wap.iatahni.com:80

<VirtualHost wap.iatahni.com:80>
DocumentRoot "C:/WWW/public_html/wap"
ServerName wap.iatahni.com
</VirtualHost>

NameVirtualHost www.iramaku.com:80

<VirtualHost www.iramaku.com:80>
DocumentRoot "C:/WWW/public_html/iramaku"
ServerName www.iramaku.com
ServerAlias www.iramaku.com

ErrorLog logs/iramaku/host2.iramaku.com-error_log
CustomLog logs/iramaku/host2.iramaku.com-access_log common

<Directory "C:/WWW/public_html/iramaku">

Options -FollowSymLinks -Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

for multiple, add similar like

Thats All ~~ Shared Web Hosting (Multiple domain) / Subdomain

Enjoy !!
Cheeeeeeeers
venkat

Monday, October 26, 2009

Database Connectivity + PHP

There is lot of database option avail for integrate into PHP.You should need to configure at the php.ini file according to your database selection before doing the connectivity. example,

For Mysql
extension=php_mysql.dll

For Microsft Sql Server
extension=php_mssql.dll

For Postgre Sql
extension=php_pgsql.dll

Connectivity

1. MySql
define("HOST","localhost");
define("USER","venkat");
define("PASSWD","xxxx");
define("DATABASE","pos");
function myConn()
{
$db=mysql_connect(HOST,USER,PASSWD);
mysql_select_db(DATABASE,$db);
return $db;
}

2. MS Sql
define("HOST","localhost");
define("USER","venkat");
define("PASSWD","xxxx");
define("DATABASE","pos");
function myConn()
{
$db=mssql_connect(HOST,USER,PASSWD);
mssql_select_db(DATABASE,$db);
return $db;
}

3. Postgre Sql
define("HOST","localhost");
define("USER","venkat");
define("PASSWD","xxxx");
define("DATABASE","pos");
function myConn()
{
$db=pgsql_connect(HOST,USER,PASSWD);
pgsql_select_db(DATABASE,$db);
return $db;
}

That's it .....

Webserver :: Prevent Directory Listing

Step 1 :
>apache home>conf>httpd.conf
Do the following changes
First of all find your webserver root directiory , those lines are inside...

in my case , <Directory "C:/WWW/public_html"> is my webserer root

#Options Indexes FollowSymLinks //its enable directory listing
#disable directory listing
Options -FollowSymLinks -Indexes // prevent directory listing

thats it , save colse
restart apache !!!

Wednesday, June 10, 2009

Install Windows XP on Your Pre-Installed Windows Vista Computer

The question I am asked most often is "How do I install a dual-boot with Windows XP on my new Windows Vista computer?" The answer is that it's not that difficult, it's just very time consuming, and you need to own a copy of Windows XP.

Note that you should not attempt this if you aren't ready to troubleshoot any problems that might occur.

The first issue we encounter is that computers with pre-installed operating systems take up the entire drive. Luckily Microsoft included the Shrink volume feature in Vista, so we can easily shrink the Vista partition down to make room for XP.

Open the Computer Management panel, which you can find under Administrative tools or by right-clicking the Computer item in the start menu and choosing Manage. Find the Disk Management item in the list and select that.

image

Now we'll shrink our volume down by right-clicking on the main hard drive and choosing Shrink Volume.

image

Now you can choose the size that you want to shrink, which really means you are choosing the size that you want your XP partition to be. Whatever you do, don't just use the default. I chose roughly 10gb by entering 10000 into the amount.

image

The next step might be confusing, because we need to change the cd-rom drive that's invariably taking up D: at the moment, because we want to use D: for the Windows XP partition, but it's already taken by the cd-rom drive. If you skip this step than XP will install onto the E: drive, which isn't the end of the world, but it's not quite as tidy.

Right-click on the cd-rom drive in the list and choose Change Drive Letter and Paths from the menu.

image

Now we'll change the CD drive to use E: by selecting that in the drop-down.

image

Now we can create a new partition for XP to live on and make sure that the drive letter is set the way we want. If you do not create a partition now the XP install will do so automatically, but it's easier and cleaner to do it this way.

Right-click on the Unallocated free space area and then select New Simple Volume from the menu.

image

Follow through the wizard and select whatever options you'd like, making sure to use D: as the drive letter.

Now you will need to close out of disk management and reboot your computer. This is because we can't do the next step until we reboot. (you can try, but it won't work)

So we've come back from rebooting… open up Computer from the start menu and then right-click on the D: drive and select properties. Give your partition a meaningful name like "XP". It would be wise to name the C: drive to "Vista" at this point as well.

image

Now you'll want to pop your XP cd into the drive and boot off it. You may have to configure your BIOS to enable booting off the CD drive, or if your computer says something like "Hit Esc for boot menu" you might want to use that.

Once you come to the screen where you can choose the partition to install on, then choose either the unpartitioned space or the new partition you created. Whatever you do, don't try and install onto your Vista partition! See how much cleaner it is now that we've labeled each partition distinctly?

image

We'll assume XP is completely installed at this point, and you will have lost your ability to boot into Windows Vista, so we'll need to use the VistaBootPro utility to restore the Vista boot loader.

Update: VistaBootPro is no longer free, but you can still download the free version.

During the install you'll be forced to install the .NET 2.0 framework. Open up VistaBootPRO and then click on the System Bootloader tab. Check the "Windows Vista Bootloader" and then "All Drives" radio buttons, and then click on the Install Bootloader button.

image

At this point, the Windows Vista bootloader is installed and you'll only be able to boot into Vista, but we'll fix that. Instead of manually doing the work, we'll just click the Diagnostics menu item and then choose Run Diagnostics from the menu.

image

This will scan your computer and then automatically fill in the XP version.. click on the "Manage OS Entries" tab and then click in the textbox for Rename OS Entry, and name it something useful like "Windows XP" or "The Windows That Works"

image

Click the Apply Updates button and then reboot your computer… you should see your shiny new boot manager with both operating systems in the list!

image

If you get an error saying "unable to find ntldr" when trying to boot XP, you'll need to do the following:

  • Find the hidden files ntldr and ntdetect.com in the root of your Vista drive and copy them to the root of your XP drive.
  • If you can't find the files there, you can find them in the \i386\ folder on your XP install cd

There's more information on this forum thread, thanks to nrv1013

This is a critical piece of information: Windows XP will be installed on the D: drive, even in Windows XP… so you'll need to keep that in mind when tweaking your system.

image

You can share information between the drives, but I wouldn't recommend messing with the other operating system's partition too much… it might get angry and bite you. Or screw up your files. What I do recommend is that you store most of your files on a third drive shared between the operating systems… you could call that partition "Data".

I'm going to write a number of followup articles dealing with all of the issues with dual-boot systems, so subscribe to the feed for updates.

If you have issues with your dual-boot system, I'd recommend creating a new topic in our Vista forum, and we'll try and help you.

If you have issues with using the shrink volume feature, check this article for some tips.

Monday, April 6, 2009

What are web safe colors?

Colors that look the same on any browser or computer are known as web safe colors. These color codes are used in HTML elements like background, text etc. They are a combination of hexadecimal digits (00, 33, 66, 99, CC, FF). While choosing colors for HTML layout, try to use one of the hex color codes shown below.
Hex Code Color
#FFFFFF
#FFFFCC
#FFFF99
#FFFF66
#FFFF33
#FFFF00
#FFCCFF
#FFCCCC
#FFCC99
#FFCC66
#FFCC33
#FFCC00
#FF99FF
#FF99CC
#FF9999
#FF9966
#FF9933
#FF9900
#FF66FF
#FF66CC
#FF6699
#FF6666
#FF6633
#FF6600
#FF33FF
#FF33CC
#FF3399
#FF3366
#FF3333
#FF3300
#FF00FF
#FF00CC
#FF0099
#FF0066
#FF0033
#FF0000
Hex Code Color
#CCFFFF
#CCFFCC
#CCFF99
#CCFF66
#CCFF33
#CCFF00
#CCCCFF
#CCCCCC
#CCCC99
#CCCC66
#CCCC33
#CCCC00
#CC99FF
#CC99CC
#CC9999
#CC9966
#CC9933
#CC9900
#CC66FF
#CC66CC
#CC6699
#CC6666
#CC6633
#CC6600
#CC33FF
#CC33CC
#CC3399
#CC3366
#CC3333
#CC3300
#CC00FF
#CC00CC
#CC0099
#CC0066
#CC0033
#CC0000
Hex Code Color
#99FFFF
#99FFCC
#99FF99
#99FF66
#99FF33
#99FF00
#99CCFF
#99CCCC
#99CC99
#99CC66
#99CC33
#99CC00
#9999FF
#9999CC
#999999
#999966
#999933
#999900
#9966FF
#9966CC
#996699
#996666
#996633
#996600
#9933FF
#9933CC
#993399
#993366
#993333
#993300
#9900FF
#9900CC
#990099
#990066
#990033
#990000
Hex Code Color
#66FFFF
#66FFCC
#66FF99
#66FF66
#66FF33
#66FF00
#66CCFF
#66CCCC
#66CC99
#66CC66
#66CC33
#66CC00
#6699FF
#6699CC
#669999
#669966
#669933
#669900
#6666FF
#6666CC
#666699
#666666
#666633
#666600
#6633FF
#6633CC
#663399
#663366
#663333
#663300
#6600FF
#6600CC
#660099
#660066
#660033
#660000
Hex Code Color
#33FFFF
#33FFCC
#33FF99
#33FF66
#33FF33
#33FF00
#33CCFF
#33CCCC
#33CC99
#33CC66
#33CC33
#33CC00
#3399FF
#3399CC
#339999
#339966
#339933
#339900
#3366FF
#3366CC
#336699
#336666
#336633
#336600
#3333FF
#3333CC
#333399
#333366
#333333
#333300
#3300FF
#3300CC
#330099
#330066
#330033
#330000
Hex Code Color
#00FFFF
#00FFCC
#00FF99
#00FF66
#00FF33
#00FF00
#00CCFF
#00CCCC
#00CC99
#00CC66
#00CC33
#00CC00
#0099FF
#0099CC
#009999
#009966
#009933
#009900
#0066FF
#0066CC
#006699
#006666
#006633
#006600
#0033FF
#0033CC
#003399
#003366
#003333
#003300
#0000FF
#0000CC
#000099
#000066
#000033
#000000

Website Layout - Tips & Tricks

The importance of a good site layout

Websites are judged by content and layout. How good your content maybe, if your layout is not appealing, visitors will not be eager to come back. Everyone is not born with a quality of creating layouts that are pleasing to the eye. If you have been to different Yahoo groups, you might have found various color combinations that the group owner has chosen. Some of them have red backgrounds with blue colored text creating a blinding effect. Although Yahoo provides all the possible color combinations, some choose the wrong colors.

Points to consider while designing a website layout

Website design is not a one time activity. Almost all websites alter their layouts to give it a new and better look. Also with advancement in technology, underlying code also changes accordingly, adding new possibilities of providing a better layout.
  1. Keep it simple:
    A simple website layout is user friendly. Do not create complex navigational links using complex scripts or images that maynot be viewable correctly in different browsers. Also search engines cannot index the site properly if complex navigation is involved. Minimize the use of bulky images which take long to load. Use smaller icons to attract visitor's attention instead.

  2. Readable font size and face:
    Use a standard font size of "-1" (11 or 12 pixels if using styles) so that visitors can read the content easily. Select a professional looking font face (Verdana, Arial, Helvetica, sans-serif are very common). Avoid using fancy fonts like Comic Sans
    (unless it is a personal website). Use appropriate spacing between lines (12 or more pixels) to avoid clumsiness.

  3. Use web safe eye pleasing colors:
    The choice of colors may reflect one's personal taste. Every webmaster or designer wants the color combination that he/she likes best. However, it is a wise decision to get feedback from users or friends about what they feel about the color combination
    of the website. Use web safe colors whenever possible.

  4. Webpage Dimensions:
    One important aspect of layout is keeping track of dimensions of a web page. Most successful commercial websites limit the width and height of the webpage so that the important content of the webpage lies within the top 600x600 viewable area without scrolling. To avoid a horizontal scrollbar, set the page layout to expand and shrink with changes in browser window size. Sometimes this interferes with image and text positions relative to each other and throws the layout structure out of sync. The best choice is to limit the width by placing a table with a fixed width of 750 or 775 pixels. See the layout of this web page for an example.

    The page height should not be any more than 4 scroll lengths. Limit the content of the page and if more content needs to be added, move it to a new web page. Provide a navigational link to the next page and a link back from the second page. This will also increase your web site's page views (adding more advertising space).

  5. Limit File Size:
    Webpage size is defined by the total size of text, images and supporting files (including javascript, flash etc.) that is downloaded from the server to view a webpage. Page size is very critical for high volume websites because of high bandwidth needed. However, it is also very important for any other site in order to keep loading times to a minimum. Most of the population on the internet use a slow 56K modem to access the internet. And smaller page sizes load faster. If you look at some very high volume websites like Yahoo.com and Google.com, they hardly have any images, making their site load faster.

    There is a trade off between making your webpage look nicer with lots of graphics and making it faster to load. The rough target for page size should be below 35K for at least the cover page. However, for e-commerce sites, it is often not possible because they have to present multiple product images to attract attention. As a general rule of thumb, a visitor will leave your site if the loading time is more than 8 secs.
Tips & tricks
  • Extract Javascript code and styles from within the html page to external .js and .css files. Create a link from each html page to these external files. Browsers download these files only once and caches them on the user's computer. This will reduce the size of the individual html pages.

  • Use server side includes for centralizing common content.

  • Use a background which creates a contrast to the font colors and graphics. Look at media sites like movies.com for an example. It uses a dark background with lighter fonts in order to create a theatre like setting. However, the site is easy to read and navigate.

  • Check regularly for broken links. Using a link checker or checking the list of 404 errors (File not found) in your website logs (or stats) will help maintain site links. Maintenance of links to external sites can be centralized using link tracking tools

Web Hosting :: Tips On Using SubDomain

Points to consider before using subdomains

Subdomain makes the URLs shorter and nicer. It allows website owners to categorize the
content of the website. It also
helps in improving the search engine rankings as most of the search engines treat
the subdomain as a separate website address. However, there are certain things to
consider before setting up subdomains for your website.
  1. packages. If you have subdomain and want to move your site, you have to
    choose one which supports subdomains.

  2. Most web hosts charge extra for subdomain setup and maintenance.

  3. If you use cookies in your website, a cookie set from a subdomain
    cannot be read from the main domain and vice versa because of the security
    association feature tied to the domain which set it. This is also true for
    session cookies, where, if the user is logged in on the main site, and
    then moves to a subdomain, the subdomain site will not be able to access the
    same session cookie, and will assign a new session (hence forcing the user
    to login again). However, session persistence
    across subdomains can be maintained by implementing URL rewriting instead
    of session cookies.

  4. Your website stats will often not include the statistics of the
    subdomains. Therefore, you have to setup separate statistics for your subdomains.

  5. One of the advantages of using subdomain is that the website can be broken down into
    smaller pieces without losing the brand image associated with the domain name. The subdomains can be hosted on
    separate servers in order to reduce the burden on the main domain hosting server.

Sharing cookies among all subdomains

As explained earlier, cookies are not shared among subdomains or between the domain
and the subdomain. In order to set cookies accessible by all subdomains, use the
following techniques:
  1. While writing the cookie, set the cookie domain to ".domain.ext" so that it applies
    to all subdomains.

  2. If the cookie domain is set to ".domain.ext", it will not be accessible by a user
    who types in the address without the www before the domain (i.e. http://domain.ext).
    Therefore, redirect all requests without www to http://www.domain.ext.
There are some reported problems with the above approach. It is safe to set the default cookie
with no domain specified and then set another one with domain as ".domain.ext". In this case
there is no need for the redirects.
However, remember that session cookies are set by the web server software and you may not
have control over how the cookie domain is set.

Web Hosting :: Subdomain Configuration

Subdomain Configuration
A subdomain configuration is very similar to a domain name configuration. The only difference is that the subdomain entry is tied to the corresponding domain name lookup. A request for the subdomain (e.g. http://content.iatahni.com) will be routed to a DNS server containing the DNS information for the parent domain (iatahni.com). Once the DNS record for the subdomain is resolved to a particular IP address, the request is sent to the web server listening on that IP address. The web server can now delegate the request to the particular website based on the subdomain name in the host header of the request object. Various combinations of subdomain configurations are possible by using DNS server entries and web server application setup for load distribution, application isolation or security purposes.

Subdomain Setup on DNS server
The forward lookup zone of the parent domain in the DNS server should contain a pointer to the sub domain using either an alias (CNAME), a hostname (A) or a mail enchanger (MX) entry. The alias (CNAME) record is used for a subdomain if the subdomain points to a website running on the same web server at the same IP address as the parent domain website. A new hostname (A) record is used if the subdomain points to a different web server, or to the same web server listening on a different IP address (as in the case of load distribution).

Alias (CNAME) Setup: An alias points the subdomain to the same web server, which hosts the website for the parent domain. The canonical names (CNAMES) are added for each of the subdomains as shown below. Once the subdomain is resolved to the IP address of the web server, the web server can route the request to a different website (see section on web server setup below). Note that an alias for www is setup as a subdomain by default by most hosting companies, so that requests to www.domain.com is sent to the same website that handles the requests for domain.com.

www IN CNAME domain.com.
subdomain1 IN CNAME domain.com.
subdomain2 IN CNAME domain.com.


Address (A) Record Setup: A hostname DNS entry is required if the subdomain is pointing to a different IP address than that set for the domain name. Add the address (A) records to the forward lookup zone of the parent domain and associate the address records with the IP addresses of the web servers, which will handle the requests for the subdomain.

subdomain1 IN A 123.2.33.45.
subdomain2 IN A 123.2.33.46.


Mail Exchanger (MX) Setup: The mail exchanger subdomain configuration is required if an email server is setup to handle the subdomain mail accounts. For example, an email address like joe@arts.myschool.edu will require a subdomain setup for resolving the mail server for arts.myschool.edu. The setup is similar to the CNAME setup but with MX records.

subdomain1 IN MX 10 subdomain1.domain.com.
subdomain2 IN MX 10 subdomain2.domain.com.


Note: If the sub-domain is configured on another DNS name server, a Name Server (NS) record has to be created for the sub-domain on the corresponding domain name DNS server, so that it can delegate the sub-domain lookup to the other name servers. Using different name servers can eliminate security issues in cases where the sub-domains are maintained by separate administrators. However, the lookup carries an additional overhead.

Configuring the web server for sub-domains
Once the DNS server is setup to send the request for the sub-domain to the corresponding IP address, the work of the web server begins. The web server needs to be configured appropriately to handle the request for the sub-domain based on either the IP address or the host header entry. Host headers are commonly used by web servers to host multiple domains or sub-domains on one IP address.

Microsoft Windows IIS : In case of Internet Information Server (IIS), create a new web site for the subdomain using the IIS Manager, and add the sub-domain (e.g. subdomain.domain.com) as a new host header value listening to the same IP address as specified in the DNS entry. The port is set to 80 (the default for http requests). The host header can be added by clicking on the advanced tab next to the IP address configuration for that web site application. If the subdomain points to a subdirectory of the web site for the domain, then set the home directory for the subdomain web site to the subdirectory. For example, if the domain.com points to C:\Inetpub\wwwroot\ and the subdomain needs to be setup for C:\Inetpub\wwwroot\subdomain, then the directory for the subdomain website should be set to C:\Inetpub\wwwroot\subdomain.

Apache Web Server : In case of Apache web server, the subdomain is configured by virtual host entries in httpd.conf as shown below.

Listen 80
NameVirtualHost *
<virtualhost>ServerName www.domain.com
DocumentRoot /home/httpd/htdocs/
</virtualhost><virtualhost>ServerName subdomain.domain.com
DocumentRoot /home/httpd/htdocs/subdomain/
</virtualhost>

example:
Listen 80
NameVirtualHost *

<virtualhost>
ServerName www.iatahni.com
DocumentRoot "C:/WWW/public_html"
</virtualhost>

<virtualhost>
ServerName wap.iatahni.com
DocumentRoot "C:/WWW/public_html/wap"
</virtualhost>

<virtualhost>
ServerName aksi.iatahni.com
DocumentRoot "C:/WWW/public_html/aksi"
</virtualhost>

Conclusion
Sub-domain configuration starts with an entry in the DNS server of the parent domain and the lookup resolves the sub-domain to an IP address of the web server. The web server in turn delegates the requests based on its configuration for the sub-domain. Various sub-domain configurations can be used effectively to distribute the load evenly among available web applications or web servers listening to different IP addresses. The load distribution is achieved by the DNS round robin feature of the BIND. Other uses include application isolation, simpler and professional looking URL, content categorization etc.

Friday, April 3, 2009

Settings at the php.ini

The php.ini file located at the php home folder ,something like this c:/www/php/php.ini.
Now i have point out some important settings which is highly recommended ::
[note: leading ; (semi-colon) indicates comment line]

1. Php file Upload Settings
;;;;;;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 30M
post_max_size = 100M

2. Database Connectivity settings
; if ur using mysql then enable (remove leading semi-colon)
extension=php_mysql.dll
; if ur using postgreSQL then enable
extension=php_pgsql.dll


Hope , it would help u.

Wednesday, April 1, 2009

Installing PHP 5.2.3, MySql 5.0,Apache2.2 on Windows XP





I am working with WAMP technology . As of my experience newer supposed to be struggle when configure WAMP.Here is the configuration notes of PHP to work with MYSQL and Apache2.2 on a Windows XP machine. These are the steps I took. Hope that they work for you...

I installed PHP and MySQL on Windows XP platform with Apache2.2. Please note that PHP,mySQL and Apache is open source , the first thing I did was search google for "Download Apache2.2 " and go to Apache official site to download and Install it.

Download Apache2.2 from here

(Apache2.2 download link)


* PHP 5.2.9-1 installer [17,304Kb]: Click Here to Download

* Download MySQL 5.0 : Click Here to Download

* Download MySQL 5.0 GUI Tools : MySql 5.0 GUI Tools (Tools to help you administer database)


Installing Apache2.2

  1. If 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.11-win32-x86-no_ssl MSI installer here: (http://httpd.apache.org/download.cgi)

  2. Save the file to your Windows Desktop.



  3. Apache Web Server Install Window


    Apache Web Server Install Window

    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:

    1. "Network Domain": localhost

    2. "Server Name": localhost

    3. "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 folder C:\www\Apache2\ (assuming C: is your main hard drive). So in the text box "Folder name:" type in "C:\www\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:


    Apache Ready to Install


    Apache Ready to Install

  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.
Tips::
  • To check that the software was in fact installed successfully, open your favorite browser and type "http://localhost/" into the address bar. You should see a page that looks like this:


    Apache Success


    Apache Success

Installing the PHP

Instructions for installing the PHP Engine.

  1. If you haven’t done so already, download the PHP Windows Binaries - You can download the software from the PHP.net website, (http://www.php.net/downloads.php) Be sure to download PHP 5.0.4 installer Windows installer and PHP 5.0.4 zip package. (Note: the version numbers might be different). Save the files on your Windows Desktop.

  2. On your Windows Desktop, double click the PHP installer file. Once you've done that, you should see a window that looks like this:

    PHP Install Window


    PHP Install Window


  3. Click "Next>".

  4. On the next window, click "I Agree".

  5. On the next window, click the radio button "Advanced", and click "Next>".

  6. We're going to install PHP in our server directory instead of the default PHP directory, so in the "Destination Folder" group, click "Browse".

  7. A browser window will open. Change the destination directory to "C:\www\php". There is no need for a trailing backslash.

  8. Click "OK" on the browser window, and then click "Next>".

  9. Select "Next>" on the next three screens.

  10. On the following window, leave the SMTP defaults as they are, and click "Next>".

  11. If you want, you can enter an email address. This will be used as the "From:" email address when using PHP's mail function.

  12. On the next window, make sure that the radio button "Display all errors warnings and notices" is clicked. Then click "Next>".

  13. On the next window is where you pick which web server software you are using. Since you have installed Apache, pick "Apache" from the list. Then click "Next>".

  14. On the next window make sure that the check box ".php" is checked, and then click "Next>".

  15. Now that you have set all the options, you should see a window that looks like this:


    PHP Ready to Install


    PHP Ready to Install


    PHP is ready to install, so click "Next>" to begin the installation.

  16. If a message window pops up asking, "Do you want to keep your php.ini file", click "NO".

  17. Now a message window should pop up that looks like this:

    Image:apache_configuration.jpg


  18. This is normal. Click "OK". When the PHP installer window pops up, click "OK" again.

  19. Now PHP is installed, but we need to change some of Apache's settings to get everything working the way it should.

  20. In Windows open "My Computer", and browse your way to the folder "C:\www\Apache2\conf".

  21. Double click the file "httpd.conf" so we can edit it. This should open the file in Notepad.

  22. Scroll to the very bottom of the page, and add these lines:

    1. ScriptAlias /php "c:/www/php/"

    2. AddType application/x-httpd-php .php

    3. Action application/x-httpd-php "/php/php-cgi.exe"


  23. You should highlight and copy the text from this page, and then paste it into the httpd.conf page to ensure there are no typos. Hit "Enter" after the last line to ensure there is one blank line at the end of the file.

  24. When we installed PHP, it created the file "C:\Windows\php.ini". We want to move that file to the directory "C:\www\php" so it’s easier to edit when we need to. # Open "My Computer" and browse to "C:\Windows".

  25. Find the file "php.ini" in the windows directory.

  26. Right-click the file and pick "Cut".

  27. Now browse to the directory "C:\www\php".

  28. Right-click an empty area in the window and select "Paste". This moves the "php.ini" file from the Windows directory to the PHP directory.

  29. Now double click the file php-5.0.4-win32.zip that is saved on your desktop. (Note: the version number might be different).

  30. Extract the contents of this file to "C:\www\php".

  31. Using Notepad, open the file "C:\www\php\php.ini".

  32. Find that line that reads: extension_dir = "./" (or something similar, as long as its the line with "extension_dir".

  33. Change the line to: extension_dir = "c:\www\php\ext"

  34. Now find the line that reads: ;extension=php_mysql.dll Delete the ; so that the line now reads: extension=php_mysql.dll

  35. Now open the directory "C:\www\MySQL\bin".

  36. Find the file "libmysql.dll".

  37. Right-click the file and select "Copy".

  38. Browse to the directory "C:\Windows\System32" and Paste the file into that directory.

  39. Now you need to restart Apache to ensure the new lines added to the httpd.conf file have an effect.

  40. On the Windows taskbar click "Start">"All Programs">"Apache HTTP Server">"Control Apache Server">"Restart". This should restart the Apache server. Now we need to create a test PHP to see if everything is working.

  41. Open Notepad (usually found in "Start">"All Programs">"Accessories">"Notepad"), and copy and paste the following lines into a new document: <?PHP phpinfo(); ?>

  42. In Notepad, click "File">"Save". Save this file in the directory "C:\www\Apache2\htdocs" as "phpinfo.php". Notepad has a bad habit of adding .txt to the end of all documents you save, so make sure from the "Save" dialog that comes up in Notepad, change "Save as type" from "Text Documents (*.txt)" to "All Files". Now click the "Save" button to save your new PHP document.

  43. Open your favorite browser and in the address bar type "http://localhost/phpinfo.php". If everything is set up correctly, you should see a page that looks like this:


    PHP Success


  44. PHP is now installed!

Tips

If you want to save your time, use XAMPP software bundle or WITSuite EasyInstaller (WITSuite installation video: http://www.witsuite.com/products/installer/). It is most simple way to install Apache, PHP, MySQL on Windows.

    • Be sure to make these last changes to the Apache configuration file to prevent a 403 FORBIDDEN message when testing to see if PHP has been successfully installed.

  • <Directory "c:/php/">

  • AllowOverride None

  • Options None

  • Order allow,deny

  • Allow from all

  • </Directory>

INSTALLING MYSQL

Step 1: Install MySQL 5.0.

Step 2: Install MySQL 5.0 GUI Tools. These will allow you to view your databases and data structures

Step 3: Configure an Instance: The best way I configured it to work successfully was once it was installed to go into the "MySQL Server Instance Configuration Wizard" and click "Detailed Configuration", "Developer Machine", "Non-Transactional Database Only", "Decision Support (DSS)/OLAP", "Check Enable TCPIP Netwokring", Port 3306, "Standard Character Set", "Install as a Windows Service", Give it a main password that you remember like "root", Click "Execute!!".


*** Please note your username will be "root" and password will be whatever you typed (in this example "root"). After you hit "Execute", You should see 4 buttons light up with no red 'X's and you know MySql is configured correctly!


Step 4: Open the MySQL Administrator program. Set server host = localhost, username=root and password=root or whatever you set it to. Click on catalogs, if you see "mysql" then that is a main database.

This means that MySQL is installed properly!!

Step 5: I have provided a simple PHP script to test database connection to
MYSQL. Copy and paste this into a file call it for example: "testmysql.php"

and place it into the web root folder (same folder as "phptest.php")

Step 6: If you run this script by typing: http://127.0.0.1/testmysql.php
and it says "Successfully Connected to MySQL Database Manager!" and "Successfully Connected to Database 'MYSQL'" then this means that MySQL is now communicating with PHP and is installed and working properly!!!

Hope it helped!


Installing PHP 5.2.3, MySql 5.0, IIS 6.0 on Windows XP

After hours of trying and re-trying and fustration, I finally installed PHP to work with MYSQL and IIS 6.0 Manager on a Windows XP machine. These are the steps I took. Hope that they work for you...

I installed PHP and MySQL on Windows XP platform with IIS 6.0. Please note if you are running IIS 5.0 Manager that comes with the Windows CD, the first thing I did was search google for "Download Microsoft IIS 6.0 Manager" and go to Microsoft to download and Install it. Once installed IIS 5.1 and IIS 6.0 manager will coexist in "Control Panel -> Administrative Tools".

(I haven't used IIS7 so I cannot comment on it yet)

Also download the following 3 items:
(Read Article Download Disclaimer First)

* PHP 5.2.9-1 installer [17,304Kb]: Click Here to Download

* Download MySQL 5.0 : Click Here to Download

* Download MySQL 5.0 GUI Tools : MySql 5.0 GUI Tools (Tools to help you administer database)



INSTALLING PHP
Step 1: Configure IIS 6.0 to point to a local folder where your webfiles. Don't forget to create a file called "index.htm" (or index.html) add some HTML like a picture or fancy text font. Once you configure it, you should be able to see it by typing http://127.0.0.1/ or http://localhost/ from the URL of Internet Explorer/FireFox.

Step 2: Create a folder on C: called "PHP" and unzip the files from the PHP download into that folder. You should see a a bunch of DLL's and additional sub-folders called "ext", "extras" and "dev" with files in there as well.

Step 3: Open IIS6 Manager Right Click -> Default Website -> Properties -> Select Home Directory -> Select Configuration. On Application configuration check to see if .php is in list. If not click "Add". For executable browse to "c:\php" folder and select "php5isapi.dll". Click "OK" and then "OK" again.

*** Here is the Visual Illustration on this Step ***


Step 4: Create a test file in the root of your web folder called "phptest.php" and insert the code below:


Step 5: In the "C:\PHP" folder copy the file "php.ini-recommended" to your C:\WINDOWS folder. Rename this file to "php.ini"

Step 6: Reboot the computer.

Once fully rebooted in the URL bar of IE, type "http://127.0.0.1/phptest.php" and you should see it give you information about the PHP version.

If you see this then you know it worked properly and PHP is installed successfully!



INSTALLING MYSQL
Step 1: Install MySQL 5.0.

Step 2: Install MySQL 5.0 GUI Tools. These will allow you to view your databases and data structures

Step 3: Configure an Instance: The best way I configured it to work successfully was once it was installed to go into the "MySQL Server Instance Configuration Wizard" and click "Detailed Configuration", "Developer Machine", "Non-Transactional Database Only", "Decision Support (DSS)/OLAP", "Check Enable TCPIP Netwokring", Port 3306, "Standard Character Set", "Install as a Windows Service", Give it a main password that you remember like "root", Click "Execute!!".

*** Please note your username will be "root" and password will be whatever you typed (in this example "root"). After you hit "Execute", You should see 4 buttons light up with no red 'X's and you know MySql is configured correctly!

Step 4: Open the MySQL Administrator program. Set server host = localhost, username=root and password=ksbalu or whatever you set it to. Click on catalogs, if you see "mysql" then that is a main database.

This means that MySQL is installed properly!!



CONFIGURING PHP TO WORK WITH MYSQL
Step 1: In the C:\PHP folder copy the file "libmysql.dll" to your C:\WINDOWS\SYSTEM32 folder. Make sure you don't overwrite any existing file in this folder. If file exists, first rename it so you can go back.
*** Why IIS simply does not read the PHP directory? ...I do not know ***

Step 2: Edit this file "php.ini" that you copied to your C:\WINDOWS folder using a text editor like notepad. Find the line where it says "extension_dir = *something*". Uncomment this line by removing the preceding semi-colon. and set it to say: extension_dir="c:\php\ext"

Step 3: In the same file "php.ini" also un-comment out 2 other lines by removing semi-colon. Find the lines where it says: extension=php_mysql.dll and extension=php_mysqli.dll and uncomment both lines by removing the semi-colon.

Step 4: Reboot the computer

Step 5: I have provided a simple PHP script to test database connection to MYSQL. Copy and paste this into a file call it for example: "testmysql.php"

and place it into the web root folder (same folder as "phptest.php")

Step 6: If you run this script by typing: http://127.0.0.1/testmysql.php
and it says "Successfully Connected to MySQL Database Manager!" and "Successfully Connected to Database 'MYSQL'" then this means that MySQL is now communicating with PHP and is installed and working properly!!!
Hope it helped!