|
324.
|
|
|
The <emphasis>DirectoryIndex</emphasis> is the default page served by the server when a user requests an index of a directory by specifying a forward slash (/) at the end of the directory name.
|
|
|
|
O <emphasis>DirectoryIndex</emphasis> é a página padrão servida pelo servidor quando o usuário requisita um índice de um diretório especificando uma barra (/) no final do nome do diretório.
|
|
Translated and reviewed by
Marcelo R. Minholi
|
|
|
|
Located in
serverguide/C/web-servers.xml:304(para)
|
|
325.
|
|
|
For example, when a user requests the page http://www.example.com/this_directory/, he or she will get either the DirectoryIndex page if it exists, a server-generated directory list if it does not and the Indexes option is specified, or a Permission Denied page if neither is true. The server will try to find one of the files listed in the DirectoryIndex directive and will return the first one it finds. If it does not find any of these files and if <emphasis>Options Indexes</emphasis> is set for that directory, the server will generate and return a list, in HTML format, of the subdirectories and files in the directory. The default value, found in <filename>/etc/apache2/mods-available/dir.conf</filename> is "index.html index.cgi index.pl index.php index.xhtml index.htm". Thus, if Apache2 finds a file in a requested directory matching any of these names, the first will be displayed.
|
|
|
|
Por exemplo, quando um usuário pede a página http://www.example.com/este_directorio/, ele ou ela vai receber a página especificada em DirectoryIndex se a mesma existir, uma lista de diretório gerada pelo servidor caso esta página não exista e se a opção Indexes for especificada, ou uma página de Permissão Negada page se nenhum dos casos for verdadeiro. O servidor vai tentar encontrar um dos arquivos listados na diretiva DirectoryIndex e vai retornar o primeiro localizado. Se nenhum destes arquivos for localizado e se <emphasis>Options Indexes</emphasis> estiver configurado para aquele diretório, o servidor vai gerar uma lista em formato HTML dos subdiretórios e arquivos neste diretório. O valor padrão, encontrado em <filename>/etc/apache2/mods-available/dir.conf</filename> é "index.html index.cgi index.pl index.php index.xhtml index.htm". Assim, se o Apache2 encontrar um arquivo em um diretório requisitado que tenha qualquer um destes nomes, será mostrado.
|
|
Translated by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:311(para)
|
|
326.
|
|
|
The <emphasis>ErrorDocument</emphasis> directive allows you to specify a file for Apache2 to use for specific error events. For example, if a user requests a resource that does not exist, a 404 error will occur, and per Apache2's default configuration, the file <filename>/usr/share/apache2/error/HTTP_NOT_FOUND.html.var </filename> will be displayed. That file is not in the server's DocumentRoot, but there is an Alias directive in <filename>/etc/apache2/apache2.conf</filename> that redirects requests to the /error directory to <filename>/usr/share/apache2/error/</filename>.
|
|
|
|
A diretiva <emphasis>ErrorDocument</emphasis> lhe permite especificar um arquivo que será usado pelo Apache2 para erros específicos. Por exemplo, se um usuário solicitar um recurso que não existe, um erro 404 vai ocorrer, e pela configuração padrão do Apache, o arquivo <filename>/usr/share/apache2/error/HTTP_NOT_FOUND.html.var </filename> será exibido. este arquivo não está no documentroot do servidor, mas há uma diretiva Alias em <filename>/etc/apache2/apache2.conf</filename> que redireciona solicitações ao diretorio /error para <filename>/usr/share/apache2/error/</filename>.
|
|
Translated by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:332(para)
|
|
327.
|
|
|
To see a list of the default ErrorDocument directives, use this command:
|
|
|
|
Para ver uma lista das diretivas ErrorDocument padrão, utilize este comando:
|
|
Translated by
Filipe Rosset
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:344(para)
|
|
328.
|
|
|
grep ErrorDocument /etc/apache2/apache2.conf
|
|
|
|
grep ErrorDocument /etc/apache2/apache2.conf
|
|
Translated by
Filipe Rosset
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:350(command)
|
|
329.
|
|
|
By default, the server writes the transfer log to the file <filename>/var/log/apache2/access.log</filename>. You can change this on a per-site basis in your virtual host configuration files with the <emphasis>CustomLog</emphasis> directive, or omit it to accept the default, specified in <filename> /etc/apache2/apache2.conf</filename>. You may also specify the file to which errors are logged, via the <emphasis>ErrorLog</emphasis> directive, whose default is <filename>/var/log/apache2/error.log</filename>. These are kept separate from the transfer logs to aid in troubleshooting problems with your Apache2 server. You may also specify the <emphasis>LogLevel</emphasis> (the default value is "warn") and the <emphasis>LogFormat</emphasis> (see <filename> /etc/apache2/apache2.conf</filename> for the default value).
|
|
|
|
Por padrão, o servidor grava o log de transferência no arquivo <filename>/var/log/apache2/access.log</filename>. Você pode alterar isso para cada site nos arquivos de configuração dos seus hosts virtuais com a diretiva <emphasis>CustomLog</emphasis>, ou omiti-la para aceitar o padrão, especificado no <filename> /etc/apache2/apache2.conf</filename>. Você também pode especificar o arquivo no qual os erros serão registrados, através da diretiva <emphasis>ErrorLog</emphasis>, para a qual o padrão é <filename>/var/log/apache2/error.log</filename>. Estes são mantidos separados dos logs de transferência para ajudar na solução de problemas com seu servidor Apache2. Você também pode especificar o <emphasis>LogLevel</emphasis> (o valor padrão é "warn") e o <emphasis>LogFormat</emphasis> (consulte o <filename> /etc/apache2/apache2.conf</filename> para o valor padrão).
|
|
Translated by
Marcelo R. Minholi
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:355(para)
|
|
330.
|
|
|
Some options are specified on a per-directory basis rather than per-server. <emphasis>Options</emphasis> is one of these directives. A Directory stanza is enclosed in XML-like tags, like so:
|
|
|
|
Algumas opções são especificadas em uma base por diretório, e não por servidor. <emphasis>Options</emphasis> é uma dessas diretivas. Uma instância Directory está delimitado por tags semelhantes ao formato XML, assim:
|
|
Translated by
Rogênio Belém
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:370(para)
|
|
331.
|
|
|
![](/@@/translation-newline)
<Directory /var/www/mynewsite> ![](/@@/translation-newline)
... ![](/@@/translation-newline)
</Directory>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
![](/@@/translation-newline)
<Directory /var/www/novosite> ![](/@@/translation-newline)
... ![](/@@/translation-newline)
</Directory>
|
|
Translated by
Filipe Rosset
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:376(programlisting)
|
|
332.
|
|
|
The <emphasis>Options</emphasis> directive within a Directory stanza accepts one or more of the following values (among others), separated by spaces:
|
|
|
|
A diretiva <emphasis>Options</emphasis>, dentro de uma instância Directory, aceita um ou mais dos seguintes valores (dentre outros), separados por espaços:
|
|
Translated by
Rogênio Belém
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:382(para)
|
|
333.
|
|
|
Most files should not be executed as CGI scripts. This would be very dangerous. CGI scripts should kept in a directory separate from and outside your DocumentRoot, and only this directory should have the ExecCGI option set. This is the default, and the default location for CGI scripts is <filename>/usr/lib/cgi-bin</filename>.
|
|
|
|
A maioria dos arquivos não devem ser executados como scripts CGI. Isto pode ser bastante perigoso. Scripts CGI devem ser mantidos em um diretório separado e fora de seu DocumentRoot, e somente este diretório deve ter a opção ExecCGI setada. Isto é o padrão, e a localização padrão para os scripts CGI é <filename>/usr/lib/cgi-bin</filename>.
|
|
Translated by
Daniel de Souza Telles
|
|
Reviewed by
André Gondim
|
|
|
|
Located in
serverguide/C/web-servers.xml:394(para)
|