FAQ
Folks,
I am running an Ubuntu 11.10 server w/Apache 2.2.
I am familiar with linux and command line but not familiar w/Apache.

When enter the server IP address like this to a browser URL (pretend IP
here) : 10.10.10.10/doc/
It will list the default directory Index for the /usr/share/doc/
directory. All very nice.

Then I edit autoindex.conf for these two values "HeaderName HEADER.html"
and "ReadmeName README.html"
Restart apache and refresh browser.

This is the HEADER.html
<html>
<head>
<title>"STAN'S DOC INDEX"</title>
</head>
</html>


This is the README.html
<html>
<head>
<title>"README FILE </title>
</head>
<body>
<h1>README FILE</H1>
p>This is the readme file</p>
</body>
</html>

The web page shows the "STAN'S DOC INDEX" title. But there is no directory
listing and there is no README info.

The 'dir.conf' file looks like this
<IfModule mod_dir.c>
DirectoryIndex HEADER.html index.html index.cgi
index.plindex.php index.xhtml index.htm
</IfModule>

If I remove the HEADER.html text then the page reverts back to the default
display and shows the directory index.

So...obviously the thing is picking up the HEADER.html but why isn't it
picking up anything else?

I have been trying to make this work for several days.
I have read and re-read the autoindex and Directory module pages. Because
I'm new at this they are somewhat confusing. A possible solution is the
htaccess file but the mod page strongly recommends not going that route.

I would appreciate any suggestions.

Thanks.
stan

--
[email protected]
"*Beer is always in season*"

