free blog |
THE INS AND OUTS OF DIY BLOGGING |
The following sections examine these two configurations more closely. Altering the config file Most blog programs contain a component file known as the configuration, or config, file. In many cases, the original config file that gets unpacked after downloading also contains the word sample or original in its name, to distinguish it from the altered config file that you will create. The original config file serves as a reference original that you can always go back to.
The file extension is sabotaged in this manner to prevent you from accidentally attempting to use the original config file as the working config file. You must alter the file and rename it with an unencumbered file extension;more on that later. It doesn’t matter whether you upload the original config file, but you must upload a correctly altered and renamed file. In WordPress, the original configuration file is called wp-config-sample.php. The file extension in this case (.php) is not sabotaged, but the word sample alerts you that this is the original file and you should rename it after you alter it.
Configuration files are text files readable in any text editor (such as Notepad in Windows computers), despite the use of non-.txt file extensions. For the remainder of this chapter and in later chapters, I assume that Notepad is the chosen program; it is what I use. Heaven forbid anyone do things differently from me. You edit the original config files the same way you’d edit any other piece of text. Save and rename the file using the Save As selection on the File menu. When saving and renaming the original config file, do not change the default location presented to you by Notepad! I put an exclamation point there to emphasize how important this is! There’s another one! I can’t stop! If you change the location, saving the file outside the root directory from which you opened it, it won’t be included in the big server upload that you do later and you’ll never find the darn thing again. You will gnash your teeth, rend your garments, and scare the kids. Just rename the file by getting rid of the sample or original portion of the filename, and save it.
So, what gets plugged into the config file? Each program has its own requirements. Some original config files contain multiple settings, at least one of which must be altered and some of which are optional. The role of the config file is to provide basic operational settings to the blog program. In a typical installation, two of those settings are crucial: Program path: This is the server address that locates the main blog program file. This setting is sometimes called the cgi path because it is often located in a server folder dedicated to holding CGI scripts. Not every blog program requires this setting in the config file; WordPress, for example, does not. WordPress uses a simpler server folder structure than Movable Type and some other programs, so it doesn’t need this particular direction. Database configuration: This setting is required in the config file by Movable Type, WordPress, and most other blog programs. Your database (MySQL in most cases) is located on your server and is protected by a username and password. Additionally, the database has a name and an address path. You must plug all this information into the config file so the blog program can get its hands on the database, which contains all your entries and archives.