14. Publishing a Site

What Is Publishing?

Even the best site is worthless unless people can see it. You can be the cream of the web designer crop, but if no one can access your site, it doesn’t matter a bit. Therefore, you have two choices when it comes to designing a site with Expression Web 3: You can either design the site live on a web server that hosts your domain, or you can create your site offline and then publish it to a live server.

Developing a site offline and then publishing it to a live server is always the preferred choice. If you develop directly against a live site, any problems you encounter while developing your site (and there will be some) will be visible to everyone who visits your site. You could, of course, put up one of those graphics that you see on many sites that say “Under Construction,” but the way I see it, if a site is under construction, it should be on a development computer, not on a live web server. After all, an artist doesn’t paint a masterpiece while the canvas hangs on a museum wall. A professional web designer will always develop a site offline and then publish it to the Internet or an intranet.

Publishing is simply the process of copying web content from one place to another. It might be content copied from one directory to another on the same machine, one site to another on the same machine, or from one machine to a different machine. You can also publish content to any of the numerous storage devices available today, such as a removable hard drive, a Universal Serial Bus (USB) key, or even a portable music player! If you can copy a file to a device or location, you can publish to it.

Server Options for Publishing

As shown in Figure 14.1, Expression Web 3 offers many options for publishing content:

FTP/SFTP/FTPS

FrontPage Server Extensions (via HTTP or HTTPS)

WebDAV

File System

Figure 14.1 The Connection Settings dialog’s Connection Type drop-down enables you to select your publishing method.

image

One of these methods is sure to be suitable for your purposes. In fact, you’ll likely have a choice between a couple of them, so you’ll need to understand the pros and cons of each option to make an educated decision when the time comes to publish your site.

FTP

FTP has been around a long time and is widely used by many web developers for transferring web content. In fact, the first FTP standard appeared in 1971, long before the advent of the World Wide Web.

Note

image

Check with your hosting company for FTPS or SFTP support. Not all hosting companies offer both, and many hosting companies offer neither.

FTP is generally not secured. That means someone can intercept your username and password. However, Expression Web 3 also supports the use of both FTPS and SFTP so that you can publish securely.

FTP is a reliable method of transferring files between computers. However, there are some things to keep in mind when using FTP. The two types of FTP connections are passive FTP and active FTP. If you experience trouble when using FTP (especially when publishing through a firewall), enabling passive FTP usually will resolve the issue.

To enable passive FTP in Expression Web 3, select either FTP or FTPS in the Connection Type drop-down and check the Use Passive FTP checkbox as shown previously in Figure 14.1.

FrontPage Server Extensions

The FrontPage Server Extensions are a set of files that is installed onto a web server to add functionality to a site. The FrontPage Server Extensions have been around for years. However, since Microsoft discontinued FrontPage, some hosting companies are beginning to stop support for the FrontPage Server Extensions.

Note

image

Microsoft still supports the FrontPage Server Extensions on Windows Server 2003. Microsoft also engaged Ready to Run software to develop a version of the FrontPage Server Extensions for Windows Vista and Windows Server 2008.

The FrontPage Server Extensions use either the HTTP or secure HTTP (HTTPS) protocol to publish site content. These same protocols are used when browsing sites. Because the FrontPage Server Extensions use the same protocols as your web browser, they can easily publish to remote servers even if you are behind a firewall. Almost all firewalls are configured to allow HTTP and HTTPS traffic to freely pass through. The FrontPage Server Extensions take advantage of that fact when publishing content.

Caution

image

Some Expression Web 3 web components rely on the FrontPage Server Extensions to operate. If you are using any of these components, you will need to select the FrontPage Server Extensions option when publishing.

The connection settings shown in Figure 14.2 show the options available when choosing to publish a site using the FrontPage Server Extensions.

Figure 14.2 The Connection Settings dialog with settings for FrontPage Server Extensions shown.

image

After the FrontPage Server Extensions have been installed on the web server, they must be configured for your site by an administrator of the web server. During the configuration process, the FrontPage Server Extensions add folders to your site that begin with _vti. These folders contain configuration information that the FrontPage Server Extensions use to keep track of changes to your site.

The FrontPage Server Extensions offer functionality at both design time and runtime. In addition to offering the capability to connect to remote sites and publish content, they also provide components that generate HTML and client script while you are developing the site, as well as components that provide special functionality when the site is browsed.

Note

image

