Working with Packaged Software


So far, this book has been about building things from scratch. This lesson, on the other hand, is about applying tools to make building things a bit easier. However, as I've mentioned, using existing tools can be a job unto itself. Before you can start using MediaWiki to manage your content, you have to download it and get it installed on a server and configured properly. The same is true with any software package. Even if you go with a hosted solution, you still have to set things up so that the software enables you to accomplish your goals.

You may also be wondering at this point why you bothered to learn HTML, CSS, JavaScript, and everything else in between if you're going to let an application do your work for you. This is one of the most common misconceptions about this kind of software. Content management systems make some things more convenient, but you'll still apply all of the skills you learned over the course of the book to make your pages look the way you like.

Before discussing specific applications, I'm going to discuss some topics that pertain to nearly all applications of this kindrelational databases and deployment issues.

Relational Databases

In Lesson 20, "Understanding Server-Side Processing," and today, I've brought up the subject of relational databases more than once, but I haven't really explained what they are or how they work. Relational databases are by far the most popular data repository for web applications. There are a number of reasons for that:

  • They can scale from the smallest to the largest of applications. You can start a website on a web hosting account on a server that's shared with 50 other people, and eventually wind up running 50 servers of your own and use a relational database to store your data the entire way.

  • They are very flexible when it comes to the types of data they can store. All relational databases store their data in tabular format. Each record is a row in a table, and the columns describe the properties of each record. In other words, if you have a table to store information about people, every person will have the same properties. The actual structure of your tables can be customized to suit just about any task. You can create a table of links that has names, URLs, and descriptions for each link, or a table of invoices that lists the customer, amount, shipping address, and item ordered for each invoice. The columns in the table can be configured to hold numbers, dates, short strings, large bodies of text, or even binary files.

  • You can create relationships between tables. That's where the "relational" in relational database comes from. You can relate articles to authors, invoices to customers, or even people to other people within the same table. The relational model is very, very powerful.

  • Relational databases use a standard query language called SQL (Structured Query Language). Although some differences exist between database vendors, by and large if you know SQL you can work with just about any relational database.

  • Relational databases are popular. The basic technology behind relational databases hasn't changed very much in the last 20 years, and they are the foundation of many business applications. What has changed is the fact that now several relational databases are freely available, providing powerful features once only associated with the most expensive software targeted at large corporations. Relational databases are so popular and common that using them for data storage for an application is often an easy decision.

Relational databases are usually deployed as a service that is accessible over the network, much like an HTTP server. The difference is that rather than using HTTP to communicate, the database will use its own proprietary protocol. Generally to communicate with a database, you will need some kind of client or library provided by the database vendor. PHP has clients for most popular relational databases built in, so you can just use the functions associated with your database and not install anything extra.

Most hosting providers that allow you to use PHP, CGI scripts, or some other scripting environment also provide access to relational databases. You may have to fill out a special form to have a database set up for you. Once it's set up, your hosting provider will give you the hostname of your database server and a username or password. You can use that information to access the database, or in the case of packaged software, you can use it to configure the software so that it can access the database.

Once a relational database is installed, all the administrative tasksfrom creating specific databases to creating and managing usersare accomplished using SQL. So to configure a database for a particular application, you generally create a new user and database for it to use and then run an installation script that creates all the tables that the application needs and inserts the initial data into the database. Often your hosting provider will take care of creating the user and database, and you will run the installation script that builds the initial database.

The most common relational database offered by web hosting providers is MySQL. It's a free product produced by MySQL AB, a Swedish company. There are many other popular relational databases as well, including Oracle, Microsoft SQL Server, and PostgreSQL (another free database), but for web applications, MySQL is the leader. All the applications I'm going to discuss in particular work with MySQL. If you want to read more about it, the manual is available online at http://dev.mysql.com/doc/.

Deploying Applications

All the applications discussed in this lesson run on a web server. When it comes to hosted applications, you don't need to worry about the web server. That's the job of the application provider. In cases where you are installing your own applications, it's up to you to make sure your web server environment will work with your application. For example, all the applications I'm going to discuss in detail are written in PHP. If you are planning on deploying to a server running Microsoft Internet Information Services without PHP support, you won't be able to get these applications to run. Before you download and attempt to install an application, you should check its requirements to make sure the server on which you plan to deploy the application meets them.

If you lease server space from a web hosting provider, you may need to check with them before installing your software to make sure it's compatible with their environment. For example, in addition to big requirements such as PHP or MySQL, some software packages also require particular libraries or supplemental software packages in order to function properly. You may need to ask in order to find out whether your hosting provider has all the software you need running in their environment. In some cases, a hosting provider will actually install the software you need if you explain what you're trying to do.

There's another issue you might run into depending on what kind of access you have to your server. Generally two levels of access are available when it comes to web providersFTP access and shell access. If you have FTP access, you're allowed to upload your files to the server, but you are not allowed to log into the server and run commands directly. Shell access provides a command-line interface to the server that enables you to edit files directly on the server, move things around, and generally use the server more like it's your own computer. If you don't have shell access to the server, you will have to edit the configuration files for your application locally on your own computer and then upload the files and test them on the server.




Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net