If you would like your computer to be a local web server for website development, then this tutorial is for you. This is easily accomplished by installing the cross-platform, free XAMPP Lite software package.
This tutorial provides clear, step-by-step instructions on how to install, setup, and use XAMPP Lite on a Windows PC. It also discusses some other considerations when using XAMPP.
XAMPP is a PHP development environment. Is XAMPP-VM production ready? Answer: XAMPP-VM is not meant for production use, but only for development environments. The way XAMPP-VM is configured is to be open as possible to allow the developer anything. Can I use xampp to host a website? Installing XAMPP Once you've downloaded XAMPP, your XAMPP control panel should open automatically. Apache — The main crux of XAMPP, the Apache option creates an Apache server on your PC. This is what will allow you to run and edit websites on your PC through web browsers, much like one would a website. XAMMP uses port 80 by default and we are able to publish 1 website. I also use IIS for.Net projects. In this respect, I set the port to XAMMP except the 80 port. So I avoid a conflict. When we want to publish more than one website, we should do the following operations to httpd.conf (this is the current name). Setting the ports. XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP (P) and Perl (P). It is a simple, lightweight Apache distribution that makes it extremely easy for developers to create a local web server for testing purposes. Everything you need to set up a web server – server application (Apache), database (MySQL), and scripting language.
What is XAMPP?
XAMPP, a free, open source software package produced by the non-profit organization Apache Friends, is the most popular web server software package used for website development. XAMPP is (X) cross-platform, and, at minimum, contains the (A) Apache HTTP server, and supports the (M) MySQL database, (P) PHP scripts, and (P) Perl scripts. XAMPP distribution packages are available for Windows, Linux, and OS X system operating environments.
Website Server Overview
New webmasters coding primarily in HTML should choose a UNIX-based website hosting plan. The host company provides disk space on a server which holds your website documents, images, and scripts. The root directory is the top-most folder of your allocated disk space and is typically named public_html, or www, or htdocs. Your website's homepage - usually index.html (or .shtml or .htm) - must be stored in the root directory. Usually the other webpages which link to the homepage are also stored in the root.
About 70% of the webpages on the Internet are handled by Apache HTTP servers in a UNIX (Linux) environment. When an Internet user requests a website via its URL (e.g. http://www.mysite.com), the Apache HTTP server looks for the 'index' file in the root directory for that website and sends this homepage to the user's browser to render (display).
Website Testing
A website should never be uploaded to the 'live' server until all of its webpages have been thoroughly tested on the most popular browsers. This testing can be done on a local PC using the Apache HTTP server component of the XAMPP package. Your PC can act as a web server even when it's not connected to the Internet!
Your website hosting company should provide cPanel (Control Panel) or another user interface for accessing disk space and performing administrative functions. Even though you can usually use this interface to upload website files, serious webmasters should upload files using a File Transfer Program. There are several good - and free - FTP programs available, such as FileZilla.
Downloading XAMPP Lite
To download XAMPP, go to the Apache Friends XAMPP webpage. Click on XAMPP for Windows. From the XAMPP for Windows page, find XAMPP Lite. Click on the EXE file and download it to your hard disk.
The developers of XAMPP Apache are no longer creating a 'Lite' version. The last version of XAMPP Lite, version Win 32 1.7.3, can be found on XAMPP's webpage on sourceforge.net. The executable file is 'xampplite-win32-1.7.3.' For the program list and release levels, click the 'i' by the file and then click 'Release Notes.'
We have successfully installed this version of XAMPP Lite on a Windows 7 PC. However, your Windows 7 computer is not our computer nor have we installed the software on newer releases of Windows. Since this software was built in 2009, you are using this software at your own risk. This tutorial has helped a lot of folks over the years and we keep it here for archive purposes, but see links in the last paragraph. Now to the tutorial.
Installing XAMPP Lite
Before installing any new software, create a System Restore point in Windows. If you need help, read our tutorials found on the Windows menu tab.
Close all programs. Locate and double-click the XAMPP Lite file that you just downloaded. Take the default install options. (Some problems have been reported if the product is installed in a different directory).
The program will quickly install. When completed, a XAMPP program shortcut is placed on the desktop.
If you are installing XAMPP Lite on Windows 7, you may receive the following message that we did recently when installing xampplite-win32-1.7.3.exe. A black box appeared on the desktop labeled 'C:Windowssystem32cmd.exe' and displayed a series of questions. The questions, and our responses in red (often taking the default and just pressing Enter), are shown below. Modify as necessary:
- Should I add shortcuts to the startmenu/desktop? (y/n) y [Press Enter].
- Should I locate the XAMPP paths correct? Should I proceed? (y/x=exit setup}: y [Press Enter ].
- Should I make a portable XAMPP without drive letters? ... Your choice? (y/n): n [Press Enter].
- XAMPP is ready to use ... Press (Return) to continue. [Press Enter].
- The time zone has been set to EST ... Press {Return) to continue: [Press Enter].
- The next message presents six options: #1 through #5, or x. We choose 'x' because we wanted to start XAMPP by clicking on the desktop shortcut. So type x (or your choice) and press Enter. The black box should disappear.
Host Website Using Xampp Server
Customizing XAMPP Document Root (Where Website Files are Stored)
The default folder for storing your website documents is located inside the installation folder 'xampplite' or 'xampp.' Most folks prefer to change the location to a more convenient folder. Follow the directions below to change the default folder to one named 'Apache Sites' on the C-drive.
- Create a new folder on the C drive named 'Apache Sites.'
- Open Notepad. (Click Start | All Programs | Accessories | Notepad)
- Click File|Open. From the 'Look in:' box, click the C-drive and double-click the XAMPP installation folder.
- Double-click the 'Apache' folder and double-click the 'conf' folder. Then, at the bottom of the Open window, change the filetype to 'All Files.'
- Right-click on 'httpd.conf' and click Copy. Then click in a blank area of the small window and right-click Paste. (This is your backup if you mess up.)
- Now, double-click 'httpd.conf' to open it in Notepad.
- Click Edit|Find, and move the little Find box to the right side of the window.
- Type in DocumentRoot and click Find Next TWICE. Your cursor should rest on a line that specifies the document root as follows: Document Root: 'C:xampphtdocs' - or - Document Root: 'C:xampplite htdocs'
- Carefully edit this line by typing Apache Sites after C:/ so that the entire line reads: DocumentRoot 'C:/Apache Sites' ... don't delete the ending quotation mark.
- Go back to the top of the file and click at the top of the page so the cursor is at the beginning of the file. Open the Find box if not still visible and type and click Find Next TWO TIMES. The line above where your cursor should now be located says 'This should be changed to whatever you set DocumentRoot to.'
- On the line where your cursor rests, type Apache Sites after C:/ so that the entire line reads ... don't delete the ending quotation mark or greater-than mark. Cancel the Find box.
- Click File|Save, and exit out of the Notepad document.
Starting and Stopping the Apache HTTP Server
To start the Apache server, double click the XAMPP program shortcut that was placed on the desktop. Then click Start for Apache.
Windows Firewall may display a window that says 'Windows Firewall has blocked some features of this program.' Check the box next to 'Private networks' and un-check the box next to 'Public Networks.' Then click Allow access.
Once the program says 'RUNNING' you can close the Apache window by clicking X in the upper right corner.
Using XAMPP as a local server
You do not have to be on the Internet to use the XAMPP server. The Apache HTTP Server component of XAMPP allows your PC to act as a web server. Open a browser window and type http://localhost in the URL box. With some browsers, such as Firefox, you can just type localhost. The contents of the Apache Sites directory (the folder you created above) will display. If you do not see the 'Index of /' at the top of the webpage and Apache is definitely running, try typing http://127.0.0.1/ in the URL box. If this works, then 'localhost' is not defined in your Windows Host File. (Instructions for fixing this are available on the Internet.)
Virtual Host Xampp
Individual HTML files may be placed in the Apache Sites folder, or a folder can be created inside of the Apache Sites folder for each unique website you will be working on.
When you click on an HTML file in Apache Sites, the webpage should display in the browser window. If you click on a folder, Apache will display the index or homepage file inside of that folder.
Conflicts Apache May Have With Other Programs
The Apache server expects to use Port 80 on your computer. If another program is using Port 80, you may receive errors when first starting Apache. For instance, Skype uses Port 80. However, it is easy to change the port number for Skype to eliminate the conflict. Open the Skype application. Then click Tools | Options | Connections, and remove the check mark by PORT 80.
Host Website Using Xampp Free
Microsoft IIS (Internet Information Services), a competing web server program, also uses Port 80. IIS is not installed on most Windows systems by default, so this won't affect most new webmasters.
Alternately, you can change the port that Apache listens to by modifying the httpd.conf file, locate the line that specifies 'Listen 80' and change it to 'Listen 8080.' However, instead of typing localhost (or http://localhost) in the URL bar as described below to access your websites, you will have to type localhost:8080. This shouldn't be a big problem if you create a bookmark for the page in your browser.
Security and Apache XAMPP
The product XAMPP is meant to be used in a development environment, not a production environment. As such, it does not have proper security if others can access your computer. Therefore, it is essential to ensure that the XAMPP machine is not accessible to others on the Internet or private network by using a Firewall and other security measures, if necessary.
Other Potential Problems
The Apache website has a special section on XAMPP for Windows FAQ. Some of the topics covered are: not enough system memory, XAMPP will not start, XAMPP using 99% of CPU resources, MySQL, and images and style sheets not displaying properly.
Before installing any new software, create a System Restore point in Windows. If you need help, read our tutorials found on the Windows menu tab.
Close all programs. Locate and double-click the XAMPP Lite file that you just downloaded. Take the default install options. (Some problems have been reported if the product is installed in a different directory).
The program will quickly install. When completed, a XAMPP program shortcut is placed on the desktop.
If you are installing XAMPP Lite on Windows 7, you may receive the following message that we did recently when installing xampplite-win32-1.7.3.exe. A black box appeared on the desktop labeled 'C:Windowssystem32cmd.exe' and displayed a series of questions. The questions, and our responses in red (often taking the default and just pressing Enter), are shown below. Modify as necessary:
- Should I add shortcuts to the startmenu/desktop? (y/n) y [Press Enter].
- Should I locate the XAMPP paths correct? Should I proceed? (y/x=exit setup}: y [Press Enter ].
- Should I make a portable XAMPP without drive letters? ... Your choice? (y/n): n [Press Enter].
- XAMPP is ready to use ... Press (Return) to continue. [Press Enter].
- The time zone has been set to EST ... Press {Return) to continue: [Press Enter].
- The next message presents six options: #1 through #5, or x. We choose 'x' because we wanted to start XAMPP by clicking on the desktop shortcut. So type x (or your choice) and press Enter. The black box should disappear.
Host Website Using Xampp Server
Customizing XAMPP Document Root (Where Website Files are Stored)
The default folder for storing your website documents is located inside the installation folder 'xampplite' or 'xampp.' Most folks prefer to change the location to a more convenient folder. Follow the directions below to change the default folder to one named 'Apache Sites' on the C-drive.
- Create a new folder on the C drive named 'Apache Sites.'
- Open Notepad. (Click Start | All Programs | Accessories | Notepad)
- Click File|Open. From the 'Look in:' box, click the C-drive and double-click the XAMPP installation folder.
- Double-click the 'Apache' folder and double-click the 'conf' folder. Then, at the bottom of the Open window, change the filetype to 'All Files.'
- Right-click on 'httpd.conf' and click Copy. Then click in a blank area of the small window and right-click Paste. (This is your backup if you mess up.)
- Now, double-click 'httpd.conf' to open it in Notepad.
- Click Edit|Find, and move the little Find box to the right side of the window.
- Type in DocumentRoot and click Find Next TWICE. Your cursor should rest on a line that specifies the document root as follows: Document Root: 'C:xampphtdocs' - or - Document Root: 'C:xampplite htdocs'
- Carefully edit this line by typing Apache Sites after C:/ so that the entire line reads: DocumentRoot 'C:/Apache Sites' ... don't delete the ending quotation mark.
- Go back to the top of the file and click at the top of the page so the cursor is at the beginning of the file. Open the Find box if not still visible and type and click Find Next TWO TIMES. The line above where your cursor should now be located says 'This should be changed to whatever you set DocumentRoot to.'
- On the line where your cursor rests, type Apache Sites after C:/ so that the entire line reads ... don't delete the ending quotation mark or greater-than mark. Cancel the Find box.
- Click File|Save, and exit out of the Notepad document.
Starting and Stopping the Apache HTTP Server
To start the Apache server, double click the XAMPP program shortcut that was placed on the desktop. Then click Start for Apache.
Windows Firewall may display a window that says 'Windows Firewall has blocked some features of this program.' Check the box next to 'Private networks' and un-check the box next to 'Public Networks.' Then click Allow access.
Once the program says 'RUNNING' you can close the Apache window by clicking X in the upper right corner.
Using XAMPP as a local server
You do not have to be on the Internet to use the XAMPP server. The Apache HTTP Server component of XAMPP allows your PC to act as a web server. Open a browser window and type http://localhost in the URL box. With some browsers, such as Firefox, you can just type localhost. The contents of the Apache Sites directory (the folder you created above) will display. If you do not see the 'Index of /' at the top of the webpage and Apache is definitely running, try typing http://127.0.0.1/ in the URL box. If this works, then 'localhost' is not defined in your Windows Host File. (Instructions for fixing this are available on the Internet.)
Virtual Host Xampp
Individual HTML files may be placed in the Apache Sites folder, or a folder can be created inside of the Apache Sites folder for each unique website you will be working on.
When you click on an HTML file in Apache Sites, the webpage should display in the browser window. If you click on a folder, Apache will display the index or homepage file inside of that folder.
Conflicts Apache May Have With Other Programs
The Apache server expects to use Port 80 on your computer. If another program is using Port 80, you may receive errors when first starting Apache. For instance, Skype uses Port 80. However, it is easy to change the port number for Skype to eliminate the conflict. Open the Skype application. Then click Tools | Options | Connections, and remove the check mark by PORT 80.
Host Website Using Xampp Free
Microsoft IIS (Internet Information Services), a competing web server program, also uses Port 80. IIS is not installed on most Windows systems by default, so this won't affect most new webmasters.
Alternately, you can change the port that Apache listens to by modifying the httpd.conf file, locate the line that specifies 'Listen 80' and change it to 'Listen 8080.' However, instead of typing localhost (or http://localhost) in the URL bar as described below to access your websites, you will have to type localhost:8080. This shouldn't be a big problem if you create a bookmark for the page in your browser.
Security and Apache XAMPP
The product XAMPP is meant to be used in a development environment, not a production environment. As such, it does not have proper security if others can access your computer. Therefore, it is essential to ensure that the XAMPP machine is not accessible to others on the Internet or private network by using a Firewall and other security measures, if necessary.
Other Potential Problems
The Apache website has a special section on XAMPP for Windows FAQ. Some of the topics covered are: not enough system memory, XAMPP will not start, XAMPP using 99% of CPU resources, MySQL, and images and style sheets not displaying properly.
Occasionally an anti-virus program will find false positives that are really files in legitimate programs. The Apache website states that over the years some anti-virus software has had trouble will files such as 'kill.exe' ... 'pv.exe' ... or 'xampp-control.exe'. The providers of XAMPP claim it is free of viruses and spyware, and our experience has shown this to be true.
If you are having problems or cannot find the information you are looking for in the documentation that comes with the software, check out the Apache Friends Support Forum.
We hope our tutorial on the install, setup, and use of XAMPP Lite has been helpful. Cheers!
↑ Return to the top