托管 非托管_托管的完整指南-第2部分

托管 非托管

Last time, in Part 1 of this guide, we looked at assessing a potential host for your site using a checklist. Today, we get into the nitty gritty of the job: what factors should you include on your checklist? What are the aspects on which you want to evaluate each host. You might want to consider these.

上一次, 在本指南的第1部分中 ,我们研究了使用清单对您网站的潜在主机进行评估。 今天,我们进入了工作的重点:您应该在清单上包括哪些因素? 您要评估每个主机的方面是什么? 您可能需要考虑这些。

基本托管功能 (Basic Hosting Features)

If there’s one word in the world of hosting that misleads the naive surfer, it’s "unlimited". To put things into perspective, there is nothing a Web host can offer you that is unlimited. It may be unmetered, or unrestricted (limited only by the specifications of the server), but never unlimited.

如果在托管世界中有一个词误导了幼稚的冲浪者,那就是“无限的”。 放眼来看,Web主机可以为您提供无限的服务。 它可以是未计量的或不受限制的(仅受服务器的规格限制),但绝不能不受限制。

Be wary of hosts that make heavy use of this word: it’s a marketing ploy that many people have fallen for, particularly when they haven’t done much background research. Typically, servers that offer unlimited bandwidth and disk space tend to be over-subscribed and the service they provide can be negatively affected as a result.

警惕大量使用此词的主机:这是许多人不愿使用的营销策略,尤其是当他们没有做大量背景研究时。 通常,提供无限带宽和磁盘空间的服务器往往被超额订购,因此它们所提供的服务可能受到负面影响。

1. Disk Space

1.磁盘空间

All hosting accounts offer a certain amount of disk space that you can use to store your files. Exactly what is and is not counted as disk space usage will vary from host to host, so make sure you check exactly which files you’ll need to allow for when deciding the disk quota you’ll need.

所有托管帐户都提供一定数量的磁盘空间,可用于存储文件。 确切地说,什么是磁盘空间使用情况,哪些不算作磁盘空间使用情况,会因主机而异,因此,在确定所需磁盘配额时,请确保准确检查需要允许哪些文件。

It would be a good idea to have some sort of estimates on the space you’ll need for various tasks. How much space will you need for storing your email, Web files, databases and log files? Breaking down your usage like this will make the task of work out how much space you should go for (once you know exactly what files are counted towards your disk quota) much simpler.

对各种任务所需的空间进行某种估算是一个好主意。 您需要多少空间来存储电子邮件,Web文件,数据库和日志文件? 像这样分解使用量将使工作变得更加简单(一旦您确切知道哪些文件已计入磁盘配额)。

All plans will certainly include all your Web-accessible files when calculating disk usage. Some hosts will also choose to include email and/or logs in the quota, which can make estimating your disk space requirements more difficult. While you may have a good idea of the disk space needed for your web files, your email and log file needs probably change constantly.

在计算磁盘使用率时,所有计划当然都将包括所有可通过Web访问的文件。 一些主机还将选择在配额中包括电子邮件和/或日志,这会使估算磁盘空间需求变得更加困难。 尽管您可能对Web文件所需的磁盘空间有所了解,但电子邮件和日志文件的需求可能会不断变化。

Should a host include all types of file storage in the quota, check to see if you can switch off your logs or exclude particular information. If the option is available it may save you a lot of disk space, particularly if you have a busy site. However, if you want to use a statistics package, you will need to allow space for some logging to take place.

如果主机在配额中包括所有类型的文件存储,请检查是否可以关闭日志或排除特定信息。 如果该选项可用,则可以节省大量磁盘空间,尤其是在站点繁忙的情况下。 但是,如果要使用统计信息包,则需要留出空间进行一些日志记录。

If you enable your logs then it is also worth remembering that you might not be able to delete a log file from the server until the server has stopped writing to it. Daily logs are fairly manageable if you remember to log in and download and delete them regularly. Problems with monthly logs can arise if you underestimate your log space needs, and then find you can’t delete the file until the end of the month. This could easily lead to an extra charge if you aren’t careful.

如果启用了日志,则还应记住,直到服务器停止写入日志文件,您才可能无法从服务器删除日志文件。 如果您记得定期登录并下载和删除日志,则可以轻松管理每日日志。 如果您低估了日志空间需求,然后发现直到月底才能删除该文件,所以每月日志可能会出现问题。 如果您不小心,这很容易导致额外的费用。

If your email settings and inboxes are included in your disk quota, it might be an idea to set a maximum size for each mailbox if possible. This will save you from storing too much mail on the server and inadvertently going over your limit.

如果磁盘配额中包括您的电子邮件设置和收件箱,则可能的话是为每个邮箱设置最大大小。 这样可以避免您在服务器上存储过多的邮件,而无意间超出了限制。

2. Email Accounts

2.电子邮件帐户

Email accounts are a common feature of hosting, particularly if you host a domain. Some hosts will give you control over your mail settings, putting restrictions on mail activities (for example, the number of accounts or maximum size of mail boxes) on the server side. Other hosts will do all the set up for you, even though setting up new mail accounts can be easier than you think with the right software support.

电子邮件帐户是托管的常见功能,尤其是在托管域的情况下。 某些主机可以让您控制邮件设置,从而限制服务器端的邮件活动(例如,帐户数或邮箱的最大大小)。 其他主机将为您完成所有设置,即使使用合适的软件支持,设置新的邮件帐户比您想象的要容易。

How you configure your email is a matter of personal preference, but there are essentially four main types of mail accounts; POP3, forwarding, aliases and autoresponders.

