can anyone host a website

12
Can anyone host a website? Before we go any further in this article, we should mention that many Internet service providers consider hosting a website on a personal Internet connection to be a violation of the user agreement. This is especially true of cable-based service providers. In many cases though, a personal website with a small amount of traffic is not an issue. Check the terms of your service contract before hosting a website on a personal internet connection in order to avoid unpleasant surprises later on. Understanding IP addresses and DNS In order to understand the rest of this article, the function of IP and !" addresses must first be grasped. If you feel know these sub#ects already, feel free to skip to the ne$t part of this Beginners %uide. IP addresses& a computers' digits (n IP address is the computer's address on whatever network )including the Internet* it happens to be on. +aving a valid IP address allows a PC system to send and receive data over a network correctly. This address takes the form of four sets of decimal numbers, -, for e$ample& /0./12..3 4ach network adaptor installed in a computer must have its own IP address, so it's 5uite possible for a PC to have more than one IP address. To look at a computer's IP address)es*, open the command prompt )start6run and type 'cmd'* then type 'ipconfig'. (s we can see here, the IPC7!8I% command shows three values for each IP address9 the address itself and a subnet mask and default gateway. The subnet mask is used to separate each IP address into a host and a network portion. The host portion of the address indicates the computer's e$act address within its network, while the network portion indicates the network the computer belongs to. (ll computers with the same network portion of an IP address can communicate with each other provided there is some way to transfer signals between them. The Subnet Mask (of Zorro) ( subnet mask is shown in the same format as the IP address )for e$ample ...*. (s far as this Beginners %uide is concerned, assume that the values of the 3 sets of numbers in the subnet mask can be either or . "ets with the value of indicate the host portion of the IP address, and sets with the value of indicate the network portion. 8or e$ample, with an IP address of /0./12.:. and a subnet mask of ..., the network portion of the address would be '/0./12.:', and the host portion would be '.'. This means the computer assigned this address is host within the /0./12.: network. ( !etworks' efault %ateway

Upload: roshanpurandhar

Post on 02-Nov-2015

217 views

Category:

Documents


0 download

DESCRIPTION

Can Anyone Host a Website

TRANSCRIPT

Can anyone host a website?Before we go any further in this article, we should mention that many Internet service providers consider hosting a website on a personal Internet connection to be a violation of the user agreement. This is especially true of cable-based service providers. In many cases though, a personal website with a small amount of traffic is not an issue. Check the terms of your service contract before hosting a website on a personal internet connection in order to avoid unpleasant surprises later on.Understanding IP addresses and DNSIn order to understand the rest of this article, the function of IP and DNS addresses must first be grasped. If you feel know these subjects already, feel free to skip to the next part of this Beginners Guide.IP addresses: a computers' digitsAn IP address is the computer's address on whatever network (including the Internet) it happens to be on. Having a valid IP address allows a PC system to send and receive data over a network correctly. This address takes the form of four sets of decimal numbers, 0-255, for example:192.168.5.45Each network adaptor installed in a computer must have its own IP address, so it's quite possible for a PC to have more than one IP address. To look at a computer's IP address(es), open the command prompt (start\run and type 'cmd') then type 'ipconfig'.As we can see here, the IPCONFIG command shows three values for each IP address; the address itself and a subnet mask and default gateway. The subnet mask is used to separate each IP address into a host and a network portion. The host portion of the address indicates the computer's exact address within its network, while the network portion indicates the network the computer belongs to.All computers with the same network portion of an IP address can communicate with each other provided there is some way to transfer signals between them.The Subnet Mask (of Zorro)A subnet mask is shown in the same format as the IP address (for example 255.255.255.0). As far as this Beginners Guide is concerned, assume that the values of the 4 sets of numbers in the subnet mask can be either 0 or 255.Sets with the value of 0 indicate the host portion of the IP address, and sets with the value of 255 indicate the network portion. For example, with an IP address of 192.168.3.25 and a subnet mask of 255.255.255.0, the network portion of the address would be '192.168.3', and the host portion would be '.25'. This means the computer assigned this address is host 25 within the 192.168.3 network.A Networks' Default GatewayTo communicate with different networks (that is, computers with IP addresses that use a different network portion), a gateway must be used. At its simplest, a gateway is any device which has two or more network adaptors, each connected to a separate network. Computers on one network can pass data to the gateway, which then forwards it to the desired computer on the other network. This is the fundamental structure of the Internet.The default gateway address shown in by the IPCONFIG command you tried just a moment ago indicates where data will be sent if you try to contact an IP address outside the local network. In the case of most home network setups, the default gateway will be the router or Internet sharing device.Public and Private IP AddressesAs far as this Beginners Guide is concerned, there are two types of IP addresses; private and public. Private addresses are usable only within private networks and cannot be used on the Internet, as the gateways that make up the Internet will refuse to pass on information coming from a private IP address. Public addresses are Internet-ready, and can transfer information to any other public IP address over the Internet. When a PC connects to an Internet service Provider, it receives a public IP address (or the home router used to connect one's network does).If you have a home network using a router or Internet-sharing device, each of the computers will receive a private IP address from the router, which in turn has received a public IP address from the service provider. When one of the computers uses a browser to connect to the Internet, the router receives the request first and replaces that computer's private IP address with its public one. When the web site data comes back from the Internet, the router performs the same operation in reverse, sending the data to the computer that requested it.Dynamic and Static IP AddressesDepending on the Internet service provider, a PCs public IP address is either static or dynamic. Static IP addresses are usually found in 'always on' services like cable Internet connections and never or rarely change. Dynamic IP addresses are common to DSL Internet providers and change every single time the user connects to the service. No additional steps need to be taken to host a website on a static IP address connection, but hosting on a dynamic IP introduces some complexities which PCSTATS will cover a little later in this Beginners Guide. Stay alert.DNS: The Friendly Face of the InternetBefore we show you how to install Apache web server and start hosting a web site, you'll probably want to acquire a DNS domain name for that website. This will allow visitors to type 'www.(yoursitename).(com\org\ca\whatever)' to visit the website instead of having to memorize a server's 9-digit IP address.DNS (the Domain Naming System) provides a simple way of navigating the Internet. Instead of having to memorize the IP address of each website, users can simply type a friendly URL like www.pcstats.com to get there. The DNS name (www.pcstats.com) is mapped to the IP address of the PCSTATS web server, allowing anyone to visit our site without knowing its current IP address.A system of DNS servers shadows the growth of the Internet and provides a means of connecting DNS names with web servers. When a person acquires a domain name through a registrar site, the IP address is linked to that name, allowing users to connect to a web server via the simplewww.(yoursite).com/net/org/whateverURL system. A central governing body (ICAAN) controls the allocation of domain names, ensuring that the system remains conflict-free.When a user typeswww.pcstats.cominto the browser's address bar, the computer sends that address to a DNS server on their network or the Internet, looking to have it translated into an IP address that it can contact directly. That DNS server will send back the IP address if it knows it, and if it doesn't, it will contact other DNS servers all the way up to the root of the Internet until it finds the address it's looking for. The entire process generally takes less than a second.Acquiring a DNS Domain Name (URL) for a WebsiteTechnically, one does not need to have adomainnamefor a website. There's nothing stopping you from simply using a web server's IP address for all traffic. If you're making a private site for yourself and a few of friends, this may be all that's needed. On the other hand, if you want general Internet traffic to have even a chance of visiting the website, you better get out there and get a URL that ordinary humans can remember.If you've made up your mind, there are a couple of ways togetadomainname for a website. The most straightforward way is to visit one of the many, many domainnameregistrationservices. There's a lot of choice out there, so do some research and try to find a reputable service in your home country. A central body (ICAAN) governs alldomainnameregistration, so the various registration services have purchased permission to lease domain names to consumers for a period of time.Once a domain nameregistrationserviceprovider to your liking has been found, the next step is ensuring the domain name you've thought of is not already registered. All registration services should include adomainlookuptool as part of their tools. Using this, try out the prospective website domain name and see if anyone else has already claimed it.If it is available, choose the extension (.com, .org, .net, etc.) and register the domain name. Remember that it is being registered for only a certain length of time, measured in years. After this expires, you will have to renew or risk losing the name to someone else.Once the domain name is registered, the registration service's tools should help you link it to the web server's IP address. From this point on, anyone who entersyourdomainname into a web browser will be directed to your Apache server.Getting aDNSnamefor freeIt is quite possible to get a free DNS name, as there are services out there which provide just such a thing. The obvious drawback of this is that the user generally has to choose from the limited selection of names which each particular service has available. Still, it's better than using a plain IP address. Here are a couple of places to start -here,andhere. These are the same services that provide dynamic DNS solutions as detailed below. The domain names can be used for static or dynamic IP addresses interchangeably.Using a dynamic DNS service to host a websiteFor computers with a dynamic IP internet connection, like DSL, the public IP address changes every time the computer connects to the Internet. This can be a serious barrier to hosting a website. The domain name you acquired connects to one IP address only, so when a web server's address changes frequently, everyone who uses the domain name as a URL to visit that website will get an error message, and not be able to resolve the site's content.Configuring firewalls for website hostingFortunately, various free 'dynamic IP' services are available to translate the PCs dynamic IP to a static one which can be stored within the DNS record. Generally speaking, these services allow users to choose from a range of free domain names, and then require the installation of a client application on the host PC web server.This program reads the current dynamic IP address of the PC and sends it to the dynamic IP service, allowing that service provider to associate the chosen domain name with the latest actual IP address for the web server. In this way, visitors that attempt to access the website via its domain name in a browser will always be directed to the right IP address whatever the dynamic IP of the web server happens to be.Here are a couple of services to get you started:No-ip.comandZoneEdit.comConfiguring firewalls for website hostingLike most modern systems, your computer is probably using some sort of firewall software or hardware to protect it from intrusion (and if it's not,it should be). While firewalls are quite effective at protecting a computer from malicious intrusions, they are even more effective at preventing a website from being visited by anyone outside ones own computer or network.To prevent this potential problem from stopping a website cold in its tracks, we need to create an exception to the host PCs' firewall rules that allows traffic into the computer over port 80, the standard HTTP port for website viewing.To do this in the pre-Service Pack 2 version of the Windows XP Firewall, find the Internet connection by going to 'my network places' then 'show all connections.' Right click on the Internet connection's icon and hit 'properties' then 'settings'.

In the 'services' tab, scroll down until 'web server (HTTP)' is visible and check that box. In the post-SP2 version of the Windows XP Firewall, user can allow web traffic to pass through to IIS by going to 'start\control panel\windows firewall' then opening the 'advanced' tab.

Highlight the Internet connection in the 'network connection settings' window, then click 'settings.' From this screen, place a checkmark in the HTTP box and hit 'ok.' If the PC hosting the website uses an Internet sharing device like a home router (which includes a firewall itself), you will need to create a virtual server (also known as port forwarding) to allow the website to be accessible over the Internet.Creating a Virtual ServerA virtual server is a set of instructions given to the home router, telling it that if data comes in over a specific port (say TCP port 80 for hosting a website) that data should be allowed through the firewall and forwarded to a specific computer inside the network. In this way, we can make the website (or whatever else) available without otherwise compromising the host PCs' firewall security.Creating a virtual server tends to be the same in almost all home router models. First consult the documentation to find the configuration page for 'virtual servers' or the equivalent. When creating a virtual server, first enter the IP address of the computer that is hosting the website. Next, find the port that data enters that system on. Enter TCP port 80, since this is the default port for HTTP.Finally, choose the port that will be open on the router to receive incoming data. In most cases, this will be the same as the port on the host PC, so enter 80 here too. Once all this information is saved to the router, all data coming from the Internet to the firewall on TCP port 80 will be allowed through the firewall and redirected to the host computer, thus allowing access to the website.Halting IIS website hosting (Windows XP Pro/2000 only)It's important to note that the Apache service will not be correctly installed if Microsoft IIS (Internet Information Server) is already hosting a website on the computer. If there is a website up and running with IIS already, it need to be stopped before Apache can be used to host a website on the same system. Apache will not share port 80 (the default port for HTTP web traffic) with any other application, so any program that monopolizes this port (including some firewall software) may cause Apache not to install its service correctly.When IIS is installed on Windows XP or 2000, it starts hosting a basic website automatically. Given this fact, it's quite likely that if you are using Windows XP Pro or 2000, you are unknowingly hosting a site through the program. To check on this and stop IIS if necessary, right click on 'my computer' and go to 'manage'. In the computer management Window, choose 'Internet Information Services' and expand it.

Under the 'web sites' folder, the currently created websites are listed. The Windows XP IIS default website is 'Default Web Site'.

Right click on 'default web site' and choose 'stop' to stop IIS hosting the site, allowing Apache to start properly.Part 2: Installing and using Apache Web serverNow that PCSTATS has walked you the steps of acquiring a DNS name (or not) and preparing the computer for hosting a web page, it's finally time to get the Apache web server up and running. This is actually a very simple process, so follow along and that web site will be live in no time.Installing ApacheApache HTTP server can be downloaded from theApache Foundation website here, there is no fee. Make sure to download the WIN32 Binary file, which comes as an executable MSI file. The un-compiled source code is also available due to the open source nature of the project. At the time of writing, the latest version of Apache HTTP server was 2.0.54.Once that executable file is downloaded, start the installation by double clicking on the MSI file. Hit 'next' until the server information screen is displayed (at left).Apache wants three pieces of information here. The domain name and server name (URL) of the website, as well as an email address where the program can send alerts and notifications.If you're not sure, the domain name is the Internet name space that was registered or obtained, like pcstats.com for example, while the server name is the name of the machine that is hosting the actual website in that domain.In most cases, WWW is the standard name used for web servers, so if your domain was Pcstats.com, the server name would bewww.pcstats.com. If you used a free DNS or dynamic DNS service to acquire the domain name, you most likely chose a different server name as part of the process, so use that.All three of these entries must be filled out to continue the installation process. If you do not currently have a domain name, either through a domain registrar or a dynamic DNS service like No-IP.com, enter fictional addresses like (yourname).com andwww.(yourname).comfor now. We will change these once the Apache server program is installed and a domain and server name have been acquired. Of course, it's better to start the whole installation process with a valid domain name, so it would be better if you obtained one now.

Choose the typical installation option and accept the default installation folder. Hit 'install' to begin the install process.Apache Status and ServicesOnce the installation has completed, the Apache Status Monitor program will start, indicated by the icon in the taskbar.Apachecreates a servicecalled Apache2 in Windows 2000/XP to allow itself to run in the background, serving the website. Double click the Apache manager icon to make sure the service is running. You should see something like the following:

If you do not see the Apache2 service in the manager window, chances are you have a conflict with IIS or another web hosting program. Follow the instructions listed above for stopping the default IIS website hosting service. Once you have made sure that IIS is stopped, restart the Apache service manually by opening a command prompt window (go to 'start\run' and type 'cmd') and navigating to the 'c:\program files\apache group\apache2\bin' directory and typing:apache -k installThis will create the Apache2 service, allowing the Apache web server to run correctly.Testing the Apache web serverNow that the Apache2 service is successfully installed, the Apache server should be hosting a basic welcome web page on the host PC. To test this, open a web browser and type the following in the address bar:http://localhostThis tells the browser to check port 80 of the localhost, which is physically on the computer. The Apache welcome page should be visible if everything has gone smoothly, as pictured below.If not, check to make sure the Apache2 service is up and running, and that the default IIS website is not live as detailed above.If there is another computer on the same network as the Apache server, open a browser on that other system and type the IP address of the Apache server computer to get to the same welcome page. If the welcome page is not visible after doing this, chances are the Apache server computer has a software firewall that has disabled access to port 80 across the network. If this happens, follow the steps listed above for allowing port 80 access through a firewall.The final step in testing is to attempt to access the Apache web server from the Internet.If you've already registered a domain name (or acquired one from a dynamic DNS service), attempt to access that website directly from a browser by typing in the URL address. If everything is configured correctly, this should bring you back to the same introductory Apache page. Now move to another Internet-enabled computer on a separate connection and try the same thing. If you see the welcome page again, the Apache server is working fine and publicly accessible. If not, look at the router settings or Internet sharing device to make sure it is correctly configured to pass port 80 traffic through to the Apache web server on the host computer, as we have detailed above.Basic Apache configurationOne of the nicest things about Apache as a basic web-hosting program is that it needs next to no configuration from the user once installed. If your website HTML files are ready, open up the 'c:\program files\apache group\apache2\htdocs' folder. This is the folder from which Apache reads the web files, and the default file it looks for is 'index.html' just as with IIS. The 'index' file from the default welcome website currently occupies this directory, along with various versions of the same page in different languages.Delete these files, or cut and paste them elsewhere, or simply copy your own website HTML files into the directory and replace the existing 'index.html' with your own main page. Remember that the first web page of any website must be labeled 'index', so it may be necessary to rename the introductory HTML page of the website if this is not the case.Once this is done, fire up a web browser and verify that the web page is displaying correctly (the browser cache may need to be cleared, or the page refreshed a couple of times first). The final step is using an outside Internet connection to verify what Internet visitors will see upon typing in the URL of the website you've just configured, so try that out too.Exploring the Apache CONF fileUnlike IIS, Apache has no graphical interface. All management of the program is done by editing its configuration files which reside in the 'C:\program files\apache group\apache2\conf' directory.Editing these configuration files looks initially daunting, and it can be a complicated process if you are looking to configure complicated settings, but fortunately the default program settings are all anyone really needs to begin working with Apache. The main configuration file is 'httpd.doc'. The 'httpd.default' text file is an exact copy, and is intended to provide a fallback to the default settings in case a mistake is made while editing the original.The httpd.doc file is well documented, so there is help there if you decide to experiment. Let's take a quick look at three of the most relevant configuration file settings, even though these do not have to be changed to get a website up and running.Apache Home DirectoryThe first setting we need to get to grips with is Apache server's home directory. This is the directory which will contain the files (documents) making up a web page. Using IIS, this would be located in C:\inetpub, while Apache defaults to the 'c:\program files\apache group\apache2\htdocs' directory.For the purposes of this PCSTATS Beginners Guide, there's no need to change the default setting, but at some point you'll probably want to create a separate website directory on a dedicated hard drive though. To do this, find the 'documentroot' setting in the httpd.doc file and change it to the directory of your choice. We'll also have to change the same setting again a little further down the page. Read the comments in the file for help.Domain and Server NameIf Apache was installed before a domain name was registered, or the name of the domain or server has been changed, we need to make some adjustments. These changes can be made in Apache HTTP server by editing the httpd.doc file. Find the 'servername' entry in the file and change it to the appropriate value.Creating a simple website to test ApacheWhile this Beginners Guide will not deal with creating or editing web sites or HTML files for use with Apache, we are going to cover how to create a basic (very basic) HTML file to serve as your 'home page' for testing Apache. All we are going to do is fire up a word processor, type a few lines, then save the resulting document as an HTML file, something most word processors can do easily. While the resulting file will not do (obviously) for creating complex websites, it does just fine as a tester to make sure everything is working fine with the web server.Open Word or another fairly recent word processing program (WordPerfect, OpenOffice, and even Notepad will do just fine). Create a new document and type "Apache home page test" or something similar in the document. Now go to the 'file' menu and select 'save as.'In the save as window, select the 'file type' dropdown box. Change it to 'web page' (for Microsoft Word users) or 'HTML document' (for users of OpenOffice). Save the file as 'index.html' in the following location: 'c:\program files\apache group\apache2\htdocs'. This will ensure that it is the first HTML document that the Apache server attempts to open when a web page is requested. You will have to move or delete the other files in the 'htdocs' directory first though. They are the files for the default 'welcome' page and can be safely removed.This index.html file is a very simple webpage, which means that anyone who attempts to access the website you've just configured in Apache will be greeted by it.Now that you know how to host a basic website with Apache, you can dig deeper into the documentation yourself.Apache is available on Linux platforms as well as Windows (and indeed it originated there), so learning the basics of the program in Windows will serve well if you ever decide to experiment with alternativeoperating systemssince the interface is essentially the same.If you have any comments or questions, please post them in the PCSTATSForums. Find out about this and many other reviews by joining the WeeklyPCstats.com Newsletter today!Catch all of PCSTATS latest hardware reviewsright here.

-RSS Feed Setup & Subscriptions-Windows XP Service Pack 2-Firewall Setup and Configuration-Eliminating Spyware and Hijacker Software-Diagnosing Bad Memory-101 Tips and Tweaks for WindowsXP-Burning CDs and DVDs-Optical Drives & Recording Formats-Securing Your Wireless Network-Little Known Features of WindowsXP-Ergonomics & Computers-Annual PC Checkup-Installing WindowsXP-Encryption and Online Privacy-Home Networking and File Sharing-Forgotten Passwords & Recovery Methods-Preventing Data Theft from a Stolen Laptop-Creating a Weblog / Blog-Installing RAID on Desktop PCs-RAM, Memory and Upgrading-Ten Steps to a Secure PC-Flashing A Motherboard BIOS-Windows XP Safe Mode Explained-Upgrading Win98 to Windows XP-USB Memory Drive Projects-104 Great Tech Tips for Windows XP-Unattended Windows 2000/XP Installations-Linux Part 2: Installing a PC-Understanding and Tweaking WindowsXP Services-Linux Part 3: Installing New Software-The Registry: Backups, Repairs, and Protection-Diagnosing Bad Hard Drives-Decrypting Document & Zipped File Passwords-Spyware protection and Removal-Wireless home networking-Internet Connection Sharing-Remote Access to Computers-Hard Drive Data Recovery-Firewalls and Internet Security-Back up and Restore Data in WinXP-Assembling Your Own PC-VPNs and Internet Connection Security-Legally Copying Software and Music-Setting up a FTP Server in WinXP-Creating MP3 Music Files-Stopping Spam-Cloning WindowsXP-Browser Hijacking and How to Stop It-Printer Sharing on a Home Network-Converting Videotape Into Video Files-Creating a WindowsXP Install CD with Service Pack 2-Creating a Flashing a Video Card BIOS-Making DVD Movies from Video Files-Synchronizing Files and Folders-Crash Recovery and the Blue Screen of Death-Most Common Ways to Kill a PC-WindowsXP Command Prompt-Linux Part 1: Getting Familiar-Understanding and Creating Batch Files-Website Hosting From A Home PC-Formatting and Partitioning a Hard Drive