个人工具

“Quick HOWTO : Ch01 : Why Host Your Own Site”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
{{Copyedit translation}}
+
{{From|http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch01_:_Why_Host_Your_Own_Site%3F}}
{{From|http://wiki.ubuntu.org.cn/Quick_HOWTO_:_Ch01_:_Why_Host_Your_Own_Site}}
+
{{Languages|Quick HOWTO : Ch01 : Why Host Your Own Site}}
{{Translator|Billyhhzh}}
+
{{Languages|Quick_HOWTO_:_Ch01_:_Why_Host_Your_Own_Site}}
+
----
+
==介绍==
+
  
这几年网站迅速增长,并成为许多人日常生活的一部分。人们使用它们来建立有关他们日常生活的网页日记,为家庭成员提供一个保存他们记忆的地方,或者用来传递他们的工作经验。下面是一个典型的网站地址:
+
= Introduction =
 +
 
 +
Web sites have proliferated greatly over the years to become a part of everyday life for many people. People use them to create Web logs of their daily lives, provide family members with a place to store their memories or to tell people of their experiences in getting things to work. The following is a typical Web site address:
  
 
  www.linuxhomenetworking.com
 
  www.linuxhomenetworking.com
 +
 +
Businesses originally used them primarily as a marketing tool, but later expanded them to become an important part of their operations. Many companies rely almost exclusively on their Web sites to sell their products and provide both customer and supplier support services.
  
 +
The decision as to whether or not to host your own Web site can be difficult. You have to consider factors of cost and convenience as well as service and support. This chapter briefly addresses the most common issues and outline the simple network architecture for use in a small office or home on which the focus of the rest of the book will be based.
  
商业上以前主要把它们作为推广市场的工具,但后来它们成为了他们商业运作的一个重要部分。很多公司几乎只通过他们的网站来销售他们的产品,以及给客户和供应商提供服务。
+
Not all businesses departments and homes require a Web site, but the process of establishing one touches many aspects of not only Linux, but information technology as well. This book is about to setting up Linux servers to do the things that most businesses and homes need. It's about getting the job done.
  
对于是否需要建立属于你自己的网站,可能比较难下决定。你需要考虑多方面的因素,比如费用和方便性,以及服务和支持。本章简单的列出最基本的要点,并描绘应用于小型办公室或家庭的基本网络结构,本书以后章节建立在此基础之上,并将重点描述。
+
With this in mind, the book is divided into three sections of gradually increasing complexity to make this process easier. After this chapter, the first section introduces you to networking, software installation and troubleshooting before the first major project of using Linux as a main departmental file server for Windows PCs. The next section expands upon this knowledge to show you how to create, manage and monitor your own Linux-based Web site on this network using a simple DSL or cable modem Internet connection. Finally, the third section covers more advanced topics that will become invaluable as your Linux administration role expands.
  
不是所有的商业机构或家庭都需要网站,但是建立一个网站的步骤涉及到很多不仅仅有关Linux,而且还有很多信息技术方面的知识。本书是有关建立大多数商业和家庭需要的Linux服务器方面的知识。是有关如何才能完成这些事情。
+
= Our Network =
  
介于这样的思路,本书分为三大部分,循序渐进,深入浅出。本章之后,第一部分为你介绍网络,软件安装和故障与解决;之后是第一个主工程,使用Linux作为一个主文件服务器为Windows电脑提供服务。下一部分将拓展这些知识,教你如何在本地网络通过使用一个普通的DSL或调制解调器连接,来建立、管理和监管你自己的基本Linux的网站。最后,第三部分更深入讨论,并当你进入你的Linux管理员角色时,体会到它的无穷价值。
+
The typical small office or home network is usually quite simple with a router/firewall, connected to a broadband Internet connection, protecting a single network on which all servers and PCs are connected as seen in Figure 1-1.
  
==我们的网络==
+
As stated before, the rest of the book shows you how you can make a simple layout such as this become a functional low volume Web site, but before you do it would be best to weigh the pros and cons of doing this.
  
经典的小型办公室或家庭网络通常只有一个路由/防火墙,通过它连接到宽带网络,以保护整个网络中的所有服务器和电脑的安全,如图1-1所示。
+
== Figure 1-1 : Wireless home network topology ==
 
+
如前所述,本书剩余部分将指导你如何建立一个简单的布局,比如一个轻量而功能强大的网站,但这之前,你最好要权衡一下功能和轻量之间的相对重要性。
+
 
+
===图1-1:无线家庭网络拓扑===
+
  
 
[[Image:Topology.gif]]
 
[[Image:Topology.gif]]
  
==选择内部网页宿主机==
+
= Alternatives To In-House Web Hosting =
 +
 
 +
There are two broad categories of hosting options for small Web sites. There are companies that host multiple Web sites on the same server, and are called virtual hosting providers. There are also those that allow you to use servers completely dedicated to your site, these are called dedicated hosting providers. Dedicated providers might provide you with only a network connection for a server you purchase ands install in their data center, or they might offer a menu of services from monitoring to backups from which to choose.
  
小型网站有两种著名的宿主机可供选择。在一个服务器维护多家公司的多个网站,被称为虚拟宿主机供应商。那些可以只用于你的网站的服务器,被称为专用宿主机供应商。专用供应商可以为你购买的一个服务器只提供一个网络连接,并安装到他们的数据中心,或者他们能从后台监控提供一个可供选择的服务菜单。
+
== Virtual Hosting ==
  
===虚拟宿主机===
+
It is easy to find virtual hosting companies on the Web that offer to host a simple Web site for about $10 per month.
  
在网页上很容易找到提供虚拟宿主机的公司,他们提供一个普通的网站大约每个月$10。
+
The steps are fairly straightforward:
  
步骤很简单:
+
#Sign up for the virtual hosting service. They will provide you with a login name and password, the IP address of your site, and the name of a private directory on a shared Web server in which you'll place your Web pages.
 +
#Register your domain name, such as www.my-site.com, with companies like Register.com, Verisign or RegisterFree.com. You must make sure your new domain name's DNS records point to the DNS server of the virtual hosting company.
 +
#Upload your Web pages to your private virtual hosting directory.
 +
#Start testing your site using your IP address in your Web browser. It takes about 3-4 days for DNS to propagate across the Web, so you'll probably have to wait at least that long before you'll be able to view your site using your domain, www.my-site.com.
  
:1. 签订虚拟宿主机服务器服务合同。他们就会为你提供一个帐号名和密码,你的网站的IP地址,以及共享网页服务器上供你放置网页的私有目录名。
+
The virtual hosting provider will also offer free backups of your site, technical support, a number of e-mail addresses and an easy-to-use Web based GUI to manage your settings. For an additional charge, many will also provide an e-commerce feature which allows you to have a shopping cart and customer loyalty programs.
:2. 使用公司如Register.com, Verisign 或 RegisterFree.com注册你的域名,比如www.my-site.com。你要确定你的新域名的DNS记录指向虚拟宿主机公司的DNS服务器。
+
:3. 上传你的网页到你的私有虚拟宿主机目录。
+
:4. 在你的网页浏览器里用你的IP地址测试你的网页。DNS要花大约3-4天的时间广播网页,因此你要等至少这么多时间直到你能用你的域www.my-site.com查看你的网站。
+
  
虚拟宿主机供应商也会为你的网站提供免费支持,技术支持,一些电子邮件地址和基本GUI的网页简易使用手册来管理你的设置。另外,很多供应商也会提供一个电子商务功能,让你有一个购买车和一份用户义务纲要。
+
The disadvantage of virtual hosting is that, though it is cheap, you often have no control over the operation of the server and have to rely on the staff and operational procedures of the hosting company to get your changes implemented. These may not necessarily be to your liking.
  
虚拟宿主机的缺点是,虽然它很便宜,但你通常没有操作服务器的控制权限,要作一些更改时需要通过宿主机公司来实现。这可能并不是你所希望的。
+
== Dedicated Hosting ==
  
===专用宿主机===
+
In this scenario, you typically have to make contact with a live sales representative who represents an Internet data center. At a minimum, you have to pay for the amount of space your server occupies in the data center, the amount of power it consumes and the amount of Internet bandwidth you expect to use. Additional services such as backups, monitoring, on call engineering time, firewall management and bandwidth graphing information often can be purchased as extra line items on your bill.
  
这种情况下,你通常要联系某个代理网络数据中心的销售办事处。至少,你要支付你服务器所占用的数据中心的空间,它所消耗的电能以及你要使用的网络带宽。额外服务如备份,监管,工程时间待命(on call engineering time),防火墙管理和带宽图形信息通常是在你帐单上额外的需购买的选项。
+
As you can imagine, these services can be fairly expensive. A 3 cm slot in a computer rack for a Web server can easily cost $200 per month for 1 Mbps of bandwidth. The advantage over virtual hosting is that you can customize the server to your needs.
  
你可设想下,这些服务会比较昂贵。在电脑机柜里用于网页服务器的3厘米的空间就需要每1Mbps带宽每月$200。专用宿主机的优点是你可以按你的需求自定义服务器。
+
Despite the relative merits of external hosting, you may also want to consider doing it yourself.
  
尽管那相对是外部的宿主机,你可能还会希望能由你自己来完成。
+
= Factors To Consider Before Hosting Yourself =
  
==你亲自维护管理之前考虑几个因素==
+
Hosting your Web site externally, especially virtual hosting, is the ideal solution for many small Web sites but there are a number of reasons why you may want to move your Web site to your home or small office. The pros and cons of doing this are listed in Table 1-1.
  
由外部维护管理你的网站,特别是虚拟宿主机形式,对一些小型网站而言是一个理想的方案,但你可能会有很多原因希望把你的网站移到你家或小型办公室里。正面和反面的理由列在了表1-1中。
 
  
===表格1-1内部维护管理网页的正面和反面理由===
+
== Table 1-1 The Pros and Cons of Web Hosting In-House ==
  
 
{| border="1" cellpadding="5" cellspacing="0" align="center"  
 
{| border="1" cellpadding="5" cellspacing="0" align="center"  
 
|-
 
|-
! style="background:#008000; color:white"  | 节省
+
! style="background:#008000; color:white"  | Savings
! style="background:#008000; color:white"  | 费用
+
! style="background:#008000; color:white"  | Costs
! style="background:#008000; color:white"  | 风险
+
! style="background:#008000; color:white"  | Risks
 
|-valign="top"
 
|-valign="top"
 
|
 
|
* 每月节省网页宿主费用
+
* Monthly out sourced Web hosting fee
*减少所需服务的费用。
+
*Elimination of the cost of delays to implement desired services.
 
|
 
|
* 新硬件和软件
+
* New hardware and software
* 可能的新应用开发
+
* Possible new application development.
* 培训
+
* Training
* IT员工的部分用于安装和维护网站的时间
+
* The percentage of IT staff's time installing and maintaining the site
* 潜在的风险费用(%故障可能性,每月X的故障费用)
+
* Potential cost of the risks (% likelihood of failure per month X cost of failure)
 
|
 
|
* 故障可能性和预期持续时间
+
* Likelihood of a failure and it's expected duration
* 故障和故障恢复的费用(硬件,软件,数据恢复,时间)
+
* The cost of both the failure and post-failure recovery (hardware, software, data restoration, time)
* 非法程序也会增加你网站的故障率。
+
* Irregular procedures that could increase the vulnerability of your site to failure.
 
|-
 
|-
 
|}
 
|}
  
==是否推荐内部维护管理?==
+
= Is In-House Hosting Preferred? =
  
由你亲自维护管理网站有很多优点和缺点。
+
There are a number of advantages and disadvantages to hosting Web sites that are physically under your own control.
  
优点
+
'''Pros'''
  
*提高控制便利性:若你维护管理内部的或由你控制的远端数据中心服务器,你将可以管理你网站的所有功能。你在作出更改时不需要等待,你可以选择最合适的IT方案,而不用宿主机供应商的方案。你可以安装你需要的软件,而不受ISP的控制。
+
*'''Increased Control and Flexibility:''' You will be able to manage all aspects of your Web site if it is hosted on a server based either in-house or within your control at a remote data center. You won't have to wait before changes are made and you can select the IT solution that best meets your needs, not those of the hosting provider. You can install the software you need, not what the ISP dictates.
  
还可以通过转租空间给在你社区的其它公司而降低你服务器的成本,这样你自己也成为了一个小型的虚拟宿主机供应商。
+
:There is also the possibility of offsetting the cost of your server by subleasing space on it to other companies in your community, so that you can become a small virtual hosting service yourself.
  
*花费:大多数DSL可以用来建立网站连接。建立一个网站仅需要增加一个网络交换机和一个网页服务器的硬件电路。你能以$100的二手价格买到这些设备。若你家已经有DSL,那就不需要额外的网络连接费用。所以这样一个项目只需每月省下$10,少于一年的时间就能支付成本。
+
*'''Cost:''' It is possible to host a Web site on most DSL connections. A Web site can be hosted on this data circuit for only the additional hardware cost of a network switch and a Web server. You should be able to buy this equipment second hand for about $100. If your home already has DSL there would be no additional network connectivity costs. So for a savings of $10 per month the project should pay for itself in less than a year.
  
使用外部网页宿主机供应商的费用将随着你购买额外的系统管理服务而上升。你会基于经济上的考虑,最终决定内部建设网站。
+
:The cost of using an external Web hosting provider will increase as you purchase more systems administration services. You will eventually be able to justify hosting your Web site in-house based on this financial fact.
  
*新技能:一个额外的好处是学到建设网站的新技能。更改只需少许延时。
+
*'''New Skills:''' An additional benefit is learning the new skills required to set up the site. Changes can be made with little delay.
  
*可行性:可能在你国家没有可靠的虚拟宿主机设备,且/或你无法进入国外维护管理你国外的网站。
+
*'''Availability:''' Reliable virtual hosting facilities may not be available in your country and/or you may not have access to the foreign currency to host your site abroad.
  
*语言:ISP通常只使用少数几种语言来提供技术支持。若你不能获得足够的有关宣传,工程,和客户服务支持,那么内部方案可能会比较好。
+
*'''Language:''' ISPs often provide technical support in only a few languages. If you can't get adequate support for billing, engineering, and customer care services, then an in house solution may be better.
  
缺点
+
'''Cons'''
  
*很多服务:你失去了虚拟宿主机公司提供的很多服务的便利性,如备份,安全审查,负载均衡,域名解析(DNS),硬件冗余,数据库服务和技术支持。
+
*'''Lost Services:''' You lose the convenience of many of the services such as backups, security audits, load balancing, DNS, redundant hardware, data base services and technical support offered by the virtual hosting company.
  
*安全:一个重要的因素是考虑你新服务器的安全性。宿主机供应商可以提供软件补丁,以解决你网页服务器上的安全问题,并且甚至可以提供防火墙来保护它。这些服务对于内部应用而言比较困难。把从你宿主机供应商获得的安全性能与你内部的安全性能作比较。若你感觉你的职员能处理这些,那么就迁移服务器。
+
*'''Security:''' One important factor to consider is the security of your new server. Hosting providers may provide software patches to fix security vulnerabilities on your Web servers and may even provide a firewall to protect it. These services may be more difficult to implement in-house. Always weigh the degree of security maintained by your hosting provider against the security you expect to provide in-house. Proceed with the server migration only if you feel your staff can handle the job.
  
*技术能力:你的服务器供应商在建设你的网站方面可能比你会有更多的专业知识。你或许要花额外的培训费用来确保你的IT职员有在内部建站的足够多的知识。
+
*Technical Ability: Your service provider may have more expertise in setting up your site than you do. You may also have to incur additional training costs to ensure that your IT staff has the necessary knowledge to do the job internally.
  
*可行性:在很多情况下,数据中心的网络连接可靠性要比你宽带连接可靠性要求的高很多。
+
*'''Availability''': In many cases the reliability of a data center's Internet connectivity is usually higher than that of your broadband connection.
  
*费用:虽然在数据电路上你可能会省钱,但还有其它费用需要考虑。你应该不会使用廉价的硬件作为你的服务器。商业办公空间通常要比基础数据中心空间要更加昂贵。你可能需要为支持你的服务器购买额外的设备和服务,比如UPS,备份系统,软件管理,维护合同,监管系统和额外的电源供应,所有这些在外部数据中心都有的服务。
+
*'''Cost:''' Though you may be able to save money on a data circuit, there are other costs to consider. You may not have access to cheap real estate in which to host your servers. Commercial office space is often more expensive than basic data center space. You may have to purchase additional equipment and services to support your servers, such as UPSs, backup systems, software patch management, maintenance contracts, monitoring systems and additional power feeds, all of which may be already bundled in with the services of an external data center.
  
==如何从外部供应商那迁走==
+
= How to Migrate from an External Provider =
  
第18章“[http://wiki.ubuntu.org.cn/Quick_HOWTO_:_Ch18_:_Configuring_DNS/zh 配置DNS]”,有关DNS,详细阐述了包括从外部宿主机供应商迁移到你家中或小型办公室里的步骤。你也可以阅读第20章,“[http://wiki.ubuntu.org.cn/Quick_HOWTO_:_Ch20_:_The_Apache_Web_Server/zh Apache网页服务器]”,和21章,“[http://wiki.ubuntu.org.cn/Quick_HOWTO_:_Ch21_:_Configuring_Linux_Mail_Servers/zh 配置Linux邮件服务器]”有关网页配置的内容,以帮助你更全面理解这些步骤。
+
Chapter 18, "[[Quick HOWTO : Ch18 : Configuring DNS|Configuring DNS]]", which covers DNS has a detailed explanation of the steps involved in migrating your Web site from an external hosting provider to your home or small office. You should also read Chapters 20, "[[Quick HOWTO : Ch20 : The Apache Web Server|The Apache Web Server]]", and 21, "[[Quick HOWTO : Ch21 : Configuring Linux Mail Servers|Configuring Linux Mail Servers]]", on Web configuration to help provide a more rounded understanding of the steps involved.
  
==内部服务器思考==
+
= In-House Server Considerations =
  
对于没有大型数据库需要处理和无需“时刻待命”的硬件的小型网站而言,基本的桌面系统就能很好的工作。linuxhomenetworking.com就是本书很好的榜样,它每个月收到100万网页查看请求,并运行在1GHz Intel Celeron处理器上,有1GB内存。对于这个配置,使用二手电脑就够了。
+
For small Web sites without a great deal of database activity and where "hot standby" hardware isn't a great need a basic desktop system will work fine. The linuxhomenetworking.com site, which was the inspiration for this book, receives over half a million page views per month and runs on a 1 GHz Intel Celeron with 1GB of RAM. A secondhand PC is adequate in this case.
  
为特定目的而造的网页服务器,动辄使用多个CPU,冗余电源供电,高速冗余SCSI硬盘阵列,在不影响性能的情况下,可使用专用冗错ECC RAM,多通道PCI总线,专用内建诊断工具和几寸高的线路机壳来代替。它们要物有所值的多,就算你只有网站收入你也会感觉花的心安里得。
+
Purpose-built Web servers, tend to use multiple CPUs, dual redundant power supplies, high-speed redundant SCSI disks that can be replaced while the system is running without affecting performance, special error-correcting ECC RAM, multiple PCI buses, special built in diagnostic tools and slim line cases only a few inches high. They cost significantly more, but you pay for the peace of mind when your only source of income is your Web site.
  
试着为你服务器划分一个专用区域,要干净、凉爽、干燥并有UPS后备电源。在你所有电缆两端贴上标签,并制作一个最新的网络示意图,可用来展示给任何能协助你的人看。
+
Try to have a dedicated area for your server that's clean, cool, and dry, and uses UPS-protected power. Label all your cables at both ends and try to create an updated network diagram that you can show anyone who will provide you assistance.
  
另一个好主意是把你的电缆区分颜色。一些公司为私有IP地址使用一种颜色,连接公网的使用另一种颜色;还可以把直通线使用一种颜色,交叉线使用另一种颜色。
+
Another good idea is to color-code your cables. Some companies use one color for networks using private IP addresses and another for Internet-facing networks, others use one color for straight-through and another for crossover cables.
  
基本家庭的网站使用无线技术会更加方便。你可以把你的小型无线路由器放置到你的DSL/Cable调制解调器旁边,服务器则可放到家中任何地方。在我的小实验室中,在我书架后面有一个服务器,TV后还有一个,床底下有一个,我桌子旁边有两个。若你住在公寓,可能就没有其它选择,因风险是书架上的一本书掉下来,或者撞到某个吸尘器,可能你的网站就会断掉。
+
Wireless technology for a home-based Web site can be extremely convenient. You can place your small wireless router near your DSL/Cable modem and the server anywhere in the house. In my little lab, I have one server behind a bookcase, another behind the TV, one under a bed, and a couple around my desk. When you live in an apartment, there may be no other choice, but the risk is that a book falling behind a bookcase or a bounce from a vacuum cleaner, could take your site off the air.
  
初看起来为你的网站选择一个网络连接没这么容易。有很多数据电路技术如电缆调制解调器、DSL和无线连接,但它们在你的地区可能是不行的或安装时间是不允许的。通常商业上使用高速链路,每兆数据传输费用要更高一些,因为是直连到数据中心空间,相对更加可靠,提供更多带宽和更好的客户支持。有些技术,如T1链接,为两个地方提供专用电路连接到英特网,而这个服务也是每公里距离费用按月结算。
+
Selecting an Internet connection for your Web site may not be as easy as it first seems. There are many data circuit technologies such as cable modem, DSL, and wireless links, but they may not available in your area or the installation times may not be acceptable. High speed links are usually marketed to businesses and their cost per megabyte of data transfer is usually higher as the service may be combined with data center space, be more reliable, offer more bandwidth and provide better customer support. Some technologies, such as T1 links, can optionally provide a dedicated circuit between two locations external to the Internet but the service also has a per kilometer monthly distance charge.
  
DSL和无线服务往往是非对称的,从网络下载数据数率和上传速度是不同的。你应更关注你网站对英特网的上传速度。网页浏览入站请求用不了很多数据带宽,但网页包含出站回应的是要占很多带宽的。网络服务提供商(ISP)为注册用户提供非对称服务,下载数率通常比上传数率要高。他们为那些通常需要高带宽来浏览和服务网页的商业应用保留对称的数据电路。ISP通常会为商业应用提供一个固定范围的网络地址,这也作为服务的一部分;注册客户通常会得到一个动态分配。这点可能会给你的网站准备产生影响,将在后面章节详细讨论。
+
DSL and wireless services are sometimes asymmetrical, in that the downstream data rate from the Internet is different the reverse upstream speed. You should be most concerned about the upstream speed for your Web site to the Internet. Inbound Web browser queries don't use a lot of data bandwidth, but the Web pages that contain the outbound replies do. Internet service providers (ISPs) provide asymmetric services for residential users and the downstream rate is almost always higher than the upstream. They reserve symmetrical data circuits for businesses which usually need high bandwidth to both surf the web and serve Web pages. The ISP will usually provide the business with a fixed range of Internet addresses as part of the service; residential customers usually get a dynamic address allocation. This can have an impact on your Web site preparation and will be discussed in more detail in later chapters.
  
另一个关注点是决定使用哪一种操作系统。流行的一个是Windows,它可能会是你网页或商业应用使用的唯一产品,且是你职员最熟悉的。当软件制造商更多的把他们的应用转到Linux时,这些都变得不那么重要了。LInux是快速增长的Windows的有力竞争者,也是一个总体费用更少的选择,尤其对于稍小的公司。
+
Another source of concern would be deciding on the operating system to use. A popular one is Windows which may be the only product your Web or business application will work with and with which your staff is most familiar. These issues are becoming less important as software vendors are increasingly porting their applications to Linux, an increasingly strong rival to Windows which also has a lower overall total cost of ownership, especially for smaller companies.
  
本书重点关注Fedora Linux,参考一些RedHat Linux,它流行的公社兄弟版本。不同之处是什么?直到9版本,RedHat Linux一直都是免费产品。然后公司决定开发企业和桌面版本,需要捆绑支付服务合同,这样来维护RedHat的商标。在此同时,RedHat决定开发Fedora Linux作为无支持产品,而Fedora Linux通常并不适合于商业应用,因为它需要更加稳定和支持。每6个月,发布Fedora新版本。虽然原始程序是由志愿者开发,但Fedora版本却属于RedHat。一旦Fedora更新稳定,它们就被组合到RedHat Linux发布,RedHat Linux每12-18个月更新一次。RedHat和开发者之间时常保持联系协作,以保持更新同步。
+
This book focuses on Fedora Linux with some references to RedHat Linux, its popular corporate cousin. What's the difference? Until Version 9, RedHat Linux was a free product. The company then decided to create enterprise and desktop versions that had paid service contracts bundled with them and these maintained the RedHat brand. At the same time RedHat decided to create Fedora Linux as a support-free product with an aggressive development cycle, which is generally unsuitable for businesses that often require more stability and support. New versions of Fedora are released every 6 months. Though the original applications may be developed by volunteers, the Fedora versions are maintained by RedHat. Once Fedora updates are proven stable they are incorporated into the RedHat Linux releases which are updated every 12-18 months. Constant communication between RedHat and the developers help to keep the updates synchronized.
  
选择Fedora因为它是免费的。你不需要购买,就可以玩玩Fedora。当你适应它之后,并得到你自己、你的同事和上级的肯定,那可以考虑同等的稳定版本的RedHat。
+
I chose Fedora because it's free. You don't have to get a purchase order to play with Fedora. When you become comfortable with it and have proven the concept to yourself, your peers and management, you can then consider the more stable RedHat equivalent.
  
我选择Fedora Linux还因为它流行,且它是我在家和工作最常用的Linux版本。这或许不适合你,其它Linux发行版本也可以考虑。
+
I also chose Fedora Linux because it's popular and it's the Linux flavor I've worked with most frequently at home and at work. This may not be the one suitable for you, and other Linux distributions should also be considered.
  
==结论==
+
= Conclusion =
  
决定在内部维护你的网站可能很难。不论你选择怎么做,请细心策划。尽量用一种专业的眼光,即使它不是通用的,还要留心你的决定潜在的风险。
+
The decision to manage your Web site in-house can be difficult. Whatever you choose to do, plan carefully. Always get a professional opinion, even if it's informal, and always be aware of the potential risks of the decision you make.
  
若你决定好了,本书将帮助你成功实现这个项目提供众多保障。
+
If you decide to do it, this book will provide a lot of guidance in completing a successful project.

2008年4月15日 (二) 10:59的版本


Introduction

Web sites have proliferated greatly over the years to become a part of everyday life for many people. People use them to create Web logs of their daily lives, provide family members with a place to store their memories or to tell people of their experiences in getting things to work. The following is a typical Web site address:

www.linuxhomenetworking.com

Businesses originally used them primarily as a marketing tool, but later expanded them to become an important part of their operations. Many companies rely almost exclusively on their Web sites to sell their products and provide both customer and supplier support services.

The decision as to whether or not to host your own Web site can be difficult. You have to consider factors of cost and convenience as well as service and support. This chapter briefly addresses the most common issues and outline the simple network architecture for use in a small office or home on which the focus of the rest of the book will be based.

Not all businesses departments and homes require a Web site, but the process of establishing one touches many aspects of not only Linux, but information technology as well. This book is about to setting up Linux servers to do the things that most businesses and homes need. It's about getting the job done.

With this in mind, the book is divided into three sections of gradually increasing complexity to make this process easier. After this chapter, the first section introduces you to networking, software installation and troubleshooting before the first major project of using Linux as a main departmental file server for Windows PCs. The next section expands upon this knowledge to show you how to create, manage and monitor your own Linux-based Web site on this network using a simple DSL or cable modem Internet connection. Finally, the third section covers more advanced topics that will become invaluable as your Linux administration role expands.

Our Network

The typical small office or home network is usually quite simple with a router/firewall, connected to a broadband Internet connection, protecting a single network on which all servers and PCs are connected as seen in Figure 1-1.

As stated before, the rest of the book shows you how you can make a simple layout such as this become a functional low volume Web site, but before you do it would be best to weigh the pros and cons of doing this.

Figure 1-1 : Wireless home network topology

Topology.gif

Alternatives To In-House Web Hosting

There are two broad categories of hosting options for small Web sites. There are companies that host multiple Web sites on the same server, and are called virtual hosting providers. There are also those that allow you to use servers completely dedicated to your site, these are called dedicated hosting providers. Dedicated providers might provide you with only a network connection for a server you purchase ands install in their data center, or they might offer a menu of services from monitoring to backups from which to choose.

Virtual Hosting

It is easy to find virtual hosting companies on the Web that offer to host a simple Web site for about $10 per month.

The steps are fairly straightforward:

  1. Sign up for the virtual hosting service. They will provide you with a login name and password, the IP address of your site, and the name of a private directory on a shared Web server in which you'll place your Web pages.
  2. Register your domain name, such as www.my-site.com, with companies like Register.com, Verisign or RegisterFree.com. You must make sure your new domain name's DNS records point to the DNS server of the virtual hosting company.
  3. Upload your Web pages to your private virtual hosting directory.
  4. Start testing your site using your IP address in your Web browser. It takes about 3-4 days for DNS to propagate across the Web, so you'll probably have to wait at least that long before you'll be able to view your site using your domain, www.my-site.com.

The virtual hosting provider will also offer free backups of your site, technical support, a number of e-mail addresses and an easy-to-use Web based GUI to manage your settings. For an additional charge, many will also provide an e-commerce feature which allows you to have a shopping cart and customer loyalty programs.

The disadvantage of virtual hosting is that, though it is cheap, you often have no control over the operation of the server and have to rely on the staff and operational procedures of the hosting company to get your changes implemented. These may not necessarily be to your liking.

Dedicated Hosting

In this scenario, you typically have to make contact with a live sales representative who represents an Internet data center. At a minimum, you have to pay for the amount of space your server occupies in the data center, the amount of power it consumes and the amount of Internet bandwidth you expect to use. Additional services such as backups, monitoring, on call engineering time, firewall management and bandwidth graphing information often can be purchased as extra line items on your bill.

As you can imagine, these services can be fairly expensive. A 3 cm slot in a computer rack for a Web server can easily cost $200 per month for 1 Mbps of bandwidth. The advantage over virtual hosting is that you can customize the server to your needs.

Despite the relative merits of external hosting, you may also want to consider doing it yourself.

Factors To Consider Before Hosting Yourself

Hosting your Web site externally, especially virtual hosting, is the ideal solution for many small Web sites but there are a number of reasons why you may want to move your Web site to your home or small office. The pros and cons of doing this are listed in Table 1-1.


Table 1-1 The Pros and Cons of Web Hosting In-House

Savings Costs Risks
  • Monthly out sourced Web hosting fee
  • Elimination of the cost of delays to implement desired services.
  • New hardware and software
  • Possible new application development.
  • Training
  • The percentage of IT staff's time installing and maintaining the site
  • Potential cost of the risks (% likelihood of failure per month X cost of failure)
  • Likelihood of a failure and it's expected duration
  • The cost of both the failure and post-failure recovery (hardware, software, data restoration, time)
  • Irregular procedures that could increase the vulnerability of your site to failure.

Is In-House Hosting Preferred?

There are a number of advantages and disadvantages to hosting Web sites that are physically under your own control.

Pros

  • Increased Control and Flexibility: You will be able to manage all aspects of your Web site if it is hosted on a server based either in-house or within your control at a remote data center. You won't have to wait before changes are made and you can select the IT solution that best meets your needs, not those of the hosting provider. You can install the software you need, not what the ISP dictates.
There is also the possibility of offsetting the cost of your server by subleasing space on it to other companies in your community, so that you can become a small virtual hosting service yourself.
  • Cost: It is possible to host a Web site on most DSL connections. A Web site can be hosted on this data circuit for only the additional hardware cost of a network switch and a Web server. You should be able to buy this equipment second hand for about $100. If your home already has DSL there would be no additional network connectivity costs. So for a savings of $10 per month the project should pay for itself in less than a year.
The cost of using an external Web hosting provider will increase as you purchase more systems administration services. You will eventually be able to justify hosting your Web site in-house based on this financial fact.
  • New Skills: An additional benefit is learning the new skills required to set up the site. Changes can be made with little delay.
  • Availability: Reliable virtual hosting facilities may not be available in your country and/or you may not have access to the foreign currency to host your site abroad.
  • Language: ISPs often provide technical support in only a few languages. If you can't get adequate support for billing, engineering, and customer care services, then an in house solution may be better.

Cons

  • Lost Services: You lose the convenience of many of the services such as backups, security audits, load balancing, DNS, redundant hardware, data base services and technical support offered by the virtual hosting company.
  • Security: One important factor to consider is the security of your new server. Hosting providers may provide software patches to fix security vulnerabilities on your Web servers and may even provide a firewall to protect it. These services may be more difficult to implement in-house. Always weigh the degree of security maintained by your hosting provider against the security you expect to provide in-house. Proceed with the server migration only if you feel your staff can handle the job.
  • Technical Ability: Your service provider may have more expertise in setting up your site than you do. You may also have to incur additional training costs to ensure that your IT staff has the necessary knowledge to do the job internally.
  • Availability: In many cases the reliability of a data center's Internet connectivity is usually higher than that of your broadband connection.
  • Cost: Though you may be able to save money on a data circuit, there are other costs to consider. You may not have access to cheap real estate in which to host your servers. Commercial office space is often more expensive than basic data center space. You may have to purchase additional equipment and services to support your servers, such as UPSs, backup systems, software patch management, maintenance contracts, monitoring systems and additional power feeds, all of which may be already bundled in with the services of an external data center.

How to Migrate from an External Provider

Chapter 18, "Configuring DNS", which covers DNS has a detailed explanation of the steps involved in migrating your Web site from an external hosting provider to your home or small office. You should also read Chapters 20, "The Apache Web Server", and 21, "Configuring Linux Mail Servers", on Web configuration to help provide a more rounded understanding of the steps involved.

In-House Server Considerations

For small Web sites without a great deal of database activity and where "hot standby" hardware isn't a great need a basic desktop system will work fine. The linuxhomenetworking.com site, which was the inspiration for this book, receives over half a million page views per month and runs on a 1 GHz Intel Celeron with 1GB of RAM. A secondhand PC is adequate in this case.

Purpose-built Web servers, tend to use multiple CPUs, dual redundant power supplies, high-speed redundant SCSI disks that can be replaced while the system is running without affecting performance, special error-correcting ECC RAM, multiple PCI buses, special built in diagnostic tools and slim line cases only a few inches high. They cost significantly more, but you pay for the peace of mind when your only source of income is your Web site.

Try to have a dedicated area for your server that's clean, cool, and dry, and uses UPS-protected power. Label all your cables at both ends and try to create an updated network diagram that you can show anyone who will provide you assistance.

Another good idea is to color-code your cables. Some companies use one color for networks using private IP addresses and another for Internet-facing networks, others use one color for straight-through and another for crossover cables.

Wireless technology for a home-based Web site can be extremely convenient. You can place your small wireless router near your DSL/Cable modem and the server anywhere in the house. In my little lab, I have one server behind a bookcase, another behind the TV, one under a bed, and a couple around my desk. When you live in an apartment, there may be no other choice, but the risk is that a book falling behind a bookcase or a bounce from a vacuum cleaner, could take your site off the air.

Selecting an Internet connection for your Web site may not be as easy as it first seems. There are many data circuit technologies such as cable modem, DSL, and wireless links, but they may not available in your area or the installation times may not be acceptable. High speed links are usually marketed to businesses and their cost per megabyte of data transfer is usually higher as the service may be combined with data center space, be more reliable, offer more bandwidth and provide better customer support. Some technologies, such as T1 links, can optionally provide a dedicated circuit between two locations external to the Internet but the service also has a per kilometer monthly distance charge.

DSL and wireless services are sometimes asymmetrical, in that the downstream data rate from the Internet is different the reverse upstream speed. You should be most concerned about the upstream speed for your Web site to the Internet. Inbound Web browser queries don't use a lot of data bandwidth, but the Web pages that contain the outbound replies do. Internet service providers (ISPs) provide asymmetric services for residential users and the downstream rate is almost always higher than the upstream. They reserve symmetrical data circuits for businesses which usually need high bandwidth to both surf the web and serve Web pages. The ISP will usually provide the business with a fixed range of Internet addresses as part of the service; residential customers usually get a dynamic address allocation. This can have an impact on your Web site preparation and will be discussed in more detail in later chapters.

Another source of concern would be deciding on the operating system to use. A popular one is Windows which may be the only product your Web or business application will work with and with which your staff is most familiar. These issues are becoming less important as software vendors are increasingly porting their applications to Linux, an increasingly strong rival to Windows which also has a lower overall total cost of ownership, especially for smaller companies.

This book focuses on Fedora Linux with some references to RedHat Linux, its popular corporate cousin. What's the difference? Until Version 9, RedHat Linux was a free product. The company then decided to create enterprise and desktop versions that had paid service contracts bundled with them and these maintained the RedHat brand. At the same time RedHat decided to create Fedora Linux as a support-free product with an aggressive development cycle, which is generally unsuitable for businesses that often require more stability and support. New versions of Fedora are released every 6 months. Though the original applications may be developed by volunteers, the Fedora versions are maintained by RedHat. Once Fedora updates are proven stable they are incorporated into the RedHat Linux releases which are updated every 12-18 months. Constant communication between RedHat and the developers help to keep the updates synchronized.

I chose Fedora because it's free. You don't have to get a purchase order to play with Fedora. When you become comfortable with it and have proven the concept to yourself, your peers and management, you can then consider the more stable RedHat equivalent.

I also chose Fedora Linux because it's popular and it's the Linux flavor I've worked with most frequently at home and at work. This may not be the one suitable for you, and other Linux distributions should also be considered.

Conclusion

The decision to manage your Web site in-house can be difficult. Whatever you choose to do, plan carefully. Always get a professional opinion, even if it's informal, and always be aware of the potential risks of the decision you make.

If you decide to do it, this book will provide a lot of guidance in completing a successful project.