配置电子邮件的方式取决于个人喜好,但是基本上有四种主要的邮件帐户类型: POP3,转发,别名和自动回复。

  • POP3 accounts are the traditional "inboxes". You have storage space on a server for your mail, and you use an email program to log in and download your mail. Each login and password combination usually equates to one account. This works a bit like an office inbox, and the mail is left there until you do something with it. If the inbox is full then your mail can’t be stored, and will bounce.

    POP3帐户是传统的“收件箱”。 您在服务器上有用于邮件的存储空间,并且使用电子邮件程序登录和下载邮件。 每种登录名和密码组合通常等同于一个帐户。 这有点像办公室的收件箱,邮件一直留在那里,直到您对其进行处理为止。 如果收件箱已满,则您的邮件将无法存储,并且会退回。
  • Forwarding mail accounts are useful if, for instance, you want to send your mail to an email filters service like SpamCop before you receive it. Rather than store it on your mail server, it will redirect all mail to another single email address which will deal with it appropriately. This kind of account is useful for redirecting your emails to a common POP3 box.

    例如,如果您想在接收之前将邮件发送到SpamCop之类的电子邮件过滤器服务,则转发邮件帐户很有用。 而不是将其存储在您的邮件服务器上,它会将所有邮件重定向到另一个将适当处理的电子邮件地址。 这种帐户对于将您的电子邮件重定向到一个普通的POP3邮箱很有用。
  • Aliases are names that can be used to identify different types of email account, redirecting them to POP3 mailboxes on the server or other addresses, where they are processed again if necessary. What happens to the emails will depend on who they’re being sent to. A catch-all alias is often used to collect and deal with email sent to people or departments that are not recognised by your mail server.

    别名是可以用来标识不同类型的电子邮件帐户的名称,可以将它们重定向到服务器或其他地址上的POP3邮箱,并在必要时对其进行再次处理。 电子邮件发生什么情况取决于发送给谁。 通用别名通常用于收集和处理发送给邮件服务器无法识别的人员或部门的电子邮件。
  • Autoresponders are not an email account in their own right, however they do have their own email address and simply reply to anyone that emails them for information. They are useful if you want to send out pre-prepared information to people who request it, as opposed to you having to reply to all the requests manually.

    自动回复器本身并不是一个电子邮件帐户,但是它们确实具有自己的电子邮件地址,并且只需回复通过电子邮件向其发送信息的任何人。 如果您要向请求信息的人发送预先准备的信息,而不必手动答复所有请求,则它们很有用。

3. FTP Access

3. FTP访问

One other thing that is common amongst paid hosting accounts is FTP access. FTP programs allow you to upload files and to edit and delete your content on the server much more quickly than using a Web-based interface. If you are hosting on a *nix system, you’ll also be able to change your file permission settings using FTP.

付费托管帐户之间的另一件事是FTP访问。 通过FTP程序,您可以比使用基于Web的界面更快地上载文件以及编辑和删除服务器上的内容。 如果您托管在* nix系统上,则还可以使用FTP更改文件权限设置。

One of the better features I’ve seen offered with hosting is the ability for you to create your own FTP accounts. This is great when you have someone helping out on the site, or if you want to share your Web space while keeping your users’ files separate from your own. How hosts go about this can vary.

我看到托管提供的更好的功能之一是使您能够创建自己的FTP帐户。 当有人在站点上提供帮助时,或者要共享网站空间同时又将用户文件与自己的文件分开时,这非常有用。 主机如何处理可能会有所不同。

Some hosts will let you act like a mini hosting company, where FTP accounts that you create take users to a special folder specifically for their files, which keeps them separate from your main files. Other hosts will allow you to create FTP accounts in which you can define exactly which folders the user has access to, and exactly what they can (and can’t) do with them.

有些主机会让您像微型主机公司一样,在其中创建的FTP帐户会将用户带到专门用于其文件的特殊文件夹,该文件夹将他们与主文件分开。 其他主机将允许您创建FTP帐户,在其中您可以确切定义用户有权访问的文件夹,以及他们可以(不能)使用的文件夹。

While having the ability to create multiple FTP accounts may seem trivial if you don’t intend to host other sites on your Web space, it can be useful for allowing temporary or permanent access to anyone helping you with your site, without you ever needing to give out your own FTP account details. Now that is a feature worth having!

如果您不打算在您的Web空间上托管其他站点,则具有创建多个FTP帐户的功能似乎微不足道,但这对于允许临时或永久访问任何帮助您使用站点的人非常有用,而您无需给出您自己的FTP帐户详细信息。 现在,这是值得拥有的功能!

Unlimited Resources Hosting – seems too good to be true doesn’t it? Well it is!

无限资源托管–似乎太好了,不是吗? 好吧!

Email Management Options – more about the various email accounts you can get with hosting.

电子邮件管理选项 –有关可通过托管获得的各种电子邮件帐户的更多信息。

4. Data Transfer

4.数据传输

Calculating your data transfer needs, the associated bandwidth and the effects it will have on hosting your site can be anything but easy, but it’s one of those calculations that you will need to do if you want to avoid being stung with unexpected costs.

计算数据传输需求,相关的带宽及其对托管站点的影响可能并非易事,但这是您要避免被意外的费用所困扰的计算之一。

There are various problems associated with calculating your data transfer and bandwidth requirements. How do you account for cached pages and images? What size unit does the host use for their calculations, and how can your bandwidth limit affect the quality of your hosting?

与计算数据传输和带宽要求相关的各种问题。 如何计算缓存的页面和图像? 主机用于计算的大小单位如何?带宽限制如何影响主机的质量?

Be Careful! Not all data transfer limits are created equal! Units of measurement can vary between hosts, and if they don’t make it clear, be sure to ask them how many bytes per kilobyte they used when drawing up their comparison tables.

小心! 并非所有数据传输限制都是一样的! 主机之间的度量单位可能会有所不同,如果不清楚,请确保问他们在绘制比较表时每千字节使用多少个字节。

Caching and its Effects on Data Transfer

缓存及其对数据传输的影响

Many ISPs use proxy servers to help speed up Internet access for their customers. The idea is that these servers keep a copy of your page on the proxy server (for a certain amount of time), and update their copy as you change your page. The effect of this is that, while your page may have only been downloaded from your server once, it may have been seen by a number of people.

许多ISP使用代理服务器来帮助为其客户加速Internet访问。 这个想法是,这些服务器在代理服务器上保留页面的副本(一定时间),并在更改页面时更新它们的副本。 这样做的效果是,虽然您的页面可能只从服务器下载一次,但是却可能被很多人看到。