Search Discussions

  • Igor Cicimov at Nov 24, 2011 at 3:42 am
    I'm not sure what you are trying to achieve here by modifying these files.

    To get the directory listing, from mod_autoindex documentation:

    "Automatic index generation is enabled with using Options +Indexes. See the
    Options <http://httpd.apache.org/docs/2.2/mod/core.html#options> directive
    for more details."


    If you have a look at Options directive:

    Indexes If a URL which maps to a directory is requested, and there is no
    DirectoryIndex<http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex>(
    *e.g.*, index.html) in that directory, then
    mod_autoindex<http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html>will
    return a formatted listing of the directory.
    So all you need to get a directory listing is:

    1. Optins +Indexes (in the directory command)
    2. You should NOT have any index file in that directory



    On Thu, Nov 24, 2011 at 8:26 AM, Stan Laughlin wrote:

    Folks,
    I am running an Ubuntu 11.10 server w/Apache 2.2.
    I am familiar with linux and command line but not familiar w/Apache.

    When enter the server IP address like this to a browser URL (pretend IP
    here) : 10.10.10.10/doc/
    It will list the default directory Index for the /usr/share/doc/
    directory. All very nice.

    Then I edit autoindex.conf for these two values "HeaderName HEADER.html"
    and "ReadmeName README.html"
    Restart apache and refresh browser.

    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>

    The web page shows the "STAN'S DOC INDEX" title. But there is no
    directory listing and there is no README info.

    The 'dir.conf' file looks like this
    <IfModule mod_dir.c>
    DirectoryIndex HEADER.html index.html index.cgi index.plindex.php index.xhtml index.htm
    </IfModule>

    If I remove the HEADER.html text then the page reverts back to the default
    display and shows the directory index.

    So...obviously the thing is picking up the HEADER.html but why isn't it
    picking up anything else?

    I have been trying to make this work for several days.
    I have read and re-read the autoindex and Directory module pages. Because
    I'm new at this they are somewhat confusing. A possible solution is the
    htaccess file but the mod page strongly recommends not going that route.

    I would appreciate any suggestions.

    Thanks.
    stan

    --
    [email protected]
    "*Beer is always in season*"
  • Igor Cicimov at Nov 24, 2011 at 3:53 am

    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>

    If the file is not displaying maybe is because of the wrong <p> tag above.
    The < is missing from <p> ...Firefox has couple of plugins that can show
    you errors like this one.

    Also maybe try to include the following meta tag in the <head> section of
    the README.html to tell apache it is text/html file for sure:

    <meta http-equiv="content-type" content="text/html;charset=utf-8">


    On Thu, Nov 24, 2011 at 2:41 PM, Igor Cicimov wrote:

    I'm not sure what you are trying to achieve here by modifying these files.

    To get the directory listing, from mod_autoindex documentation:

    "Automatic index generation is enabled with using Options +Indexes. See
    the Options <http://httpd.apache.org/docs/2.2/mod/core.html#options>directive for more details."


    If you have a look at Options directive:

    Indexes If a URL which maps to a directory is requested, and there is no
    DirectoryIndex<http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex>(
    *e.g.*, index.html) in that directory, then mod_autoindex<http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html>will return a formatted listing of the directory.
    So all you need to get a directory listing is:

    1. Optins +Indexes (in the directory command)
    2. You should NOT have any index file in that directory




    On Thu, Nov 24, 2011 at 8:26 AM, Stan Laughlin wrote:

    Folks,
    I am running an Ubuntu 11.10 server w/Apache 2.2.
    I am familiar with linux and command line but not familiar w/Apache.

    When enter the server IP address like this to a browser URL (pretend IP
    here) : 10.10.10.10/doc/
    It will list the default directory Index for the /usr/share/doc/
    directory. All very nice.

    Then I edit autoindex.conf for these two values "HeaderName HEADER.html"
    and "ReadmeName README.html"
    Restart apache and refresh browser.

    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>

    The web page shows the "STAN'S DOC INDEX" title. But there is no
    directory listing and there is no README info.

    The 'dir.conf' file looks like this
    <IfModule mod_dir.c>
    DirectoryIndex HEADER.html index.html index.cgi index.plindex.php index.xhtml index.htm
    </IfModule>

    If I remove the HEADER.html text then the page reverts back to the
    default display and shows the directory index.

    So...obviously the thing is picking up the HEADER.html but why isn't it
    picking up anything else?

    I have been trying to make this work for several days.
    I have read and re-read the autoindex and Directory module pages.
    Because I'm new at this they are somewhat confusing. A possible solution
    is the htaccess file but the mod page strongly recommends not going that
    route.

    I would appreciate any suggestions.

    Thanks.
    stan

    --
    [email protected]
    "*Beer is always in season*"
  • Stan Laughlin at Nov 24, 2011 at 6:34 am
    Igor,
    You wonder why I am editing files. I am trying to learn how to make
    directory listings unique. I am surprised at how difficult this has
    become. (I recognize part of the problem is not knowing what I'm doing
    w/the man pages.)

    I corrected the typo and added the meta line. Did a restart apache2. There
    was no change.

    You made this note:
    So all you need to get a directory listing is:

    1. Optins +Indexes (in the directory command)
    2. You should NOT have any index file in that directory

    I tried to add the lines (taken directly from the example on the Options
    page) to the default.conf file and most of my variations generate 'syntax'
    errors for both the autoindex.conf and the default.conf when I attempt a
    restart.
    I can edit the default.conf file and simply add the lines from the Options
    page example w/o the enclosing <directive> lines and it will restart but
    still not change any display.

    Isn't the 'directory command' you mention actually this file:
    default.conf ?

    I'm sorry to confuse this. I am seriously confused by the man pages.
    I'm starting to think I need to re-install Apache.

    I have read a huge number of web pages trying to figure this out.

    Thanks for any insights you can provide.
    stan
    On Wed, Nov 23, 2011 at 8:53 PM, Igor Cicimov wrote:

    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>

    If the file is not displaying maybe is because of the wrong <p> tag above.
    The < is missing from <p> ...Firefox has couple of plugins that can show
    you errors like this one.

    Also maybe try to include the following meta tag in the <head> section of
    the README.html to tell apache it is text/html file for sure:

    <meta http-equiv="content-type" content="text/html;charset=utf-8">


    On Thu, Nov 24, 2011 at 2:41 PM, Igor Cicimov wrote:

    I'm not sure what you are trying to achieve here by modifying these files.

    To get the directory listing, from mod_autoindex documentation:

    "Automatic index generation is enabled with using Options +Indexes. See
    the Options <http://httpd.apache.org/docs/2.2/mod/core.html#options>directive for more details."


    If you have a look at Options directive:

    Indexes If a URL which maps to a directory is requested, and there is no
    DirectoryIndex<http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex>(
    *e.g.*, index.html) in that directory, then mod_autoindex<http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html>will return a formatted listing of the directory.
    So all you need to get a directory listing is:

    1. Optins +Indexes (in the directory command)
    2. You should NOT have any index file in that directory




    On Thu, Nov 24, 2011 at 8:26 AM, Stan Laughlin wrote:

    Folks,
    I am running an Ubuntu 11.10 server w/Apache 2.2.
    I am familiar with linux and command line but not familiar w/Apache.

    When enter the server IP address like this to a browser URL (pretend IP
    here) : 10.10.10.10/doc/
    It will list the default directory Index for the /usr/share/doc/
    directory. All very nice.

    Then I edit autoindex.conf for these two values "HeaderName
    HEADER.html" and "ReadmeName README.html"
    Restart apache and refresh browser.

    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>

    The web page shows the "STAN'S DOC INDEX" title. But there is no
    directory listing and there is no README info.

    The 'dir.conf' file looks like this
    <IfModule mod_dir.c>
    DirectoryIndex HEADER.html index.html index.cgi index.plindex.php index.xhtml index.htm
    </IfModule>

    If I remove the HEADER.html text then the page reverts back to the
    default display and shows the directory index.

    So...obviously the thing is picking up the HEADER.html but why isn't it
    picking up anything else?

    I have been trying to make this work for several days.
    I have read and re-read the autoindex and Directory module pages.
    Because I'm new at this they are somewhat confusing. A possible solution
    is the htaccess file but the mod page strongly recommends not going that
    route.

    I would appreciate any suggestions.

    Thanks.
    stan

    --
    [email protected]
    "*Beer is always in season*"

    --
    [email protected]
    "*Beer is always in season*"
  • Marc Patermann at Nov 24, 2011 at 11:23 am
    Stan,

    Stan Laughlin schrieb (23.11.2011 22:26 Uhr):
    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>
    "If the file specified by HeaderName contains the beginnings of an HTML
    document (<html>, <head>, etc.) then you will probably want to set
    IndexOptions +SuppressHTMLPreamble, so that these tags are not repeated."
    http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html


    Marc

    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: [email protected]
    " from the digest: [email protected]
    For additional commands, e-mail: [email protected]
  • Igor Galić at Nov 24, 2011 at 11:54 am

    ----- Original Message -----
    Stan,

    Stan Laughlin schrieb (23.11.2011 22:26 Uhr):
    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>
    "If the file specified by HeaderName contains the beginnings of an
    HTML
    document (<html>, <head>, etc.) then you will probably want to set
    IndexOptions +SuppressHTMLPreamble, so that these tags are not
    repeated."
    http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html
    Also you might want to actually *not* close the <body> or the <html>
    tags. In either case.
    Marc
    i

    --
    Igor Galić

    Tel: +43 (0) 664 886 22 883
    Mail: [email protected]
    URL: http://brainsware.org/
    GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE


    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: [email protected]
    " from the digest: [email protected]
    For additional commands, e-mail: [email protected]
  • Stan Laughlin at Nov 24, 2011 at 6:08 pm
    I tried editing the closing tags and the +SuppressHTMLPreamble edit but
    nothing is changing.

    The module man pages are confusing for me and I don't fully understand how
    I need to enter the edits.
    I am in the process of un-installing Apache and will re-install the thing
    because I'm not certain any longer what is original and what I have edited
    incorrectly.

    Thanks for the suggestions. I appreciate the attempts to assist me. If I
    can figure it out I will update this note.

    I am now discovering yet another mess involved in attempting to uninstall
    Apache. It looks like I will have to re-install Ubuntu to get an honestly
    clean Apache re-install. Man, the fun never stops.

    Thanks again for the assistance.
    Be well.

    stan

    2011/11/24 Igor Galić <[email protected]>
    ----- Original Message -----
    Stan,

    Stan Laughlin schrieb (23.11.2011 22:26 Uhr):
    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>
    "If the file specified by HeaderName contains the beginnings of an
    HTML
    document (<html>, <head>, etc.) then you will probably want to set
    IndexOptions +SuppressHTMLPreamble, so that these tags are not
    repeated."
    http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html
    Also you might want to actually *not* close the <body> or the <html>
    tags. In either case.
    Marc
    i

    --
    Igor Galić

    Tel: +43 (0) 664 886 22 883
    Mail: [email protected]
    URL: http://brainsware.org/
    GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE


    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: [email protected]
    " from the digest: [email protected]
    For additional commands, e-mail: [email protected]

    --
    [email protected]
    "*Beer is always in season*"
  • Stan Laughlin at Nov 26, 2011 at 1:41 am
    OK. I think I got it.

    Re-installed Apache2. (Totally different issue there - let me tell you.)

    1) Edited a <p> section into the README.html file. Simple text message. *This
    was most certainly one of my primary failures.*

    2) I queried another individual running similar configuration and did the
    following per their suggestion. Added these 3 lines in
    /etc/apache2/sites-available/default in the
    Alias /doc/ "/usr/share/doc/" section exactly as you see them:
    IndexIgnore *html
    IndexOptions SuppressHTMLPreamble
    IndexOptions SuppressColumnsorting

    3) Added the following two entries in the header/readme section at the
    bottom of /etc/apach2/mods-available/autoindex.conf exactly as you see them:
    ReadmeName README.html
    HeaderName HEADER.html

    3a) I did test whether the system would pick up the header/readme settings
    if I put them in the /etc/apache2/sites-available/default file. From there
    they did not work. Apparently they need to be in the autoindex.conf file.

    I left the IndexOptions line alone in the autoindex.conf file. Previously
    I was trying to edit it.

    The module man pages confused the heck out of me. Hopefully, someone might
    see this post and be less confused.

    Thanks very much for you assistance and suggestions. Glad to know folks
    like you are out there.

    Stan
    On Thu, Nov 24, 2011 at 11:07 AM, Stan Laughlin wrote:

    I tried editing the closing tags and the +SuppressHTMLPreamble edit but
    nothing is changing.

    The module man pages are confusing for me and I don't fully understand how
    I need to enter the edits.
    I am in the process of un-installing Apache and will re-install the thing
    because I'm not certain any longer what is original and what I have edited
    incorrectly.

    Thanks for the suggestions. I appreciate the attempts to assist me. If I
    can figure it out I will update this note.

    I am now discovering yet another mess involved in attempting to uninstall
    Apache. It looks like I will have to re-install Ubuntu to get an honestly
    clean Apache re-install. Man, the fun never stops.

    Thanks again for the assistance.
    Be well.

    stan


    2011/11/24 Igor Galić <[email protected]>
    ----- Original Message -----
    Stan,

    Stan Laughlin schrieb (23.11.2011 22:26 Uhr):
    This is the HEADER.html
    <html>
    <head>
    <title>"STAN'S DOC INDEX"</title>
    </head>
    </html>


    This is the README.html
    <html>
    <head>
    <title>"README FILE </title>
    </head>
    <body>
    <h1>README FILE</H1>
    p>This is the readme file</p>
    </body>
    </html>
    "If the file specified by HeaderName contains the beginnings of an
    HTML
    document (<html>, <head>, etc.) then you will probably want to set
    IndexOptions +SuppressHTMLPreamble, so that these tags are not
    repeated."
    http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html
    Also you might want to actually *not* close the <body> or the <html>
    tags. In either case.
    Marc
    i

    --
    Igor Galić

    Tel: +43 (0) 664 886 22 883
    Mail: [email protected]
    URL: http://brainsware.org/
    GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE


    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: [email protected]
    " from the digest: [email protected]
    For additional commands, e-mail: [email protected]

    --
    [email protected]
    "*Beer is always in season*"


    --
    [email protected]
    "*Beer is always in season*"
  • Christian Kaiser at Nov 29, 2011 at 1:38 pm
    Hello to all,

    I've got a problem with mod_proxy_html.

    I have defined the following location:
    <Location /ne/>
    ProxyPass https://internal.xy.de/
    ProxyPassReverse /
    ProxyPassReverse https://internal.xy.de/
    ProxyPassReverseCookiePath / /ne [interpolate]
    ProxyHTMLEnable On
    ProxyHTMLURLMap / /ne/
    RequestHeader unset Accept-Encoding
    </Location>

    Now html-rewriting works not complete. Some tags where not rewritten like the img-tag:

    <span class="urBtnRow">
    <a id="WD0501" class="urBtnStd" ti="0" tabindex="0" href="javascript:void(0);" title="" lsevents="{Press:[{ResponseData:'delta',ClientAction:'submit'},{}]}" lsdata="{0:'STANDARD',1:'',2:true,3:false,4:false,5:false,6:'',7:false,8:'',9:'NONE',10:false}" ct="B">
    <img border="0" align="absmiddle" style="margin-top:-2px;" src="/sap/public/bc/WebIcons/ur/default/l/Icon/Scheduled.gif">
    &nbsp;Kalenderfunktion
    </a>
    </span>

    I have configured following ProxyHTMLLinks

    ProxyHTMLLinks a href
    ProxyHTMLLinks area href
    ProxyHTMLLinks link href
    ProxyHTMLLinks img src longdesc usemap
    ProxyHTMLLinks object classid codebase data usemap
    ProxyHTMLLinks q cite
    ProxyHTMLLinks blockquote cite
    ProxyHTMLLinks ins cite
    ProxyHTMLLinks del cite
    ProxyHTMLLinks form action
    ProxyHTMLLinks input src usemap
    ProxyHTMLLinks head profile
    ProxyHTMLLinks base href
    ProxyHTMLLinks script src for
    ProxyHTMLLinks td background


    Please advice

    Regards Christian
  • Nick Kew at Nov 29, 2011 at 9:38 pm

    On Tue, 29 Nov 2011 13:38:00 +0000 wrote:

    Please advice
    Does the error log tell you anything if you crank up verbosity?

    --
    Nick Kew

    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: [email protected]
    " from the digest: [email protected]
    For additional commands, e-mail: [email protected]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesapache
postedNov 23, '11 at 9:27p
activeNov 29, '11 at 9:38p
posts10
users6
websitehttpd.apache.org
irc#httpd

People

Translate

site design / logo © 2023 Grokbase