VTI stands for Vermeer Technologies Incorporated, the company from which Microsoft purchased the first version of FrontPage. Ironically, references to that original company still remain in Microsoft products even after the discontinuation of FrontPage.

To publish with the FrontPage Server Extensions, you will need to have the FrontPage Server Extensions installed on the remote site. You don’t need to install the FrontPage Server Extensions on the local site.

When you publish with FrontPage Server Extensions, you will usually publish to the same address you would use when browsing the remote site in your web browser. For example, if I were publishing a local copy of my site from c:WebSitesJimcoSoftware to my public site using the FrontPage Server Extensions, I would enter a destination address of www.jimcosoftware.com as shown previously in Figure 14.2.

WebDAV

WebDAV is really just an extension of the HTTP protocol and therefore shares many of the same benefits offered by the FrontPage Server Extensions. In fact, the options available in the dialog for publishing a site in Expression Web 3 via WebDAV are identical to those available when publishing using the FrontPage Server Extensions.

There are many benefits to using WebDAV:

• Firewalls generally are not an issue because WebDAV extends HTTP, the protocol used when browsing the Web.

• WebDAV supports strong authentication so you can ensure the security of your data.

• WebDAV supports encryption for another layer of protection for your data.

• WebDAV includes support for file versioning and resource locking so that one user won’t overwrite another user’s work.

WebDAV is already a part of your operating system. In fact, when you create a shortcut to an HTTP location in My Network Places, Windows uses WebDAV to create that link if the FrontPage Server Extensions are not installed on the remote server.

Note

image

Many people in the technical community seriously believe that WebDAV will eventually replace all the publishing protocols in wide use today. In fact, Microsoft has released a WebDAV authoring extension for IIS 7 that works perfectly with Expression Web 3.

To use WebDAV to publish your Expression Web 3 site, your hosting company or system administrator must provide support for WebDAV. I have had great success using WebDAV on IIS 7 and Expression Web 3, but Microsoft’s implementation of WebDAV isn’t complete. Even so, you can open a remote site and publish your site using Microsoft’s implementation of WebDAV and Expression Web 3.

File System

The File System method of publishing is used most often in situations where both the local and remote locations are on the same network. For this method to work, you must have a connection to the remote server that allows for access via a Universal Naming Convention (UNC) path.

Caution

image

Mapped drives are user-specific. If you log in to a computer and map a drive, other users who log in to that computer will not see that mapped drive.

If you map a drive with the intention of allowing other users of the same computer to publish to the mapped drive, keep in mind that you will need to map the drive for each user individually.

A UNC path consists of a server name and a share name using the syntax \servershare. You also can set up a mapped drive so you can refer to a UNC share using a drive letter. UNC paths and mapped drives use the same underlying architecture.

Publishing Content

Now that you have a rundown of all the methods available when publishing a site in Expression Web 3, let’s look at how to publish content to a site.

Configuring a Publishing Destination and Publishing a Site

Before you publish your site, you’ll need to configure one or more publishing destinations. Select Site, Publishing Settings to display the Site Settings dialog, as shown in Figure 14.3.

Figure 14.3 The Publishing tab on the Site Settings dialog lets you easily configure publishing destinations for your site.

image

Click Add to add a new publishing destination using the Connection Settings dialog shown previously in Figure 14.1. After you’ve entered the necessary information for your particular connection type, click Add.

Any publishing destinations you create are specific to the site currently opened in Expression Web 3. Therefore, you can easily create one destination for a test location to show clients or to test your site and another destination for the live site.

After you’ve created a publishing destination, select the Publishing tab to switch to Publishing view as shown in Figure 14.4.

Figure 14.4 The Publishing view enables you to control what files are published and provides control over all aspects of publishing.

image

If you want to publish to the publishing destination selected in the Connect To drop-down (shown in Figure 14.4), click the Connect to the Current Publishing Destination link. Otherwise, select the desired publishing destination and Expression Web 3 will connect automatically.

Once connected, Expression Web 3 will display the currently opened site in the left pane and the destination site in the right pane (see Figure 14.5).

Figure 14.5 The Publishing view shows both the current site and the destination site side-by-side.

image

Expression Web 3 will show blue arrows next to files that are unmatched, as shown in Figure 14.6. An unmatched file might be a file that exists in the current site and not in the destination site, or vice versa. It might also be a file that exists in both sites, but one site has a more recent version than the other.

Figure 14.6 Expression Web 3 displays a blue arrow next to files that are unmatched.

image