If you have static pages that rarely change, then caching can help reduce your hosting bill. Clever use of meta tags can tell the browser not to bother reloading the page from the server if it is available on the user’s computer or a proxy server. Since these revisited pages do not have to be reloaded from your server, a single page request in your logs could equate to several-hundred page views for that page (particularly if you were paid a visit from a large proxy server used by some of the bigger ISPs).

如果您的静态页面很少更改,那么缓存可以帮助减少托管费用。 如果用户计算机或代理服务器上有可用的元标记,那么巧妙地使用meta标签可以告诉浏览器不要麻烦从服务器重新加载该页面。 由于这些重新访问的页面不必从服务器重新加载,因此日志中的单个页面请求可能等同于该页面的数百次页面浏览(特别是如果您从某个大型代理服务器上访问过,而该服务器由某些较大的ISP)。

Dynamic pages are not so well suited to caching, but if the dynamic elements of pages are not visitor- or time-sensitive, then caching can be used to some degree to keep that data transfer bill down. For example, a page using the date may only need to be built by the server once each day. In the case of building dynamic pages, caching can also be used to reduce the server load by storing results of database queries in the server cache.

动态页面不太适合缓存,但是如果页面的动态元素对访问者或时间不敏感,则可以在某种程度上使用缓存来降低数据传输费用。 例如,使用日期的页面可能只需要每天由服务器构建一次。 在构建动态页面的情况下,通过将数据库查询的结果存储在服务器缓存中,缓存也可以用于减少服务器负载。

5. Bandwidth and the Quality of Hosting

5.带宽和托管质量

When you look for a suitable host, be sure to check out the amount of bandwidth that will be available to your site. Even a site that doesn’t require a great deal of data transfer per month could run slowly if you’re hosted on a shared server; particularly if you are on the same server as a more popular or bandwidth-intensive site.

当您寻找合适的主机时,请确保检查出可用于您的站点的带宽量。 如果您托管在共享服务器上,即使是每月不需要大量数据传输的站点也可能运行缓慢。 特别是如果您与更流行或带宽密集的站点位于同一服务器上。

The more sites hosted on a server, the more likely they are to compete with each other for available resources, including bandwidth. This is why you may notice a reduction in server response times during busy periods, or during a sudden peak in traffic at a busier site on a server that you share.

服务器上托管的站点越多,它们争夺可用资源(包括带宽)的可能性就越大。 这就是为什么您可能会注意到繁忙时段或共享服务器上繁忙站点的流量突然达到峰值期间服务器响应时间减少的原因。

Redundancy Matters

冗余事项

How much bandwidth is left unused to allow for sudden peaks in traffic at any time is known as redundant bandwidth. The more redundant bandwidth a particular server has, the more likely it is to cope well with sudden peaks in traffic, which can make all the difference between a pitiful and a successful advertising campaign.

剩余多少带宽未使用以允许流量在任何时候突然达到峰值,这称为冗余带宽。 一台特定服务器拥有的冗余带宽越多,它越有可能很好地应对流量的突然高峰,这可以使可怜的广告活动与成功的广告活动完全不同。

If your site is consistently slow and busy (particularly at set times during the day), then it could certainly benefit from having more bandwidth. The chances are that your host doesn’t provide enough redundant bandwidth to deal with normal demand — they may need to upgrade their bandwidth capacity, or simply review their bandwidth management strategy.

如果您的站点持续缓慢且繁忙(尤其是在一天中的特定时间),那么肯定可以从拥有更多带宽中受益。 您的主机可能没有提供足够的冗余带宽来满足正常需求,它们可能需要升级其带宽容量,或者只是查看其带宽管理策略。

Ideally, any host you consider should have connections to the backbone, with at least two service providers, and at least 25% redundancy in all its connections. The higher the number of connections, service providers, and percentage of redundancy, the better the system will cope when things get busy.

理想情况下,您考虑的任何主机都应与骨干网建立连接,并至少有两个服务提供商,并且其所有连接中的冗余度至少应为25%。 连接数,服务提供商和冗余百分比越高,当事情变得繁忙时,系统将越好。

Bursting the Bandwidth Barrier

突破带宽障碍

By purchasing a plan that allows for burstable bandwidth, you’ll help prevent your site slowing down during peak traffic periods. Burstable bandwidth means that you can use more bandwidth than your hosting plan would normally allow should you need to, which is extremely handy should the flow of traffic coming and going from your server suddenly peak. Note that the amount of additional bandwidth available will depend on the level of the redundant bandwidth in the backbone connections your site has access to.

通过购买可允许爆发式带宽的计划,您将有助于防止网站在流量高峰期变慢。 突发带宽意味着您可以使用比主机计划通常需要的带宽更多的带宽,如果来自服务器的流量突然达到峰值,这将非常方便。 请注意,可用的额外带宽量将取决于站点可访问的主干连接中的冗余带宽级别。

Hosts that offer burstable bandwidth with your package will let you make use of some (or all) of the redundant bandwidth to help your site cope with the traffic. This should only be used as a short term solution — if you consistently utilize more bandwidth than your hosting package allows, you really ought to upgrade.

随包提供可爆发带宽的主机将使您能够利用部分(或全部)冗余带宽来帮助您的站点应对流量。 这仅应用作短期解决方案-如果您持续使用的带宽超出了主机软件包允许的范围,那么您确实应该进行升级。

Serving Large Files and Multimedia

服务大文件和多媒体

If you hadn’t guessed it already, bandwidth availability can have a significant impact on both the quantity and quality of site downloads, whether they’re large archives or multimedia presentations. As access to the server becomes more difficult to obtain, the number of packets lost increases. For small files, such as Web pages and images, this isn’t such a problem; packet loss is (statistically) less likely to occur on small files. On the other hand, larger files are more likely to lose data during transfer, as there are more opportunities for packets to become lost, and this, in turn, can adversely affect the quality of the download. Files can become corrupted, and streaming media grows more jittery as more data is lost.

