|< Day Day Up >|
21.2 Pieces of the Puzzle
You may be thinking, "Yeah, that sounds fantastic, but so did that time-share in the Bahamas. What's the catch?"
The catch is that dynamic Web sites are more complex and require more technologies to get off the ground. Simple static Web sites only require the computer you use to build them and a Web server to dish them out. In fact, as you can see by previewing your site in a Web browser, you don't even need a Web server to effectively view a static Web site.
Dynamic Web pages, by contrast, require more (see Figure 21-2). Not only is there a Web server that handles requests for Web pages, there are also two other types of servers: an application server and a database server. And dynamic pages contain more than HTML; they also contain some form of programming code. An application server processes this code and sends a complete HTML page to the Web server, which, in turn, sends that on to the visitor. In many cases, the programming code requires the application server to retrieve information from a database and then merge it with the HTML of a page.
In this context, a server is software that dishes out particular types of information梂eb pages, database queries, or the output of a program. It doesn't necessarily mean a separate computer; you can (and frequently do) have Web, database, and application servers all running happily together on a single machine.
The technology behind a simple Web site is straightforward: When you come to the site, the Web server sends your computer (the client computer) the Web pages, graphics, and other elements of the page. When you come to a dynamic page, on the other hand, the Web server must communicate with an application server, which in turn communicates with a database server. The final results are sent back to you through the Web server.
Because dynamic Web sites require more technology, you can't just open a dynamic page on your own computer, before it's been posted online, as you can a regular Web page. You must view a dynamic page through a Web server that has an appropriate application server running.
It also requires setting up a database and connecting that database to your application server. Although this can be quite complex, it's not difficult to set up a basic Web server, application server, and database on your own computer. It's also easy to connect to other computers that are already configured to run dynamic, databasedriven Web pages.
And once you or your company's system administrator have set up the Web server and other assorted components, Dreamweaver MX 2004 can easily create complex Web pages that access databases and let you build powerful Web applications, all without ever learning any programming.
Even so, there are literally hundreds of combinations of Web, application, and database servers, and Dreamweaver doesn't work with all of them. However, it is capable of working with five of the most popular and powerful combinations, using seven different programming languages!
The term Web application refers to Web pages that work together to complete a task. For example, code that builds pages that let visitors search a database of products, view individual product pages, and add products to a shopping cart would be considered a Web application.
21.2.1 Understanding Server Models
In Dreamweaver MX 2004 lingo, the different application servers and programming languages are called server models. Dreamweaver recognizes several Server Models, including ASP and ASP.NET (pronounced "a-s-p" and "a-s-p dot net"), ColdFusion, PHP, and JSP. Each server model has its own set of unique requirements and its own methods of performing identical tasks.
Which one you use depends on which resources you have available: which type of Web server hosts your site, the operating system it uses, and which application server is available. For example, if you're hosting on Linux or Unix, you'll most likely end up using PHP; if you're hosting on Windows NT or 2000, meanwhile, you've already got access to ASP and possibly ASP.NET. It all comes down to what you have on your computer, what your company uses, or (if you're using a Web hosting service) what the host computer understands. Here's a brief description of each.
ASP (Active Server Pages) is one of the most common ways to start building database- driven Web sites. This Microsoft technology is well established, so you'll find numerous resources to help you along. In addition, if you're working on Windows 98, NT, 2000, or XP Professional, you already have the software you need to get started: Personal Web Server (PWS) on Windows 98 or Internet Information Server (IIS) on Windows NT, 2000, or XP.
Windows XP Home Edition and Windows ME can't run Personal Web Server. Microsoft, of course, recommends upgrading to Windows XP Professional (ka-ching!).
If you don't have either the PWS or IIS software already set up on your computer, here's where to get them:
.NET is the newest Microsoft server technology. It's actually an entire suite of technologies intended to integrate many activities over the Internet.
ASP.NET is more advanced and more powerful than ASP, but also more difficult to learn. Since it's a relative newcomer, you'll find fewer teaching resources available to get started. ASP.NET can be programmed in numerous languages, including Microsoft's VB.NET, C# (pronounced "see sharp"), and JScript.NET, as well as more than 20 other languages. Dreamweaver MX 2004 recognizes both the C# and VB languages.
Like regular ASP, ASP.NET runs in conjunction with Microsoft's IIS Web server. You need to be running Windows 2000 or Windows XP Professional, and have IIS installed. You also need to install the .NET Framework, downloadable from www.asp.net .
Like ASP, ASP.NET works with many different databases.
ColdFusion is a server application from Macromedia (the maker of Dreamweaver). It works in conjunction with several different Web servers, including IIS and Apache, and uses its own programming language, which resembles HTML. For this reason, some Web designers find it easier to learn than other programming languages.
The downside is that this application doesn't come cheap. You can always download a developer's edition梐 free version that runs on your computer梑ut if you want to host the Web site on the Internet, you have to buy the ColdFusion Server package, or find a Web hosting company that offers ColdFusion hosting.
The Developer Edition of ColdFusion comes with the Macromedia Studio MX package and is available for download at www.macromedia.com/software/trial_download/ .
Like ASP and ASP.NET, ColdFusion works with many different databases.
JSP (Java Server Pages) is a server language based on Sun's popular Java programming language. It requires a Java application server, like Macromedia's JRun server.
This approach is not for the faint of heart, however, since setting up a Java Server and connecting it to a database can be tricky. JSP is one of the more difficult languages to learn, too. If you don't have a knowledgeable guide, you're better off starting with a simpler technology like ASP.
A widely used version of JSP is Tomcat, available at java.sun.com/products/jsp/tomcat/ . It's open source (that is, polished by a worldwide population of volunteer programmers), free, and able to work with the Apache Web server and many different databases.
PHP (PHP Hypertext Preprocessor) is a programming language that was created specifically for building dynamic Web pages. It works in conjunction with a variety of Web servers including IIS, but was initially created for the Apache Web server. Like Apache itself, it's available as a free download for Windows, Mac OS X, or any flavor of Unix or Linux. Download it from www.php.net.
While PHP can work with a variety of different database servers, Dreamweaver MX 2004 only understands MySQL梐nother free product available at www.mysql.com .
21.2.2 Picking a Server Model
With so many choices, you're probably wondering which server model to choose. If you've never built a dynamic Web site before, are on Windows, and want to be operational as quickly as possible, your best bet is to start with ASP using a Microsoft Access database. You can create a database using Access (a relatively inexpensive program) and take advantage of either Personal Web Server (PWS) or IIS to run ASP pages.
In fact, since this is the easiest method, this book's tutorials will concentrate on building ASP pages. Once you get the hang of Dreamweaver MX 2004's dynamic Web-building tools, you can always try any of the other server models to build your sites. (However, switching a single site from one server model to another is difficult and not recommended.)
However, when you're building a real-world Web site, this decision may be out of your hands. You may be working for a company that's already using ColdFusion for its Web site. Or, if you've already got a Web site up and running but want to add some database-driven content, you'll have to use what's installed on that server. For instance, if your site is currently hosted at a Web hosting company, you should contact them to find out which operating system, Web server, and databases it uses. If they're Windows-based, odds are that they use IIS, meaning that you can use ASP and either Access or SQL Server databases. On the other hand, if they're a Unix operation, you'll most likely find the Apache Web server, PHP, and MySQL database.
Fortunately, the tools Dreamweaver MX 2004 provides for the different server models are largely the same. Once you learn Dreamweaver, you'll be able to build pages for any of the seven server models it works with.
|< Day Day Up >|