通过FTP上传站点

You have chosen and bought your domain name and associated it via DNS to an account at a web site hosting company, the next stage is to upload your site from the local computer it has been developed on to a remote server.

您已经选择并购买了域名 ,并通过DNS将其关联到了网站托管公司的帐户,下一步是将您的网站从开发它的本地计算机上载到远程服务器。

This is usually done by FTP (File Transfer Protocol), the primary method on the Internet to transfer large files. (This is distinct from HTTP – HyperText Transfer Protocol – which is used to transmit web pages to your browser). “Point-and-click” hosting companies often provide a web application to transfer your files and build your site, but every hosting company will provide an FTP service to upload.

通常,这是通过FTP(文件传输协议)完成的,FTP是Internet上传输大文件的主要方法。 (这不同于用于将网页传输到浏览器的HTTP(超文本传输​​协议)。 “点击”托管公司通常会提供一个Web应用程序来传输您的文件并构建您的网站,但是每个托管公司都会提供FTP服务来进行上传。

Many people believe that they need a program such as in order to do this, but they couldn’t be more wrong; FTP service is built into your operating system, and into many free applications.

许多人认为他们需要诸如的程序才能执行此操作,但他们做错了更多; FTP服务内置在您的操作系统以及许多免费应用程序中。

Your web hosting company will provide you three (and maybe four) pieces of information to upload your site via FTP:

您的网络托管公司将为您提供三(或四)条信息,以通过FTP上传您的网站:

  1. A server address (which may, or may not, reflect the domain name you chose to host with the company).

    服务器地址(可能反映也可能不反映您选择托管给公司的域名)。
  2. A username

    用户名
  3. A password

    密码
  4. Optionally, a folder name. If provided, this will be the location on the server where you must upload the files for your website: common folder names include htdocs, public, and web.

    (可选)文件夹名称。 如果提供的话,这就是服务器上必须上传网站文件的位置:常用文件夹名称包括htdocspublicweb

Windows FTP (Windows FTP)

In Windows, an FTP server is reached in the same way you do almost everything else: via a folder. Simply open up any window on your desktop (note: your desktop, not a browser window or other application) and type the full FTP address into the Folder Path dialog at the top of the window. Remember to include the ftp:// protocol prefix. As an example, the address for my students to upload their class work:

在Windows中,访问FTP服务器的方式与您执行几乎所有其他操作的方式相同:通过文件夹。 只需打开桌面上的任何窗口(请注意:您的桌面,而不是浏览器窗口或其他应用程序),然后在窗口顶部的“文件夹路径”对话框中输入完整的FTP地址。 请记住包括ftp://协议前缀。 例如,我的学生上传其课堂作业的地址:

ftp://webapp.ict.sait.ca

ftp://webapp.ict.sait.ca

(Don’t try to use this at home: it won’t work).

(不要尝试在家中使用它:它将不起作用)。

If the hosting company has specified a folder, include the folder name after a slash (/). For my students, again this is rather complex and unusual, involving multiple levels of folders:

如果托管公司已指定文件夹,请在斜杠( / )后添加文件夹名称。 对于我的学生来说,这又是相当复杂且不寻常的,涉及多个级别的文件夹:

ftp://webapp.ict.sait.ca/classname/userfirstinitallastname

ftp://webapp.ict.sait.ca/classname/userfirstinitallastname

If the path is correct, you’ll see a dialog asking for a username and password. Use the information provided by your host. If it’s correct, you can drag your site files into the new open folder: the files will transfer to the server, just as if you were copying them between devices.

如果路径正确,您将看到一个对话框,要求输入用户名和密码。 使用主机提供的信息。 如果正确,则可以将站点文件拖到新的打开的文件夹中:这些文件将传输到服务器,就像在设备之间复制它们一样。

Mac OS X FTP (Mac OS X FTP)

At a native, operating system level, FTP in Mac OS X is different from Windows, and has some limitations, for security reasons: you can download files from a server via native FTP in OS X, but uploading takes an application (discussed below). For the sake of completion, I’ll mention the native method:

在本机操作系统级别,Mac OS X中的FTP与Windows有所不同,出于安全原因,它具有一些局限性:您可以通过OS X中的本机FTP从服务器下载文件,但是上需要一个应用程序(如下所述) 。 为了完整起见,我将提及本机方法:

In the Mac OS X Finder, press ⌘K to bring up the Connect to Server window, and type in the same FTP address as above. Again, you will be asked for a username and password, and, if correctly entered, a folder window opens. Again, the restriction is that you can take files from this FTP folder, but you cannot add to it. For that, you need an application.

在Mac OS X Finder中,按⌘K弹出“连接到服务器”窗口,然后输入与上面相同的FTP地址。 再次,将要求您输入用户名和密码,如果正确输入,将打开一个文件夹窗口。 同样,限制是您可以该FTP文件夹中获取文件,但不能添加到其中。 为此,您需要一个应用程序。

FTP应用程序和浏览器插件 (FTP Applications and Browser Plugins)

There are many utilities that help you with FTP. Most people use the built-in FTP services of a web development application such as or Coda, while others use separate, specialized FTP programs, such as Transmit.

有许多实用程序可以帮助您使用FTP。 大多数人使用Web开发应用程序的内置FTP服务,例如Coda ,而其他人则使用单独的专用FTP程序,例如Transmit

FTP can also be built into a browser, via extensions: Firefox has FireFTP, for example.

FTP也可以通过扩展内置到浏览器中:例如Firefox具有FireFTP

常见错误: (Common mistakes:)

  • Remember to have a primary page: for 95% of hosting providers, this will be index.html (index.php if you are using ).

    请记住有一个主页:对于95%的托管服务提供商,这将是index.html (如果使用则为index.php )。

  • Do not copy the folder that contains your site files. Doing that will add another level to your site, putting your index page out of reach.

    不要复制包含站点文件的文件夹 。 这样做将为您的网站增加另一个层次,使索引页面无法访问。

Failure to follow either of these will result in your index page not coming up when you type the root URL (www.yourdomain.com) into a browser: instead, you’ll see a text file list.

如果不遵循这两个条件,则当您在浏览器中键入根URL( www.yourdomain.com )时,索引页面将不会显示:相反,您将看到一个文本文件列表。

翻译自: https://thenewcode.com/377/Uploading-A-Site-With-FTP

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值