如果您还没有猜到,带宽可用性可能对站点下载的数量和质量都产生重大影响,无论它们是大型档案还是多媒体演示。 随着对服务器的访问变得越来越难获得,丢失的数据包数量增加。 对于网页和图像之类的小文件,这不是问题。 在统计上,小文件丢失的可能性较小。 另一方面,较大的文件更有可能在传输过程中丢失数据,因为丢包的机会更多,这反过来可能会对下载质量产生不利影响。 文件可能会损坏,并且随着丢失更多数据,流媒体变得更加不稳定。

If you intend to host downloads or multimedia files on your site, it’s worth shopping around for a host that offers plenty of bandwidth, data transfer, and a good level of redundancy in its connections to the backbone. Having a server that can support resume if it serves large files is useful, as it saves unnecessary data transfer.

如果您打算在您的站点上托管下载或多媒体文件,那么值得一买的主机应具有足够的带宽,数据传输以及与主干网的连接中的冗余度。 拥有一台可以在文件较大时支持恢复的服务器非常有用,因为它可以节省不必要的数据传输。

Your bandwidth and data transfer costs will make up the bulk of your hosting bill. While burstable bandwidth may be a luxury you could afford to do without, it’s always a good idea to get as much bandwidth and redundancy as your budget will allow.

您的带宽和数据传输成本将占您托管费用的大部分。 虽然突发性带宽可能是您无法承受的奢侈,但是获得预算允许的最大带宽和冗余度始终是一个好主意。

Bandwidth and Data Transfer Explained – the name of this page says it all!

带宽和数据传输的解释 -此页面的名称说明了一切!

6. File Support

6.文件支持

You would expect all Web hosts to support the basic file types that are essential to the running of the most basic Website — after all, if a server doesn’t know how to deal with a HTML file and the images associated with it, then just how old is it? However, you cannot upload a file to a server and simply expect it to work first time. Not all servers know what to do with different files, and a server may even confuse some of the more common file types if it’s not set up correctly.

您可能希望所有Web主机都支持运行最基本的网站所必需的基本文件类型-毕竟,如果服务器不知道如何处理HTML文件和与之关联的图像,那么只需几岁了? 但是,您不能将文件上载到服务器,而只是希望它能在第一次工作。 并非所有服务器都知道如何处理不同的文件,并且如果未正确设置,则服务器甚至可能使某些更常见的文件类型混淆。

Problems may become apparent when you want to use any filetype other than your typical HTML, JPEG and GIFs. Even something as simple as a Cascading Style Sheet can cause problems if the extension associated with it (.css) is confused for the lesser common mime type of Corel Slide Show.

当您要使用典型HTML,JPEG和GIF以外的任何文件类型时,问题可能会变得很明显。 如果与它关联的扩展名(.css)与Corel Slide Show的不太常见的mime类型混淆,即使是诸如层叠样式表之类的简单内容也可能引起问题。

File Extensions

文件扩展名

How your server deals with various extensions will depend on the software its running. On Windows systems, extensions are mapped to the application they are intended for. So a file with a .pl extension is opened with the Perl Interpreter, which then outputs the page according to the contents of the file. On a *nix system, the same .pl extension is not important: you’d have to explicitly give the path to Perl in the first line of the script for the server to be able to know what program it should use to run the file.

服务器如何处理各种扩展将取决于其运行的软件。 在Windows系统上,扩展名已映射到其预期的应用程序。 因此,将使用Perl解释器打开扩展名为.pl的文件,然后根据文件的内容输出页面。 在* nix系统上,相同的.pl扩展名并不重要:您必须在脚本的第一行中显式提供Perl的路径,服务器才能知道它应使用哪个程序来运行文件。 。

When a server doesn’t know how to deal with a file, it does one of two things:

当服务器不知道如何处理文件时,它将执行以下两项操作之一:

  • tries to open the file as plain text, or

    尝试以纯文本格式打开文件,或者
  • tries to download it.

    尝试下载它。

These default behaviors are usually undesirable, particularly if you want the file to be sent "as is" so that your browser and its plug-ins can deal with it themselves. It also poses a possible security threat should anyone in the process of downloading a file (for example, one of your scripts) see the paths and (sometimes unencrypted) passwords stored in them.

这些默认行为通常是不希望的,特别是如果您希望按“原样”发送文件,以便浏览器及其插件可以自行处理它。 如果任何人在下载文件的过程中(例如,您的一个脚本)看到路径和存储在其中的密码(有时未加密),也可能构成安全威胁。

It’s a good idea to test how your server deals with various file types before you go uploading anything that contains potentially sensitive content or source code. If the file types you use aren’t supported in the way that you’d like, it could simply be that the file extensions aren’t associated with the correct mime types. Depending on your host and server setup, you may be able to add your own mime types. This would even allow you to create your own file extensions and make people wonder just what sort of scripting language you use!

在上传包含潜在敏感内容或源代码的任何内容之前,最好测试一下服务器如何处理各种文件类型。 如果不以您想要的方式支持您使用的文件类型,则可能仅仅是文件扩展名未与正确的mime类型相关联。 根据主机和服务器的设置,您可能可以添加自己的mime类型。 这甚至可以让您创建自己的文件扩展名,并使人们想知道您使用哪种脚本语言!

Mime Types

哑剧类型

It must be stressed that not all hosts will offer you the opportunity to add your own mime types, so it’s a good idea to make sure that the server supports all the file types you plan to use.

必须强调的是,并非所有主机都会为您提供添加自己的mime类型的机会,因此,确保服务器支持您计划使用的所有文件类型是一个好主意。

If your host is running Apache, then you may be able to edit the Apache handlers and have files behave like something else entirely different. It is certainly possible to make an .html file parse server side includes by editing the handlers in this way.

如果您的主机运行的是Apache,则您可以编辑Apache处理程序并使文件的行为与其他完全不同的事物相同。 通过以这种方式编辑处理程序,肯定可以使.html文件解析服务器端包含。

However, unless you need to parse all your files for includes, it’s probably not worth it, as this will cause all .html files to be parsed before they’re sent to the browser, which will put unnecessary strain on the server.

