image\howbutt.gifCreating a Web site

After you have configured Corel LINUX to be an HTTP server, you can create a Web site. The small sample site created in this section has three Web pages. Each Web page is an HTML file located in a separate directory. The purpose of this section is to guide you through setting up a Web site on an HTTP server.

The first HTML file that the HTTP server sends to the HTTP client is the home page. The home page is located in the directory specified by the DocumentRoot directive. For information about the DocumentRoot directive, see the DocumentRoot directive in "Using the srm configuration file."In the srm.conf file, the DocumentRoot directive is defined as:

DocumentRoot /var/www

The name of the home page is defined in the DirectoryIndex directive, which is located in the srm.conf file. For information about the DirectoryIndex directive, see "Using the srm configuration file." In the srm.conf file, the DirectoryIndex directive is defined as:

DirectoryIndex index.html

Therefore, the directory structure located on the HTTP server must be:

/var/www/index.html

The index.html file is the first HTML file the HTTP server sends to the HTTP client. If you want to embed files in the index.html file, such as graphics files, you must save these files in the same directory as the index.html file. For example, to insert a graphic file called image.jpg into the index.html file, you must save the image.jpg file in the /var/www/ directory.

Plan the Web site

This site has three pages. The home page introduces the site and includes a link to each of the other two pages. The second page is called "The Ocean page." This page contains ASCII text and a graphic file. There are no links in this page. The third page is called "The Islands page." This page contains ASCII text and a graphic file. There are no links in this page. Refer to the following illustration for a structure of the Web site.

image\web.gif

The home page has two links to the other two pages in the Web site. You must specify the two links in the index.html file. One link jumps to the "The Ocean page." The other link jumps to the "The Islands page." Refer to the following HTML code located in the index.html file:

<a HREF="ocean/index.html">The Ocean page</a></td>

<a HREF="islands/index.html">The Islands Page</a></td>

The first link instructs the HTTP server to locate the Ocean directory and pass the HTML file named index.html to the HTTP client. The second link instructs the HTTP server to locate the Islands directory and pass the HTML file named index.html to the HTTP client. All HTML files are named index.html because the DirectoryIndex directive, located in the srm.conf file, is set up this way. The directory structure for this Web site is:

/var/www index.html

/var/www/ocean/index.html

/var/www/islands/index.html

You have to create three HTML files and place them in the directory structure as specified above. Any file that is used in the HTML file can be placed in the same directory. For example, a graphic file embedded in a HTML page can be located in the same directory.

Running the HTTP server

To make your Web site available to HTTP clients, you must start the HTTP server. You can start and stop the HTTP server using the Console. If you want your Web site to be accessible to HTTP clients, you must leave the HTTP server running. If you stop the server, HTTP clients will not be able to connect to the HTTP server. You must restart the HTTP server after you change the value of a directive located in a configuration file. If you do not restart the HTTP server, the changes will not take effect.

image\nicon.gif Note