To publish unmatched files, click one of the blue arrows in the border between the current site and the destination site. Clicking the arrow that points to the right publishes files to the destination site, the arrow that points to the left publishes to the current site from the destination site, and the arrow that points in both directions synchronizes the current site and the destination site.

Tip

image

The View drop-down makes seeing just the files you are interested in while in Publishing view easy.

While Expression Web 3 publishes your site, it will display the current progress in the Publishing Status pane as shown in Figure 14.7. After publishing, you can use the Failed, Completed, and Log tabs at the bottom of the Publishing Status pane to view the details of publishing.

Figure 14.7 The Publishing Status pane gives you an overview of the publishing process.

image

Optimizing HTML During Publishing

In addition to publishing your files, Expression Web 3 can also optimize your HTML. The main purpose of this feature is to remove code that might not be needed on the remote web server.

You can configure what type of HTML optimization takes place using the HTML Optimization Settings dialog as shown in Figure 14.8. To access the HTML Optimization Settings dialog, click Publishing Settings in the upper-right while in Publishing view and click the Customize button next to the Optimize HTML During Publishing check box shown previously in Figure 14.3.

Figure 14.8 Expression Web 3 can remove any unnecessary code so your pages are as small as possible for better load times, but don’t expect miraculous increases in speed with this feature.

image

Many options available for HTML optimization:

All HTML Comments—Removes all HTML comments in code. HTML comments are designated by the <!- and <//--> characters. The closing comment character might also simply be -->.

Dynamic Web Template Comments—Expression Web 3 adds comments to pages that use Dynamic Web Templates so editable regions can be identified. This option removes those comments.

Layout Tables and Cell Formatting Comments—Expression Web 3 adds comments to layout tables and cells. This option removes those comments.

Script Comments—This option removes comments added to client-side scripts.

All Other HTML Comments—This option removes comments that are not covered in any of the previous categories.

HTML Leading Whitespace—Removes the leading whitespace from your lines of code.

HTML All Whitespace—Removes all HTML whitespace, including whitespace between lines.

Expression Web Tracing Image and Interactive Button Attributes—Removes attributes that are added for the purpose of tracing images and also removes interactive button attributes. These attributes are used only for editing purposes, so they aren’t needed on live files.

Generator and ProgID Tags—Removes the Generator and ProgID Meta tags that are added by Expression Web 3.

Troubleshooting HTTP Publishing

Rule number 1 of publishing is this: If you’re going to have a problem with a hosting company, it’s going to happen when you are publishing your content. Most hosting companies do a great job of ensuring that people can always browse your site, but publishing is more complex and requires a more precise configuration.

Tip

image

Many hosting companies that support the FrontPage Server Extensions for publishing will also blame them for problems while publishing. This is another reason for choosing FTP over the FrontPage Server Extensions if you can. FTP problems are uncommon, but if you do have them, almost all hosting companies are competent in troubleshooting them.

The second rule of publishing is that most hosting companies will deny responsibility when it comes to publishing problems. That means you are going to have to do your own troubleshooting.

To troubleshoot publishing problems, you’ll need to install software that can capture information between your computer and the remote computer. The two tools I use for doing this are Wireshark and Fiddler, both of which are free tools and available for download on the Internet.

Wireshark is a network protocol analyzer (see Figure 14.9). That’s a fancy way of saying it captures all traffic that flows to and from the network card on your computer. It features a great filter so you can zero in on just the traffic you want to see. When dealing with Expression Web 3 publishing issues, you’re going to be interested in HTTP or FTP traffic. Wireshark is available from www.Wireshark.org.

Figure 14.9 Wireshark is a powerful network capture tool that is free and available via download from www.wireshark.org. Here I’ve captured the network traffic while opening a site using the FrontPage Server Extensions.

image

Note

image

We’ll only cover HTTP publishing in this section. However, if you’re using WebDAV or the FrontPage Server Extensions to publish, the information presented here will be helpful in troubleshooting any problems that might occur.

The other tool I use is Fiddler (see Figure 14.10), which is an HTTP debugging proxy. That’s a fancy way of saying it logs all HTTP traffic on your machine. Fiddler has the added benefit of being able to log local traffic that doesn’t travel over your network card. Fiddler is available from www.fiddlertool.com.

Figure 14.10 Fiddler targets HTTP traffic specifically. It’s a great tool to use when troubleshooting publishing using HTTP.

image

Note

image

None of the techniques I discuss in this section will work if you are using SSL (HTTPS) because all traffic that flows over an SSL connection is encrypted. You’d be able to see the traffic, but you wouldn’t be able to decipher it into anything meaningful.