但是,除非您需要解析所有文件中的包含文件,否则可能不值得,因为这将导致在将所有.html文件发送到浏览器之前先对其进行解析,这会对服务器造成不必要的压力。

7. Scripting Magic

7.脚本魔术

While it is possible to install pretty much any kind of Web technology into any server setup, you will find that some combinations of server and scripting languages work better than others. So let’s look at the more common Web technologies and discuss how they’re affected by various server environments.

尽管可以在任何服务器设置中安装几乎任何种类的Web技术,但您会发现服务器和脚本语言的某些组合比其他语言更有效。 因此,让我们看一下更常见的Web技术,并讨论它们如何受到各种服务器环境的影响。

Perl

Perl

Perl has been around long enough to have wide support across many server platforms, some modules being specific to certain builds of Perl depending on the server operating system. It would certainly be worth taking a look at the operation of specific modules if you intend to make use of them. To minimize the problem of cross platform inconsistencies, consider developing your Perl scripts in the same sort of environment as the live server you will eventually upload them to, particularly if you use system-specific functions or modules.

Perl已有很长的历史,可以在许多服务器平台上提供广泛的支持,某些模块特定于Perl的某些版本,具体取决于服务器操作系统。 如果您打算使用特定的模块,那么一定要看看它们的操作。 为了最大程度地减少跨平台不一致的问题,请考虑在与最终将其上传到的实时服务器相同的环境中开发Perl脚本,尤其是在使用特定于系统的功能或模块的情况下。

Out of all the possible scripting languages available today, Perl is the most frequently supported by hosts that offer scripting capabilities. Unless you utilize system or server specific modules, your use of Perl should not restrict your choice of host.

在当今可用的所有脚本语言中,提供脚本功能的主机最常支持Perl。 除非您使用系统或服务器特定的模块,否则对Perl的使用不应限制您对主机的选择。

Perl is particularly suited to running on an Apache server, and Apache modules such as Mod_Perl have been designed to speed up the execution of Perl scripts. The Windows version of Perl is know as ActivePerl, and while Perl will run happily on a Windows machine there are a few subtle differences with some functionality.

Perl特别适合在Apache服务器上运行,并且诸如Mod_Perl之类的Apache模块旨在加快Perl脚本的执行速度。 Windows版本的Perl被称为ActivePerl,虽然Perl可以在Windows计算机上愉快地运行,但在某些功能上却存在一些细微的差异。

PHP

PHP

PHP comes in two flavors: you can install it as an Apache module (which is great if you have Apache) or you can run it as a stand-alone CGI application. The CGI application is usually slower than the Apache module, so if you want to speed up your PHP scripts it’s usually best to go for PHP installed on an Apache server.

PHP有两种形式:您可以将其安装为Apache模块(如果您具有Apache,则非常好),也可以将其作为独立的CGI应用程序运行。 CGI应用程序通常比Apache模块慢,因此,如果要加快PHP脚本的速度,通常最好选择安装在Apache服务器上PHP。

Note that PHP is not as well supported as Perl across the operating systems, although it is supported by all the major players in hosting. PHP also has functions that are specific to Apache and particular databases. File system functions are likely to cause problems with Windows systems, as many are *nix specific. Fortunately these functions are relatively few, and are noted in the documentation.

请注意,尽管托管的所有主要参与者都对PHP的支持不如Perl在整个操作系统上好。 PHP还具有特定于Apache和特定数据库的功能。 文件系统功能可能会导致Windows系统出现问题,因为许多功能是* nix特有的。 幸运的是,这些功能相对较少,并在文档中进行了说明。

While the usage of PHP is still not as widespread across the Web as Perl, it has increased in recent times. This growth can be attributed to both its open source background and exposure to a wider audience. Being more straightforward to use than Perl, and boasting better support for interaction with remote servers than does ASP, PHP is set to continue its growth in popularity.

尽管PHP的使用仍不如Perl在Web上广泛使用,但最近它在增加。 这种增长可以归因于其开源背景和更广泛的受众群体。 与Perl相比,它更易于使用,并且比ASP具有更好的与远程服务器交互的支持,因此PHP将会继续流行。

At the moment, most PHP hosting facilities are provided on *nix systems that run Apache, so PHP developers are more likely to find a Unix based host that will meet their requirements. Unless you make heavy use of ASP, it would probably be a good idea to go for a *nix system running Apache if you require the use of PHP; after all, the Apache module was specifically designed to speed up the execution of PHP.

目前,大多数PHP托管工具都是在运行Apache的* nix系统上提供的,因此PHP开发人员更有可能找到满足其要求的基于Unix的主机。 除非您大量使用ASP,否则如果需要使用PHP,则最好选择运行Apache的* nix系统。 毕竟,Apache模块是专门为加快PHP执行速度而设计的。

Active Server Pages (ASP)

活动服务器页面(ASP)

ASP is essentially a Microsoft invention, and until the advent of projects such as Chili!Soft ASP, Instant ASP and the Apache ASP module, it was limited to the Microsoft IIS server family. ASP support is fully integrated into IIS servers, so if you know that you’re hosted on IIS (which is typical for Windows machines), then you’ll probably be able to run your ASP scripts.

ASP本质上是Microsoft的发明,在诸如Chili!Soft ASP,Instant ASP和Apache ASP模块之类的项目出现之前,它仅限于Microsoft IIS服务器家族。 ASP支持已完全集成到IIS服务器中,因此,如果您知道托管在IIS(对于Windows计算机而言是典型的)上,则您可能将能够运行ASP脚本。

If a host offers you support for ASP on a *nix machine, they’re likely to use Chili!Soft ASP (I’ve yet to find a host that uses either of the other two solutions). Be aware however that this is not true ASP support; there are several important differences that should be taken into account if you intend to migrate your ASP scripts from one platform to another.

如果主机在* nix机器上为您提供了对ASP的支持,则他们很可能会使用Chili!Soft ASP(我尚未找到使用其他两种解决方案之一的主机)。 但是请注意,这不是真正的ASP支持。 如果您打算将ASP脚本从一个平台迁移到另一个平台,则应考虑几个重要的区别。

