Publishing Your Website
What You’ll Learn in This Hour:
. What the six different publishing options are and how they differ . How to set up your site for publishing using FTP
. How to use the Publishing view to publish and update your site . How to change the publishing and HTML optimization settings
The final, and arguably most important, step to create a website is publishing it so that it is available to your intended audience, whether it is on a local network, an intranet, or the World Wide Web.
In practical terms, publishing a website means taking the files you have been work- ing with on your computer and putting them on a server so that others can access them. There are many ways to do this, and which method works best for you depends on where the files go, what software the server runs, and several other con- siderations.
In the publishing phase of the website-building process, Expression Web 4 goes from being a developer and designer tool to a file-management tool. When you publish files to an external host, the application keeps track of which files were published and when they were published. That way, you can easily see whether a file has already been published, or if you have a newer version of the file on your computer that needs to be published in place of an older one.
In this hour, you learn how to use the different publishing methods to manage files on your computer and on the final location and discover how to decide which method works best for you. You also learn how to configure Expression Web 4 to automatically update new versions of your files for you and keep tabs on what you have done in the past.
ptg7913109
A Word on Domains and Web Hosting
In most cases, a website is intended to be published on the Web for everyone to see.
In that case, you need a web server connected to the Web on which to place your files and a web domain that takes the visitors to your site. The most common way to do this is to use a web-hosting service that provides both domain name registration and web hosting.
The All-Important Domain Name
Buying a domain name can be a harrowing and frustrating experience because so many names are already taken, and it is important to get an easily spelled and memorable name that reflects positively on your company or service. In addition, thousands of companies out there prey on designers looking for a specific domain name. If you’re not careful, they might snap up your preferred name right before you buy it and ask for a ridiculous fee (or ransom, if you will) to release it to you. A common mistake people make when looking for a new domain name is to search for it on Google. What they don’t know is that people monitor Google and other search engines for those searches. When they pop up, those people buy the domain names so that you have to pay them to get the names released. If you are looking to see whether a domain name is taken, always use a trusted Whois service, such as www.whois.net, rather than a search engine. Such services not only tell you whether a domain is taken, but if so, also who holds the rights to it and when those rights expire.
After you find a domain name you like, you can buy it from any number of ven- dors. The price of a domain name depends on the extension you want (.com, .ca, .net, .tv). Some domain extensions (.edu, .gov, and so on) are not available to the public. As of this writing, a .com domain should run between $10 and $20 per year.
Pay any more and you are being ripped off!
Did you Know?
Most web hosts offer free or discounted domain names with the purchase of a hosting plan, but you don’t need to register your domain name with your web host unless that is what you want.
After you decide on a domain name, you need to find a place to host your site.
Depending on the size of your site, what primary web technology you want to use (ASP.NET or PHP, for example), and the estimated traffic your site will receive, you have many options to choose from. A small site with limited traffic will do fine with a basic shared-hosting plan, whereas a high-traffic site might need a virtual pri- vate server or even a dedicated server. In most cases, you can start with a small shared-hosting plan and upgrade when it becomes necessary.
ptg7913109 An important thing to consider when buying hosting is what kind of applications
you will run on your site. As you learned in this book, if you plan to run ASP.NET applications, you need a host that supports ASP.NET. Likewise, if you run PHP appli- cations, such as the popular WordPress blogging software, you need a host that sup- ports PHP. Before buying hosting anywhere, always make sure the hosting plan includes all the features you plan to use.
Did you Know?
A bit of research can save you lots of money! There are millions of web hosts, and their services and prices differ greatly. By doing some research and asking around, you can quickly find that the same service can be up to ten times more expensive from one host to another. And the most famous hosts are not always the best ones. I have used five different hosts, and they have been progressively cheaper yet offered better service.
Six Different Publishing Options
Expression Web 4 offers several different publishing options to choose from, all with advantages and drawbacks. Which option you should use depends on where you are publishing the site to, what software the server runs, and your own personal preferences.
To select a publishing option, you need to set up your Publishing properties. This is done from the Site view (see Figure 24.1). At the bottom of the Site view are four options: Folders, Publishing, Reports, and Hyperlinks. To set up your remote website properties, click the link in the middle of the panel with the text Add a Publishing Destination.
ptg7913109 This opens the Connection Settings dialog (see Figure 24.2), which gives you options
of how you want to publish your files. One of the most important features is that you can set up several different publishing options for the same site, so you can publish the same site to different servers or other locations without having to change your settings every time. You can also choose which one to use each time you make a change. For this reason, the first element you need to define for your connection setting is a name. This name is just an identifier, so you can call it what- ever you want, but it is a good idea to give the connection a name that makes sense and is easily understood and identifiable.
FIGURE 24.1 Publishing set- tings can be accessed from the Publishing area under the Site view.
ptg7913109 After you decide on a name, you need to select a connection type. Expression Web 4
offers six different types that all fit different scenarios:
. File Transfer Protocol (FTP)
. Secure Shell File Transfer Protocol (SFTP/SSH)
. File Transfer Protocol over Secure Sockets Layer (FTPS/SSL)
. FrontPage Server Extensions
. Web Distributed Authoring and Versioning (WebDAV)
. File System
These six methods are quite different and serve different purposes. Depending on your server, you might choose from several or be restricted to just one. Knowing the difference between them means you can make the right decision now and not run into trouble in the future.
File Transfer Protocol (FTP)
Of all the methods offered, File Transfer Protocol (FTP) is the most well known and frequently used. FTP is an old file transfer method that dates back to 1971. Because of its age, FTP is a simple protocol that is firmly rooted and supported in networking and the World Wide Web. For this reason, FTP can be considered the standard for file transfer between computers.
FIGURE 24.2 The Connection Settings dialog lets you define the different settings for each of your connections.
ptg7913109 In spite of FTP’s reliability and ubiquitous support, it has some significant draw-
backs; the most important is that the protocol is not secure by default. Without using an added layer of security, it is relatively easy for outsiders to monitor an FTP connection and pick up both usernames and passwords.
Did you Know?
When Expression Web originally appeared, the FTP performance was sporadic at best, and the many bugs associated with this feature became a major hang-up for early adopters. The release of Expression Web 2 saw significant improvements on this front, and the FTP option worked at an acceptable level. Even so, the
Expression Web development team took criticism seriously, and for the release of Expression Web 3, they rewrote the entire publishing portion of the application from the ground up. As a result, the FTP options in versions 3 and 4 of the appli- cation are solid and work properly across the board.
To set up FTP as the publishing method, select FTP from the Connection Type list and insert the destination address in the Location field. With FTP, you also have the Directory option to specify a destination folder that the files will be sent to. That folder must already exist on the server.
Next, set your FTP username and password under Credentials. Your web host sup- plies the FTP username and password, and if you use FTP as your method for trans- ferring files, you should change the password frequently.
In the Settings section, you can set the maximum number of simultaneous connec- tions from 1 to 10. A higher number can speed up the time it takes to push data from your computer to the server, and vice versa, but not all Internet service providers and web hosts allow multiple connections (thus, the term “maximum con- nections”). Figure 24.3 shows the FTP setup for the MyKipple.com site with the user- name blocked out. Note that the FTP is specified in the prefix of the address, so the address starts with ftp:// instead of http://.
ptg7913109 Finally, you have the option to turn on passive FTP if active FTP is not available.
(Active FTP is often blocked by firewalls, but you can normally get through using passive FTP.)
Secure Shell File Transfer Protocol (SFTP/SSH)
In spite of what the name suggests, Secure Shell File Transfer Protocol is not regular FTP run under Secure Shell (SSH), but a file transfer protocol in its own right.
Whereas FTP transfers all of your file content and other data (including your user- name and password) in plain text between your computer and the server, SFTP transfers this information under encryption, making it extremely hard to intercept or exploit. That said, for you, the user, there is no discernable difference between the two. The setup for SFTP is almost identical to that of FTP, with the exception of SFTP not having the option of using Passive FTP.
File Transfer Protocol over Secure Sockets Layer (FTPS/SSL)
FTPS is an FTP protocol that uses a Secure Sockets Layer (SSL) for added security. An oversimplified explanation of the difference between SFTP and FTPS is that SFTP encrypts the data as part of the transfer protocol, whereas FTPS adds a layer of encryption on top of the FTP transfer. Another way to think of the difference is that SFTP encrypts all the data to binary code before it is transferred, whereas FTPS sends the plain text data inside an encrypted connection that can be read only by the clients and servers that share the same authentication key.
FIGURE 24.3 When selecting FTP as the publishing method, you need to insert the address with the FTP in place of the regular HTTP.
ptg7913109 As the name Secure Sockets Layer implies, FTPS employs a second layer of constant
challenging and verification of the authenticity of the transfer between the client and the server. For this reason, FTPS works only with hosts that have a valid SSL certificate and support SSL. And, in many cases, to get this service, you have to pay extra.
Setup of an FTPS connection is identical to the setup of a regular FTP connection, because with the exception of the added secure layer, there is no difference between them.
FrontPage Server Extensions
You were briefly introduced to FrontPage Server Extensions in Hour 20, “Working with Flash and Other Embeddable Content,” when you used them to create an email form. FrontPage Server Extensions is a set of small programs that run on the web server and give you the ability to add functionality (such as the ability to gener- ate and send emails) to websites. More than that, it keeps tabs on your files both locally and on the server to ensure that elements, such as hyperlinks, are updated if a file is moved from one folder to another, and so on. FrontPage Server Extensions follows your web-authoring process to tell you what files have been altered either by yourself or someone else on your team and whether the files on your computer are newer or older than the ones on the server. As the name suggests, FrontPage Server Extensions was introduced with Microsoft’s old web design program, FrontPage, and has become common throughout web servers, especially those running Microsoft Windows Server software. The name FrontPage Server Extensions might be a bit con- fusing because you are actually talking about many different things: the extensions that run at the heart of the server, the extensions that run independently inside your files (such as the email form functions), and the extensions that run in your authoring program keeping tabs on your files and your work.
When you check the FrontPage Server Extensions option in the Remote Web Site Properties dialog, you tell Expression Web 4 that the server you are publishing the site to has FrontPage Server Extensions installed and that you want to use this tech- nology to communicate the files to and from the server. After setup, the application uses HTTP or HTTPS to send and receive file contents. This is the same protocol you use when you surf the Internet (the http:// prefix in front of all web addresses), which means that, even if you are on a computer behind a strong firewall, if you can surf the Internet, you can use FrontPage Server Extensions to publish content.
To set up FrontPage Server Extensions as your upload option, select the option from the list and enter your Remote Web Site location in the address box along with the username and password.
ptg7913109 You can use FrontPage Server Extensions as your publishing method only if your
web server supports this technology. If it does not, you immediately get a warning message saying the current settings will not work, and you are directed back to the Connection Settings dialog where you can make a different choice.
Watch FrontPage Server Extensions Is on the Way Out Out!
Despite its popularity, Microsoft has not supported FrontPage Server Extensions for some time. For this reason, there have not been any security updates to the technology for several years, and many web hosts are now stepping away and dis- continuing their support for these scripts entirely. If you plan to use FrontPage Server Extensions, it is imperative that you contact your web-hosting service to make sure it is supported now and in the future.
Web Distributed Authoring and Versioning (WebDAV)
Web Distributed Authoring and Versioning (WebDAV) is an extension of the HTTP protocol that provides better security in the form of encrypted transmissions (to keep your data secure), file versioning (to prevent files from being overwritten when more than one person is working on them at the same time), and authentication. Unlike FrontPage Server Extensions, which uses add-ons, WebDAV is already built in to your operating system to handle external links to HTTP addresses.
Setting up WebDAV as the publishing method is done the same way as setting up FrontPage Server Extensions: Simply select the WebDAV option and insert the desti- nation address, username, and password. Also, as with FrontPage Server Extensions, WebDAV has to be supported by your web server for it to work. If it is not supported or not turned on for your specific plan, you cannot access the server, and Expression Web 4 generates an error message. Unfortunately, this message causes a lot of con- fusion because the first item on the list of possible reasons why the connection failed is that the server does not have FrontPage Server Extensions installed (see Figure 24.4). This suggestion is misleading because WebDAV and FrontPage Server Extensions are mutually exclusive. In fact, if WebDAV fails, it could mean that FrontPage Server Extensions is installed on the server and is blocking WebDAV. If you get this message, contact your web-hosting provider and ask whether WebDAV is supported, and if so whether FrontPage Server Extensions is interfering with your connection.
ptg7913109
File System
The final option is to host your website in a folder on your local computer or in your local network. That option can also be used to place your files on removable devices, such as data discs, USB (Universal Serial Bus) keys, PDAs (Personal Data Assistants), MP3 players, or any other storage device that can be connected to the computer.
That way, you can bring the website with you without having to lug around your entire computer. The file system option is frequently used when publishing to local networks and corporate intranets where the web server is on the same network as the computer used.
If you publish to a local drive, all you need to do is insert the folder name in the address bar. If you publish to a local network location or a mapped drive, you need to insert the Universal Naming Code (UNC) path for this location. A UNC path looks like this: \\myServer\sites.
Example: Publishing Content Using SFTP
You now have a basic idea of what the six different publishing methods offer and when to use them. After you select a preferred method, the actual publishing process is the same. The method that is most readily available and at the same time secure is SFTP; therefore, in this example, you see how to use SFTP to publish your website to an external web host.
FIGURE 24.4 The error mes- sage generated when WebDAV fails can be misleading because WebDAV and FrontPage Server Extensions are mutually exclusive.