Set up a local web server/website
By adarsh on Jan 4, 2009 | In Web Development | Send feedback »
What is a Web Server and Why we need it ?
A computer program that is responsible for accepting HTTP (Hyper Text Transfer Protocol) requests from clients (user agents such as web browsers), and serving them HTTP responses along with optional data contents, which usually are web pages such as HTML documents and linked objects (images, etc.). (From Wiki)
And why we need it is because to test/work our website in an active
environment, Simple ![]()
So what all things you need to get started ?
1) Windows 2000/XP/ (Vista?)
2) A drive/partition on your PC to group everything neatly/
Default installation dir C:\Program Files will work just fine
but it will get clumsy by time
3) A Web Server
Aprelium Abyss Web Server X1 or
Apache Web Server (Will talk about apache later)
cause for beginners I prefer Abyss Web Server (both are free ones)
Step 1
Download the Abyss Web Server from this link
http://www.aprelium.com/abyssws/download.php
Step 2
Install it ![]()
For help plz refer to
http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/install.html
[It's perfect and I can save some writings
]
though it would be better if you changed the installation path to some other drive like I said earlier
Step 3
Test the server, after the installation, run the program, type
127.0.0.1 in your web browser, if the success page shows, then everything is fine
Note: All the files for the website should be placed inside the
"Drive:\Abyss Web Server\htdocs"
Step 4
Local Domain name
For testing purpose it's always better to have a correct domain name than the 127.0.0.1 or the 'localhost'
Follow these steps to provide a local domain name
Go to C:\windows\system32\drivers\etc folder
Open the file 'hosts' in notepad
add "127.0.0.1 www.myweb.com" below the line "127.0.0.1 localhost"
like this
------------------------------------------------------------------
blah blah..........
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 www.myweb.com
127.0.0.1 www.yourname.com
-------------------------------------------------------------------
After editing, save the file, now you can type www.myweb.com or
www.yourname.com in the address bar to view your local website/page, (when the web server is running ) ![]()
Note: Don't give the name of any existing website, else the real site won't load, even if the Web Server is not running, this method can also be used as a parental guardian, by assigning the "not to visit" sites as 127.0.0.1
Example: on the hosts file placing "127.0.0.1 www.youtube.com" will restrict access to the real youtube site and will show the message "page not found" ![]()
More Tweaks
Coming soon.....
Feedback awaiting moderation
This post has 2 feedbacks awaiting moderation...
Leave a comment
| « Very old, yes it really is | Want to try your hand in Web Developement ? » |