ASP 3.0 introduces features (namely the Server.Transfer method) that allow for dynamically including files based on server variables (which is a common request for ASP developers). Unfortunately, ASP 3 is only supported from IIS 5 (which is a feature of Windows 2000 machines), and has not yet been made available to users of earlier products. ASP developers that use Windows 98 or Windows NT machines to test their ASP pages will have to limit their use of the new ASP features if they wish to continue to test "in house".

ASP 3.0引入了一些功能(即Server.Transfer方法),这些功能允许基于服务器变量动态包含文件(这是ASP开发人员的常见要求)。 不幸的是,IIS 3仅支持IIS 5(这是Windows 2000计算机的功能),早期产品的用户尚未使用它。 如果使用Windows 98或Windows NT机器来测试其ASP页的ASP开发人员希望继续“内部”测试,则必须限制对新ASP功能的使用。

FrontPage Extensions

FrontPage扩展

Not a scripting language in its own right, FrontPage Extensions do offer some basic CGI interaction on sites. While they are associated with the Microsoft FrontPage series, they are not limited to Windows servers.

FrontPage Extensions本身并不是脚本语言,但确实在站点上提供了一些基本的CGI交互。 尽管它们与Microsoft FrontPage系列相关联,但它们不仅限于Windows服务器。

FrontPage Extensions are merely an extension of the FrontPage program. The files, when installed on a server, allow the program to interact with the server; it can upload your entire Website without your knowing anything about FTP. Other features of the extensions are that they allow you to add some limited functionality to your site. For example, you can allow your visitors to leave messages on a comments page, or make your entire site searchable without knowing any scripting languages or installing any scripts.

FrontPage扩展仅仅是FrontPage程序的扩展。 安装在服务器上的文件允许程序与服务器进行交互。 它可以在不了解FTP的情况下上传整个网站。 扩展的其他功能是,它们允许您向站点添加一些受限功能。 例如,您可以允许访问者在评论页面上留下消息,或者使整个网站都可搜索,而无需了解任何脚本语言或安装任何脚本。

Having said that, if you require FrontPage support from your host, make sure that you have the right extensions installed for the product you use. Trying to use one of the latest features of the extensions when the extensions are, in fact, older than your program can lead to problems.

话虽如此,如果您需要主机提供FrontPage支持,请确保已为您使用的产品安装了正确的扩展名。 实际上,当扩展程序比程序旧时,尝试使用扩展程序的最新功能之一可能会导致问题。

Language Resources

语言资源

Perl FAQs – frequently asked questions about Perl from the Comprehensive Perl Archive Network. Perl Faqts – another useful resource for those that have questions about Perl. Platform Dependant Perl Modules – make sure you know what they are if you use different servers. PHP.net – keep yourself updated in the latest developments in PHP. PHP Faqts – useful PHP links as well as many PHP related questions and answers. ASP Faqts – ASP resources with a publicly available question and answer area. Chili!Soft – learn more about Chili!Soft ASP for *nix systems. Instant ASP – a Java based solution for getting ASP support on *nix systems.

Perl常见问题解答 –来自Perl综合归档网络的有关Perl的常见问题。 Perl Faqts –对于那些对Perl有疑问的人的另一个有用资源。 平台相关的Perl模块 –如果使用其他服务器,请确保您知道它们是什么。 PHP.net –随时了解PHP的最新动态。 PHP常见问题解答–有用PHP链接以及许多与PHP相关的问题和解答。 ASP常见问题解答–具有公开可用的问答区域的ASP资源。 Chili!Soft –了解有关* nix系统的Chili!Soft ASP的更多信息。 即时ASP –一种基于Java的解决方案,可在* nix系统上获得ASP支持。

8. Databases

8.数据库

Due to the growing desire for interactive Web content, databases are playing an increasingly important role in the creation and storage of dynamic content. Like many other factors associated with Web hosting, the database technology you choose to use will affect your choice of host.

由于对交互式Web内容的需求不断增长,数据库在动态内容的创建和存储中扮演着越来越重要的角色。 像与Web托管相关的许多其他因素一样,您选择使用的数据库技术将影响您对主机的选择。

Not surprisingly, there are both advantages and disadvantages to using particular database software. You should have some idea of what you’ll want to store in your database before you can decide which database solution suits your needs.

毫不奇怪,使用特定的数据库软件既有优点也有缺点。 在决定哪种数据库解决方案适合您的需求之前,您应该对要存储在数据库中的内容有所了解。

Flat-File Databases

平面文件数据库

The simplest databases are flat-file databases, consisting of a single file, or group of files in a format known by those that wish to make use of them. Due to their simple and predictable format, they can be made to work with any scripting technology that’s capable of reading and parsing the file (after some programming). Each line is either one field entry, or is split up by a common delimiter into several field entries.

最简单的数据库是平面文件数据库,由单个文件或一组文件组成,格式为希望使用它们的人所熟知。 由于其简单且可预测的格式,因此可以使其与任何能够读取和解析文件(经过一些编程)的脚本技术一起使用。 每一行要么是一个字段条目,要么由公共定界符分成几个字段条目。

Advantages

优点

Flat-File Databases:

平面文件数据库:

  • Offer full control of the way the data is stored and accessed.

    提供对数据存储和访问方式的完全控制。
  • Are both platform- and scripting language-independent.

    既与平台语言无关,又与脚本语言无关。
  • Can prove fast to implement and use for small straightforward data sets.

    可以证明快速实现并用于小型直接数据集。
  • Their data is human readable when viewed in standard text editors.

    在标准文本编辑器中查看时,其数据是人类可读的。

Disadvantages

缺点

  • They do not scale well, as all data needs to be read to perform a search.

    它们的伸缩性不好,因为需要读取所有数据才能执行搜索。
  • They are not well suited to concurrent data access, which makes them susceptible to corruption.

    它们不太适合并发数据访问,这使其很容易受到损坏。
  • You need to know about a particular flat-file database’s structure before you can use it.

    您需要先了解特定平面文件数据库的结构,然后才能使用它。
  • They are difficult to use as a relational database; more data duplication is likely.

    它们很难用作关系数据库。 可能会有更多的数据重复。
  • No functions are available, so all manipulation has to be done by the language being used.

    没有可用的功能,因此所有操作都必须使用所使用的语言来完成。