HTTP Authentication Traffic

Most of the problems you’ll encounter during publishing are authentication problems, meaning that the remote server doesn’t accept your username and password. To troubleshoot this type of problem, you need to first understand what happens when things are working correctly.

Tip

image

A 401 status code means access was denied. You can see a full list of HTTP status codes at http://support.microsoft.com/kb/318380/en-us.

To publish a site, you need to be able to write content to the remote site. For the web server to verify that it should allow you to write to the content of the remote site, it needs to authenticate you. It does that by sending a 401 status code in response to your attempt to publish.

The client (in this case, Expression Web 3) responds to the 401 status code in one of two ways, depending on the type of authentication being used. You’ll generally be using one of two authentication methods:

Windows Integrated Authentication—Windows Integrated authentication is authentication that’s built in to Windows itself. If your web server indicates that it can accept Windows Integrated authentication, Expression Web 3 will attempt to authenticate you using the user logged on to your computer. If that fails, you’ll be prompted for a username and password.

Basic Authentication—Basic authentication will always prompt for a username and password.

Windows Integrated authentication uses encrypted data to authenticate you to the remote site. In fact, one of the benefits of Windows Integrated authentication is that it’s a secure authentication mechanism. However, it was not designed to work on the Internet. In many cases, if your host is using Windows Integrated authentication, you’ll be repeatedly prompted for a username and password and publishing will fail.

Tip

image

In most cases, if Windows Integrated authentication fails, the web server automatically tries basic authentication. Chances are you won’t even know if or when this happens.

Basic authentication doesn’t use encrypted credentials. Instead, your username and password are encoded using Base64 encoding before they are sent across the wire. Base64 encoding is a common encoding method used to transmit data across networks. It was actually developed for sending binary data, but it works well for sending text as well.

Note

image

Windows Integrated authentication is naturally Windows-specific. Basic authentication, however, is used in non-Windows web servers, such as Apache.

It’s important to keep in mind that Base64 encoding provides nothing in the way of security. A quick Google search turns up scores of utilities for decoding Base64-encoded data. You shouldn’t think of this as a flaw in the method used by basic authentication. It’s actually the way it was designed to work.

Using Fiddler to Troubleshoot HTTP Publishing Errors

Fiddler is a convenient tool to use for troubleshooting HTTP publishing because it targets only HTTP traffic. To start Fiddler, select it from the Start menu in Windows or use the Fiddler menu item in Internet Explorer, as shown in Figure 14.11.

Figure 14.11 Fiddler installs a button into Internet Explorer so you can always access it quickly when you need it.

image

After you start Fiddler, it will begin capturing HTTP traffic, as shown previously in Figure 14.10. At the right side of the Fiddler interface, you can see different views of the data. By clicking the Session Inspector tab, you can view the local computer traffic in the top half of the display and the remote traffic in the bottom half. A series of buttons appears above both panels, allowing you to change the format of the data that is displayed. When troubleshooting publishing issues, it’s probably most helpful to click the Headers button for both panes, as shown in Figure 14.12.

Figure 14.12 Fiddler can break local and remote traffic into two panes. In this case, you can see that the server is using basic authentication.

image

You can use the information that Fiddler provides to help in troubleshooting publishing issues by analyzing the authentication information. You want to look for the 401 status sent by the remote server and select the line just below it in Fiddler, as shown in Figure 14.13. You should then see your local machine respond with the authorization information.

Figure 14.13 Fiddler clearly shows when you are sending authorization information to the remote server. I’ve intentionally blurred the authentication information here for security purposes.

image

If you see that you are not sending authorization information to the server, you have a problem on your end. However, if you see that you are sending information to the server, you’re either sending the wrong credentials or there’s a problem somewhere other than on your end.

Using Wireshark to Troubleshoot HTTP Publishing Errors

Wireshark is a much more powerful tool than Fiddler because it will capture all network traffic on your computer. However, with that power comes additional complexity. For that reason alone, I usually choose Fiddler over Wireshark for simple troubleshooting, but you might find that Wireshark offers features that are useful to you.

To use Wireshark, select Capture, Interfaces to display a list of network interfaces you can capture. Browse to any site and look for the interface that shows an increasing number of packets (see Figure 14.14). Then click the Capture button.

Figure 14.14 You might want to capture the interface that is connected to the Internet. Look for the interface with an increasing number of packets.

image

Tip

image

