Hypertext Markup  «Prev  Next»

Lesson 2 File names and directory structures
Objective Describe file naming and directory structures.

File Names and Directory Structures

A Web site is composed of many files. To keep those files organized, you should have a
  1. file-naming convention and
  2. a directory structure
in place before you start writing files. When you plan your file-naming convention, keep in mind that some platforms, such as UNIX, are case sensitive, while others, such as Windows Server are not. Be aware that many Internet service providers and hosting services use UNIX servers.

Prerequisites for Building a Website

Before we begin building a website, you should give some thought to the organization of the files and folders of your web page. I could place all of the necessary files in one folder and our HTML code might still work, as long as our file paths were set up correctly, but this would be hard to manage because of its lack of structure. One can easily create a clean, organized file tree for your website that will make your life easier and improve the experience of your visitors. One can use a graphical user interface for managing files and folders to create a file tree. Your operating system almost certainly comes with one such file manager. If you are on Windows you can use Windows Explorer and Mac OS users can use a program called Finder. The Mac OS X file system stores files within folders, also known as directories. The top, uppermost folder is known as the root directory and folders located within the root directory are known as subdirectories. The process is almost exactly the same regardless of your file browser, so you should not have any problems developing your directory structure.

Intranet file-names and Structure

If you are creating an intranet for your company, the 1) standards of the organization and 2) procedures guide will likely determine the directory structure and file-naming conventions you use. Although it is easily overlooked, the filenames structure you apply to the way you build your website has a significant and direct effect on your SEO performance. Since your filenames structure is part of your URL, it is important to be specific and to use keywords as part of the filename, because using keywords in your filenames structure is just as important as using keywords in the body of your pages and their content.

Creating the theme RPM

To build the RPM, we will work as a standard user, either through your own account or an account that is reserved specifically to build RPMs. (if creating the account, just add the new account with standard privileges as a local or network account). Initially, we will need root privileges, though, to install the required packages for the build environment:
# yum install -y rpm-build rpmdevtools

The previous command will install the tools that we will use to create the RPM. Using YUM, we will need to be able to connect to a repository that holds the software, but we do not need to be concerned with the location. With this in place, we can revert to the account that we will use to package the RPM. When logged in, we must make sure that we are in our home directory where we will create the top-level directories as follows:
$ cd
$ rpmdev-setuptree

This will create a rpmbuild directory with five subdirectories.
These directories become the working directories when building the RPM. To begin, we will create the directory structure that we require below the SOURCES directory:
$ cd ~/rpmbuild/SOURCES
$ mkdir -p plymouth-theme-tup-1/usr/share/Plymouth/themes/tup
The top-level folder that we create is based on the name and version number that will represent the final RPM. The name will be plymouth-theme-tup and the version will be 1. The following directories represent the structure in the target filesystem; we need to target the
directory. With the directory in place, we can now copy the three files that constitute the theme into the newly created directory:
$ cp /usr/share/plymouth/themes/tup/* \

Now we need to create a gzipped archive of the folder structure;
Within the ~/rpmbuild/SOURCES/ directory, we can run the following command to create the archive:
$ tar -czvf plymouth-theme-tup-1.tar.gz plymouth-theme-tup-1/

You need to be concerned about case sensitivity only with file names. HTML tags are always case-insensitive. Note that some platforms do not allow special characters such as spaces. You can get a good idea about how you should organize your files and directory and how they might appear by looking at the following example:

Class Path
Class Path

In the next lesson, you will learn about the various types of editors used to create HTML pages.