MS Access and MS SQL

MS Access和MS SQL

These two Microsoft database offerings are usually confined to use with ASP pages on a Windows server, but can, with the correct Open Database Connectivity support, also run on Unix, Apple Macintosh and OS/2 systems.

这两种Microsoft数据库产品通常只限于与Windows服务器上的ASP页一起使用,但是,只要有正确的Open Database Connectivity支持,它们也可以在Unix,Apple Macintosh和OS / 2系统上运行。

Access is simply a scaled down version of Microsoft SQL, although it does not tend to scale as well in terms of simultaneous connections or function support. If you intended to use a Microsoft solution for a large or busy database then you should go for Microsoft SQL. Microsoft Access is more suitable for small hobby sites or low traffic business sites where it is less likely to suffer heavy usage, which would slow down the speed of a site.

Access只是Microsoft SQL的缩小版本,尽管就同时连接或功能支持而言,访问规模也不太理想。 如果打算对大型或繁忙的数据库使用Microsoft解决方案,则应使用Microsoft SQL。 Microsoft Access更适合小型业余爱好网站或低流量商务站点,因为这些站点不太可能遭受大量使用,这会降低站点的速度。

Advantages

优点

  • Relational databases make data management easier.

    关系数据库使数据管理更加容易。
  • Both have support for an image data type.

    两者都支持图像数据类型。
  • MS SQL allows access across servers hosting the same databases.

    MS SQL允许跨托管相同数据库的服务器进行访问。

Disadvantages

缺点

  • Software licences required to be able to edit and use these databases.

    能够编辑和使用这些数据库所需的软件许可证。
  • Access can bring down entire servers if not used correctly.

    如果使用不正确,Access可能会关闭整个服务器。
  • Difficult to use in non-Windows environments (support for ODBC needed).

    难以在非Windows环境中使用(需要支持ODBC)。

MySQL

MySQL

While current versions of MySQL are optimized for use on *nix platforms in particular, MySQL can be built to work with most modern systems by compiling the source code. Performance of MySQL is greatly affected by performance of the system: the stability of the operating and file systems, and support for multithreading having the largest impact.

尽管当前MySQL版本已经过优化,尤其是可以在* nix平台上使用,但是可以通过编译源代码将MySQL构建为与大多数现代系统兼容。 MySQL的性能在很大程度上受到系统性能的影响:操作系统和文件系统的稳定性以及对多线程的支持影响最大。

Advantages

优点

  • Software is open source, so it’s free to use and widely available.

    该软件是开源的,因此可以免费使用且广泛可用。
  • It’s a well-used database solution, so stability is well tested and documented.

    这是一个很好用的数据库解决方案,因此稳定性得到了很好的测试和记录。
  • Good all-round support for many features despite its low cost to use.

    尽管使用成本低,但对许多功能提供了良好的全面支持。
  • Various sizes of text and binary data types offer better optimisation for database design.

    各种大小的文本和二进制数据类型为数据库设计提供了更好的优化。
  • Relational database makes data management easier.

    关系数据库使数据管理更加容易。

Disadvantages

缺点

  • More difficult to use for those new to databases.

    对于数据库新手来说,使用起来更加困难。
  • Arguably not truly rational using Codd’s rules.

    使用Codd的规则可以说不是真正的理性。

Oracle

Oracle

Oracle can be configured to run on a multitude of platforms and operating systems and has proven to be very scalable and reliable — so there’s little wonder why it’s become so popular.

可以将Oracle配置为在多种平台和操作系统上运行,并且事实证明它具有很高的可扩展性和可靠性-因此,毫无疑问为什么它如此流行。

Advantages

优点

  • Has data types that can write directly to the file system.

    具有可以直接写入文件系统的数据类型。
  • Has the capacity to handle extremely large amounts of data.

    具有处理大量数据的能力。
  • Highly configurable database server.

    高度可配置的数据库服务器。
  • Relational database makes data management easier.

    关系数据库使数据管理更加容易。

Disadvantages

缺点

  • High cost has restricted its use with low-cost Internet applications.

    高成本限制了其在低成本Internet应用程序中的使用。
  • Vast configuration options may require a well-trained database administrator.

    大量的配置选项可能需要训练有素的数据库管理员。

Database Related Books

