这篇文章将会告诉你如何利用 FTP 工具来发布你的网站。
|前提:||你必须知道 什么是网络服务器？ 以及 how domain names work. 你必须知道如何 set up a basic environment 还有如何 write a simple webpage.|
There is no active learning available yet. Please, consider contributing.
Getting to grips with an FTP client: FireFTP
There are several FTP clients out there. Our demo covers FireFTP, since it's quite easy to set up in Firefox. If you use Firefox, just go to FireFTP's addons page and install FireFTP.
Of course there are lots of other options. See Publishing tools: FTP clients for more information.
Open FireFTP in a new tab. Two ways to do so in Firefox:
- Firefox menu ➤ ➤ FireFTP
- Tools ➤ Web Developer ➤ FireFTP
Now you should see something like this:
For this example, we'll suppose that our hosting provider (the service that will host our HTTP web server) is a fictitious company "Example Hosting Provider" whose URLs look like this:
We have just opened an account and received this info from them:
Congratulations for opening an account at Example Hosting Provider.
Your account is:
Your website will be visible at
To publish to this account, please connect through FTP with the following credentials:
- FTP server:
- To publish on the web, put your files into the
Let's first look at
http://demozilla.examplehostingprovider.net/ — as you can see, so far there is nothing there:
Note: Depending on your hosting provider, most of the time you'll see a page saying something like “This website is hosted by [Hosting Service].”
To connect your FTP client to the distant server, press the "Create an account..." button and fill in the fields with the information furnished by the hosting provider:
Here and there: local and remote view
Let's now connect with this newly-created account:
Let's examine what you're seeing:
- On the left, you see your local files. Navigate into the directory where you store your website (in this case,
- On the right, you see remote files. We are logged into our distant FTP root (in this case,
- You can ignore the bottom zone for now. It's a live log of every interaction between your FTP client and the server.
Uploading to the server
As you remember, our hosting provider told us that our files have to be stored in the
Public/htdocs directory, so navigate there in your right pane:
Now, to upload your files to the server, drag-and-drop them from the left pane to the right pane:
Are they really online?
So far, so good, but double-check by going to
http://demozilla.examplehostingprovider.net/ in your browser:
And voilà! Our website is live!
Other methods to upload files
The FTP protocol is one well-known method for publishing a website, but not the only one. Here are a few other possibilities:
- Web interfaces. An HTML interface acting as front-end for a remote file upload service. Provided by your hosting service.
- GitHub (advanced). Upload through git with a combination of commit/push methods. See our Publishing your website articles from our Getting started with the Web guide.
- Rsync (advanced). A local-to-remote file synchronizing system.
- WebDAV. An extension of the HTTP protocol to allow more advance file management.
Well done, you're almost finished. The last important task is to make sure your web site is working properly.