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.
Before discussing specific applications, I'm going to discuss some topics that pertain to nearly all applications of this kindrelational databases and deployment issues.
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:
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/.
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.