数据库相关书籍

  • Access Database: Design and Programming

    Access数据库:设计和编程

  • Programming the Perl DBI

    编程Perl DBI

  • SQL in a Nutshell

    简而言之SQL

    9. Multimedia Support

    9.多媒体支持

    If multimedia support is important to your site then you really should spend the time (and money) needed to obtain a level of host service that will meet your needs. To be fair, you cannot expect a great deal of support from a budget-price hosting account. Serving multimedia files to your visitors will require considerable of resources, particularly bandwidth.

    如果多媒体支持对您的站点很重要,那么您确实应该花费时间(和金钱)来获得一定水平的主机服务,以满足您的需求。 公平地说,您不能期望预算价格托管帐户会提供大量支持。 向访问者提供多媒体文件将需要大量资源,尤其是带宽。

    Flash and Shockwave Animation

    Flash和Shockwave动画

    While Flash and Shockwave animations appear to be rather dynamic (in the sense that it’s possible to change the way they work depending on your systems capabilities), they are in fact rather static in nature. They will work on any server that supports the MIME types that are associated with them and don’t require any specialist server software.

    尽管Flash和Shockwave动画看起来很动态(从某种意义上说,可以根据系统功能更改它们的工作方式),但实际上它们实际上是静态的。 它们将在任何支持与其关联的MIME类型的服务器上工作,并且不需要任何专业服务器软件。

    Flash and Shockwave presentations can be described as an interactive image, as the presentations themselves are usually just a single file that can be downloaded to your computer before they’re started. This can prove to be a problem if you don’t want your visitors to be able to store copies of the presentations on their computers, since the full presentation is likely to be downloaded before it can serve its purpose.

    Flash和Shockwave演示文稿可以描述为交互式图像,因为演示文稿本身通常只是一个文件,可以在启动之前下载到计算机中。 如果您不希望访问者能够将演示文稿的副本存储在他们的计算机上,那么这可能会成为一个问题,因为完整的演示文稿可能会在其发挥作用之前被下载。

    Synchronized Multimedia Integration Language (SMIL)

    同步多媒体集成语言(SMIL)

    SMIL is a language that allows greater flexibility in the presentation of audio, video, text, animation and graphics: you can reuse and remix these multimedia elements, reducing the need to create separate clips for each different version of a presentation. SMIL enables users to select viewing options when they’re made available (for example to allow for their slow download speed or choice of language).

    SMIL是一种在音频,视频,文本,动画和图形的显示中提供更大灵活性的语言:您可以重复使用和重新混合这些多媒体元素,从而减少了为每个不同版本的显示创建单独的剪辑的需求。 SMIL使用户可以在可用时选择查看选项(例如,考虑到他们的缓慢下载速度或选择语言)。

    While not yet as versatile as Flash or Shockwave, SMIL can provide an alternative, as it allows the user and site owner a degree of flexibility around, respectively, the use and combination of multimedia elements available to them on the server. In the future, SMIL could provide a means to incorporate timed elements (for example, rotating banners) into sites without the need for a scripting language.

    SMIL虽然还不如Flash或Shockwave通用,但它可以提供另一种选择,因为它允许用户和站点所有者分别灵活地使用和组合服务器上可用的多媒体元素。 将来,SMIL可以提供一种无需脚本语言即可将定时元素(例如,旋转横幅)合并到站点中的方法。

    Streaming Media

    流媒体

    The Internet has altered people’s expectations of shopping and communication: we now expect things to be much faster than they once were. When given the option to activate a large download as soon as there is enough information buffered to do so (and allow the rest of the data to download in the background), few will instead choose to wait for the download to complete before activation.

    互联网已经改变了人们对购物和交流的期望:我们现在期望事情比以前更快。 如果有缓冲的足够信息可以立即激活大型下载的选项(并允许其余数据在后台下载),那么很少有人会选择等待下载完成再激活。

    Streaming media support is essential if you intend to host something like a live Web cast, and if you’re considering such activities, you may need to have a dedicated server set up specifically to deal with the requests and provide the resources needed. Even if you don’t broadcast live events, you may still need specialist commercial streaming software to provide the functionality you require.

    如果您打算托管实时Web Cast之类的内容,并且要考虑进行此类活动,则流媒体支持至关重要。您可能需要专门设置专用服务器来处理请求并提供所需的资源。 即使您不广播实时事件,您可能仍需要专业的商业流媒体软件来提供所需的功能。

    For a server to be able to stream media data, it needs to have at least one of the three recognized protocols installed:

    为了使服务器能够流媒体数据,它需要至少安装以下三种公认的协议之一:

    1. User Datagram Protocol (UDP),

      用户数据报协议(UDP),
    2. RealTime Streaming Protocol (RTSP) or

      实时流协议(RTSP)或
    3. RealTime Protocol (RTP).

      实时协议(RTP)。

    The main difference between these protocols and others such as HTTP or FTP is that they will carry on streaming the data regardless of whether a packet was lost in the transmission: data is not retransmitted if it is lost.

    这些协议与其他协议(例如HTTP或FTP)之间的主要区别是,它们将继续进行数据流传输,而不考虑数据包是否在传输中丢失:如果丢失了数据,则不会重新传输数据。

    The most enjoyable multimedia presentations are those that you can control. RTSP is a two way streaming protocol that allows the visitor to interact with the media by sending messages back to the server to control which part of the presentation to send next. Of course, you can expect to pay considerably more for a server that supports RTSP as opposed to RTP.

    最有趣的多媒体演示是您可以控制的演示。 RTSP是一种双向流协议,它允许访问者通过将消息发送回服务器来控制接下来要发送的演示文稿的哪一部分,从而与媒体进行交互。 当然,您可以期望为支持RTSP而不是RTP的服务器支付更多的费用。

    How much? How Fast?

    多少? 多快?

    However you decide to serve your multimedia files to the world, there is one thing you can be sure of: they will use a lot of bandwidth and data transfer. It’s not uncommon for audio and video clip files to top a megabyte — multiply that by even a modest number and you’ll begin to see the problems associated with offering a few large files on your site, even if they aren’t accessed all that often.

    无论您决定向全世界提供多媒体文件,您都可以确定的一件事:它们将占用大量带宽和数据传输。 音频和视频剪辑文件达到兆字节的情况并不罕见-将其乘以一个适中的数字,您将开始看到与在您的站点上提供一些大文件相关的问题,即使无法访问所有这些文件也是如此经常。

    You should consider your data transfer quota carefully, as frequent requests for large files will see your data transfer totals explode! It’s always a good idea to find out what the additional transfer costs will be, and even the service level provider that will provide the bandwidth. Some people prefer to steer clear of low fees for additional data transfer, believing that you get what you pay for and that the price reflects the quality of service that a host can provide.

    您应该仔细考虑数据传输配额,因为对大文件的频繁请求将使您的数据传输总量激增! 找出额外的传输成本,甚至提供带宽的服务级别提供商,始终是一个好主意。 有些人更愿意避免收取额外数据传输的低费用,他们相信您可以得到所付的价格,并且价格反映了主机可以提供的服务质量。

    If you are going to make use of any kind of streaming media, then the quality of bandwidth can become very important to you. These are the kinds of situations when you really should start to think about a host with a burstable bandwidth plan, as while you may pay that little extra for it each month, you really don’t want to end up broke because of your bandwidth usage!

    如果您要使用任何类型的流媒体,那么带宽的质量对您来说就变得非常重要。 在这种情况下,您确实应该开始考虑具有可爆带宽计划的主机,因为虽然您可能每月为它支付一点额外费用,但您确实不想因带宽使用而最终破产!

  • 翻译自: https://www.sitepoint.com/complete-guide-hosting-2/

    托管 非托管

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值