29.4. Editing Pages on Your Web Server

This section explains how to find and edit the files on your system that are displayed when a client connects to your Apache Web server. If you already know how to do this, feel free to skip it and move on to Section 29.5 “Creating a New Virtual Host”.

When Apache is first installed from a package or from source, its initial configuration will typically not have any virtual servers set up. Instead, just the default server will exist, serving pages to any client that connects on port 80. You can view the default pages by running a web browser and going to the URL http://yourhostname/, or http://localhost/ if you are running the browser on the same system on which Webmin resides. The page that appears will probably just be one supplied with Apache or your Linux distribution.

The document root directory out of which Apache serves files will be shown on the module's main page next to the Default Server icon. On Red Hat Linux for example, this directory is /home/httpd/html by default. The files in this directory can be edited by logging in as root or by using Webmin's File Manager module. Any changes that you make will immediately be reflected on the website.

If your system is just going to host a single static website, it may not be necessary to configure any other aspects of Apache. You can just upload or copy HTML, images, and other files to the directory and its subdirectories to create the site that you want. The most important file is index.html, which is served by Apache whenever a browser does not request a specific page. Because most people will go to http://yourserver/ first, the index.html page will be the first one that they see.

To make editing easier, you may want to change the ownership of the document root directory and all its files to a non-root user. You must make sure, however, that they are still readable by the user as whom the Apache server process runs , which is typically named httpd. The easiest way to do this is to make all files and directories world-readable and world-executable.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.75.235