29.20. Viewing and Editing Directives

The Apache Webserver module can be used to view and edit directives manually, instead of the usual method of editing them through the module's forms and pages. Manual editing is only recommended if you are familiar with the configuration file format, as no checking will be done to make sure that you have entered valid directives or parameters. It is often faster, however, to configure the web server in this way, especially if you are an experienced Apache administrator.

On the options page for every virtual server, directory, URL location, filename, and .htaccess file there is an icon labeled Show Directives. When clicked on, it will display all of the directives inside that virtual server or directory, as shown in Figure 29.10. Any directive that the module knows how to edit will be linked to the appropriate form for editing, which will be one of those that can be reached by clicking on another icon on the virtual server or directory's options page. Next to each directive is the name of the file in which it is located and the line number in that file, so that you can use another program like vi or emacs to edit it manually, if you wish.

Figure 29.10. Viewing directives for a directory.


Below the list are two buttons labeled Manually edit directives and Edit Apache directive. The first will take you to the editing form described in the next paragraph. The second will bring you to the form for editing the directive selected from the menu next to it, which will be one of those linked from an icon on the previous page. This can be useful if you know the name of the Apache directive that you want to use but do not know where in Webmin it can be edited.

To directly edit the text of directives in a virtual server or directory, you can click on the Edit Directives icon located next to Show Directives on every options page. This will display a text box containing the exact text that appears in the Apache configuration file for that server or directory, including any comments and indentation. When the Save button is clicked, any changes that you have made will be written back to the file without any verification. To make them active, you will need to click on the Apply Changes link on any of the module's pages.

It is also possible to edit entire an Apache configuration file at once using the Edit Config Files icon on the module's main page. When selected, the complete contents of the primary configuration file (usually httpd.conf) will be displayed in a text box. Above it is a menu for selecting another file to edit and a button labeled Edit Directives in File that will switch to the contents of the chosen file. Your Apache Web server may use several different files that Webmin normally hides from you. Only on this page can you see that all files that the module has detected are being used, either by default (such as httpd.conf, srm.conf, or access.conf) or through Include directives in the default configuration files.

This page is the only place where you can view and manually edit directives that apply to all virtual servers that are normally editable under the Default Server icon in the module. Because these default directives are usually split across multiple files, no Show Directives or Edit Directives icons appear on the options page for the default server.

If you change any of the directives in the text box, click the Save button below it to have the configuration file rewritten. No validation will be done, so be careful with your changes—a mistake with a container directive like <Directory> or </IfModule> may make it impossible for Webmin to parse some or all of the file. As usual, you will need to click on the Apply Changes link back on the module's main page to make the changes active.

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

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