Because Wireshark captures all network traffic, it can also be used to troubleshoot FTP publishing. Fiddler captures only HTTP traffic and cannot aid in troubleshooting FTP.

After you’ve started the capture, begin your publishing in Expression Web 3. When you encounter a problem, switch back to Wireshark and select Capture, Stop.

Wireshark captures all traffic on the network, so there’s a good chance it will have captured a significant amount of data that is not related to your work in Expression Web 3. Fortunately, you can filter the captured data easily by simply entering http in the Filter textbox, as shown in Figure 14.15.

Figure 14.15 Filtering in Wireshark is a simple task using the Filter textbox.

image

The data is collected in Wireshark in a similar format to the data collected in Fiddler. Once again, you should look for Expression Web 3’s response to the 401 status code sent by the web server.

Another powerful feature of Wireshark is its capability to display a conversation between Expression Web 3 and the remote web server in a readable format. By right-clicking any of the captured data and selecting Follow TCP Stream from the menu, Wireshark will display the entire conversation (see Figure 14.16). You can even save this information and send it to your host to demonstrate the problem.

Figure 14.16 An enormous benefit to Wireshark is its capability to display captured data as an entire conversation.

image

By using the data captures from Wireshark or Fiddler, you should have all you need to isolate publishing problems and possibly convince a stubborn host that the problem isn’t on your end.

Lagniappe (lan yap’) n., a gift or bonus

Hosting Your Site

One of the most commonly asked questions by web designers is one that might appear to be simple: “What should I consider when choosing a host for my site?” Many options are available for hosting, and most of them are more affordable than you might think.

First, outline your requirements. For example, are you going to need a database? If so, do you need a high-performance system such as Microsoft SQL Server or a lower-level system? Most hosting companies offer support for SQL Server for a nominal monthly fee. However, if you don’t need that kind of power, you can probably save some money by choosing a file-based database such as Microsoft Access. You also might want to investigate using SQL Server Express Edition. This high-performance, file-based system is available free from Microsoft, but keep in mind that some hosting companies do not support the Express Edition of SQL Server.

You’ll also need to try to determine how much traffic you expect. Most hosting companies charge for a specific amount of bandwidth. After you surpass that bandwidth limit, you’ll have to pay a premium for additional bandwidth. This is especially important if you plan to offer large files for download such as video or audio files.

Another important decision to make is whether to choose a hosting company that runs Windows servers. It seems to be all the rage these days to try to convince people to stay away from Windows Server. I encourage you to not fall for those who push their own agenda without any factual information. Make your decision based on the technology you want to use. If you want to use ASP.NET, you’ll need a host that runs Windows Server. If you want to use PHP, you have a choice of a Windows or non-Windows host.

Note

image

As of IIS 7 and the release of FastCGI, running PHP on a Windows server running IIS 7 provides application performance that is comparable to the performance that PHP enjoys on Apache web servers.

If you just want to host a simple site without any fancy features and you do not expect a lot of traffic, you might want to consider hosting the site yourself. If you’re a technology guru, you can get Linux and Apache running on a spare computer lying around the house and get good performance. Setting up Internet Information Services (IIS) on Windows Server is easier, but it will require a more powerful computer.

Caution

image

If you decide to host your own site, check with your Internet provider to make sure that doing so isn’t a breach of their terms of service.

You can use Windows XP Professional, Windows Vista or Windows 7 Home Premium Edition or better to host your own site, but these have a limitation on the number of connections that can be serviced. Keep in mind, too, that a single person browsing a site is going to be opening multiple connections. Chances are you will reach the connection limit at two or three people.

Note

image

Windows Vista and Windows 7 also have a limited number of connections, but they’re designed in such a way as to not generate errors when that limit is reached. Instead, they will allow the user to wait in a queue until a connection is available. Because of this, it’s possible to host a fairly busy personal site on Windows Vista or Windows 7 without any problems.

If you do choose to host your own site, you might want to invest in a router that has Dynamic Domain Name System (DNS) capability. (Most routers these days have this feature.) Dynamic DNS will allow you to configure a static host name (such as mySite.dyndns.org) that will always go to the IP address of your computer. Because most Internet service providers (ISPs) assign dynamic IP addresses, your IP address will change periodically. A router that supports Dynamic DNS can update a Dynamic DNS service (such as www.dyndns.com) with your new IP address whenever it changes.

More information on Dynamic DNS is available at www.dyndns.com/services/dns/dyndns/. The service is free of charge and works great with most routers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.56.12