1.14. Como configurar o apache para utilizar páginas .shtml?

### CL 9 ###

Para trabalhar com páginas com conteúdo em .shtml, você deverá configurar o apache da seguinte maneira:

Como administrador da máquina, (usuário root), digite:

    [root@localhost]# mcedit /etc/apache/conf/httpd.conf


Procure pela entrada no arquivo, chamada AddType text/html .shtml, com a tecla F7.

Descomente as entradas que seguem, como no exemplo abaixo:

    
    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    AddType text/html .shtml -> Descomente esta entrada, tirando o caracter #.
    AddOutputFilter INCLUDES .shtml -> Descomente esta entrada, tirando o caracter #.
   


E na entrada Options, adicione a palavra Includes para que a máquina SSI (Serve-Side Includes) do apache funcione:

    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs-2.0/mod/core.html#options
    # for more information.
    #
        Options Indexes FollowSymLinks Includes -> Adicionando Includes.
   


Também teremos que adicionar na entrada DirectoryIndex, o index para páginas .shtml, da seguinte maneira:

    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    # The index.html.var file (a type-map) is used to deliver content-
    # negotiated documents.  The MultiViews Option can be used for the
    # same purpose, but it is much slower.
    #
    DirectoryIndex index.html index.html.var index.php index.shtml -> Adicionando index.shtml.


Salve o arquivo com a tecla F2 e saia do editor com a tecla F10 .

Após editado o arquivo de configuraçao, pare e ligue novamente o serviço de páginas WEB, com os seguintes comandos:

    [root@localhost]# service httpd stop


    [root@localhost]# service httpd start