Jūs esateŽurnalai / Ernestas Kardzys's blog / How to access "icons" directory of Apache installation?

How to access "icons" directory of Apache installation?


ParašėErnestas Kardzys - 2009 Rugsėjo 08

By default Windows Apache directory looks like that:
2009.09.08  21:31    <DIR>          . 2009.09.08  21:31    <DIR>          .. 2004.11.21  13:50            15.159 ABOUT_APACHE.txt 2009.09.08  21:27    <DIR>          bin 2009.09.08  21:27    <DIR>          cgi-bin 2009.08.06  02:33           102.237 CHANGES.txt 2009.09.08  21:27    <DIR>          conf 2009.09.08  21:27    <DIR>          error 2009.09.08  21:27    <DIR>          htdocs 2009.09.08  21:27    <DIR>          icons 2008.09.18  13:16             4.835 INSTALL.txt 2009.08.06  16:15            36.833 LICENSE.txt 2009.09.08  21:29    <DIR>          logs 2009.09.08  21:27    <DIR>          manual 2009.09.08  21:27    <DIR>          modules 2009.08.06  16:15             1.323 NOTICE.txt 2008.10.15  08:22             1.650 README-win32.txt 2007.01.10  00:50             6.094 README.txt
The point is that I have a file index.html which is located in htdocs directory. The file index.html needs a file apache_pb.gif from icons directory. So, how can file htdocs/index.html access the file icons/apache_pb.gif? One way is to make a copy of icons directory and paste it into htdocs. But I did in other way. I edited the file httpd.conf and added the fallowing lines:
Alias /icons/ "C:/Program Files/Apache Software Foundation/Apache2.2/icons/" <Directory "C:/Program Files/Apache Software Foundation/Apache2.2/icons/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
My index.html looks like that:
<html> <body> <img src="/icons/apache_pb.gif" alt="Apache Logo" /> </body> </html>
It works! :)

It works if in httpd.conf is enabled alias support :)

Skelbti naują komentarą

Šio laukelio turinys bus laikomas privatus ir nerodomas viešai.
  • Web puslapiu adresai ir el. pašto adresai automatiškai tampa nuorodomis.
  • Leidžiamos HTML žymės: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Linijos ir paragrafai atskiriami automatiškai
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

Daugiau informacijos apie teksto formatavimą

CAPTCHA
Šis klausimas yra skirtas įsitikinti, jog jūs esate žmogus, ir sustabdyti automatinį šlamšto siuntimą.
1 + 7 =
Išspręskite šią paprastą matematinę užduotį ir įveskite atsakymą. Pvz., jei užduotis yra 1+3, įveskite 4.