Sunday, June 21, 2009

How to set up our own web server?

How to host websites and create domain names on our own without using any hosting/domain registrar service?



How to set up our own web server?





Thats a small question with a big answer. I%26#039;ll give you some of the highlights.



To host websites you need a capable machine, a capable OS, and capable internet connection, and a couple other things. How capable? That depends on how many sites and what kind of accessory programs they need.



Here is a typical Windows/IIS webserver setup.



We run dual processor 2.8 xeon machines with 4G of ram. They have a RAID drive array with 2 drives mirrored for the OS and 3 drives in RAID5 configuration for the data. They are hot swap and we keep a spare drive available for each in case of a failure. The servers are located in a co-lo at a local phone company and have static IP addresses bound directly to the machine (they do more than just serve web pages so more than one address is bound to each). They also have a second NIC which has a local IP bound to it and connected to a switch which is connected to the other servers for backend transfers. This server hosts 200-300 websites ranging from static html pages to cold fusion pages to PHP/ASP pages. The non static pages need to have software and/or databases running in the background so your machine needs to have more muscle if you are running stuff like this or less muscle if you are just hosing static sites. You will want to have FTP access to the machine so you can upload websites to it and you will most likely want a seperate IP for this. You would also most likely need some FTP server software to control access if someone other than you will be uploading sites. Once sites are in the domains directory, you go into IIS and create a new site entry. The site entry needs to point at the index page of the site. Once that is done you go into the IIS properties of that page and assign your web hosing IP to the site and add the WWW entry. From there you need to make a DNS entry. Our webservers have thier own DNS servers but you can point your registars nameserver to your server%26#039;s IP directly. Most webhosts point it at thier DNS so they can have better control but you didn%26#039;t ask about DNS so I will keep that simple. Once the name you have bought is pointed at your server%26#039;s IP (or you DNS servers hostname) then IIS will serve up that website associated with that domain name. That is just the basics of serving the site, there is alot more to it than that but it%26#039;s too much to write here.



As for registering domain names, I will leave that one to someone else. That is a big investment and I will tell you that most web design/web hosting houses just buy the names like everyone else does. It is not cost effective to do that on your own, especially where there are so many out there offering the service for a couple of bucks a year. For instance lets say we had to pay $7 a year per name for all the names of the sites we host. Thats $1400-2100 a year for the sites on one server. You couldn%26#039;t even come close to buying the hardware or software you would need to accomplish that for that small amount of return.



If you want to get into the webhosing market, I recommend starting small and setting up a test server. Get a cheap OS like 2000 server and use IIS to serve a couple sites you create yourself from a static IP highspeed business connection at home. You will learn how things go and see what I am talking about. You can do most DNS functions from the registars servers and you can see what you need to deal with. Once you get the hang of it, you will find you can set up a small webhosting deal at a co-lo for about a $10k initial investment. If you do good work and take care of your equiptment/software, your business can grow. That%26#039;s how my boss started and we are still going strong 7 years later.



If you are thinking about hosting a couple of sites from your house and not doing commercial work, then you need to check with your ISP and make sure they allow that type of traffic. Some home ISPs block the necessary port that would allow you to serve web pages. You can usually serve a couple sites off an old PC with a cheap OS and IIS. If you want to learn Linux/Apache you can get the software for free but it is a lot to learn. You can just buy the domain names and let thier DNS do the work for you. Since the server is local, you don%26#039;t need FTP. I will suggest that memory and hard drive speed is more important for serving static sites. Processor speed doesn%26#039;t really come into play until you need to run background apps like JAVA, CF, mail, or shopping cart software.



Thants a lot to think about.



Best of luck to you.



G

No comments:

Post a Comment