Instructables

How to install a web development enviornment on localhost

This instructable is to show you how to install Apache, PHP, MySQL on localhost.
Also how to set it up so that you have some cool network features, such as being able to load the root directory using the computer's name (http://desktop/index.php), being able to edit files on other computers, and access different computers through different ports while using a domain or IP.

For people who are just getting into web development, this will help you a bundle. I've been using this setup (or similar) for at least 2 years. You can code sites on localhost, and once it works perfectly, upload it onto a host.

Unfortunately, I am forced to do this on a Vista machine, since my laptop with XP is already set up, and this computer gives me ACPI errors when I install XP.
 
Remove these adsRemove these ads by Signing Up

Step 1: Configure your network card

In order for you to be able to use this on computers outside your home network, (The internet) you will need this step.
This only work if you have a router.
Go into your control panel, Network and Sharing center. Where it says Connection, look to the far right. There should be a View Status button. Click on that.
Note down your IP address, (IPv4, if you see IPv6 too) your subnet mask, default gateway, and DNS servers.
Now press close, and in the "Local Area Connection Status" window, click on Properties.
Click on TCP/IPv4, then click on properties. Check off "Use the following IP address", and enter in all the information you just noted down.
Optionally, you can use 4.2.2.1 and 4.2.2.2 for your DNS servers. I find that they update really fast compared to other DNS servers.
This ensures your PC keeps the same local IP, and the DHCP doesn't re-assign you an IP whenever you restart.

Great Post!!! your post help me lot and I hope other also...For best web development services, visit http://www.sparxitsolutions.com
I like phppgadmin for managing postresql databases also. Alittle talk about certificates or a link would have been nice.
sholst4 years ago
I have a question that would probably be quite easy for you to answer...

I just want to be able to access my database using any of the computer on my local network, yet I seem to be having some difficulty in doing that. Currently, I have the server and database working perfectly on my computer, and am easily able to access it through http://localhost. How can I allow local machines to access it as well?
Depending on the router, you can put your hostnames and ipaddresses in your router to let it act like a local dns server. Worst case scenario, you can put the hostnames and ipaddresses (s/b static) in your hosts file. Thatis what I do till I have time to set up something fancier.
cvxdes (author)  sholst4 years ago
 Local machines should be able to see it through your local ip address, or your computer name.  To check your local IP, just do an ipconfig. 
ScriptKing15 years ago
cvxdes, iahev run into a dilema. I have been running a forum site from my home server, and I have that site running because of the apache built in to xampp. I was wondering how I would set up my server so that it can host the site and being able to send emails because when you try to send emails through the forums, it won't send because I don't have a mail server. also, I'm hoping i can keep all this on one computer/server becuase that is all I have room for. I tried using the Mercury mail server built into xampp, but it then messed up my apache server, and was showing some weird mercury mail page instead of my site.
cvxdes (author)  ScriptKing15 years ago
You need to configure PHP with a mail server. It's in php.ini, somewhere.
Depends on what platform you have and tt is not just a php file mod. I do not know about mswindows, but on linux postfix is the usual candidate. Add dovecot for imap/pop3 support, and then squirrelmail if you want a web interface.
yeah, i have messed with php.ini already, and even tried using my isp's mail server, but it still doesn't work. and the fact that xampp only provides a fake sendmail doesn't help either, lol.
hcold5 years ago
Mentioning how to set password access with .htaccess and the command to ask spiders not to index your site would be a nice additive to this instructable. Well done.
eight6 years ago
Hey... really nice Instructable. Thank you. Just a thought. The speed of a Name Server update is influenced only by the TTL setting on your domain name set up In theory. Another thought is firewalls. You guys may have to make a hole in your Firewall, if you are running one. My other thought, is JSAS. I use a product called JSAS Joomla Stand Alone Server. It is a 2 click install with no configuration necessary. This allows you to use Joomla which is a wonderful web environment - a database driven web portal. It provided both versions of Joomla within the app. It has PHP, MySql Apache and Joomla built in, but you dont need to go under the bonnet. It can also run any web site or web based app you want. I love it and use it at work. (I'm a Webby) The info you provided will help people a lot. Well Done !
ScriptKing16 years ago
A very good instructable! = )
Just one question:

http://your external ip : yourport
http://your domain : yourport

means that I could go to my friend's house or my school and view my website from there off my home server right?

If so, then congratulations, you found the solution I've been looking for when it comes to hosting my own websites for free.
You can see that I made an attempt at this a few months ago when I wrote an article on the Apache softare. Just type in Apache in the search bar of Instructables if you feel like taking a look at what I wrote. Unfortunately, I could only see my website on my local network at home, not anywhere else.

Once again, thank you for providing us with valuable information! = )

Scriptking1
cvxdes (author)  ScriptKing16 years ago
Yes. You'll have to port forward port 80, and you'll need need to get an account at a free DNS site. Or if you can remember your ip.. then you can just go to that. If you want any help with it, send me a message. I can help you out on msn or aim.
Ok, thank you!
That is so cool! = )
Finally I can host my own website.
Thanks. I'll PM you my Hotmail account if I need help. Although I'll have to wait until June when I get my computer privilages back from my parents.

Scriptking1
Uru Wolf6 years ago
Cool. I was going to do one of these for a series of PHP tutorials that I have planned. With XAMPP you don't need to configure your card and router unless you want to access it from other computers or the Internet.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!