Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
Apache directory icons?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Ember1205" data-source="post: 1720651" data-attributes="member: 374272"><p>AddIcon statements are part of the Autoindex feature and configuration of Apache. What you've done is to add an Alias statement in your main configuration file that is an exact duplicate of one already contained in that feature-specific file. </p><p></p><p>Since I don't know how well-versed you are in Apache configuration, I'll lay out some basics here.</p><p></p><p>When you configure Apache, you have to tell it where the root of the web site is on disk. For Mac, this is /Library/WebServer/Documents. When you write the URL for your web site, it looks like this: <a href="http://host.domain.tld/" target="_blank">http://host.domain.tld/</a> and your Apache daemon considers that the root of the -site-. Anything you put AFTER that in the URL would be either a document or a path to a document WITHIN the directory where the site starts. <a href="http://host.domain.tld/icons/" target="_blank">http://host.domain.tld/icons/</a> would translate to /Library/WebServer/Documents/icons on disk by default. The Alias statement is a way to 'redirect' the /icons/ subdirectory to somewhere else on disk without violating security. In this case, /usr/share/httpd/icons/</p><p></p><p>Make sense so far?</p><p></p><p>In this particular case, you're trying to get the browser to "pull" the correct image file to go with a particular file based on its extension. So, what needs to happen is that the browser needs to have the correct URL (<a href="http://host.domain.tld/icons/p.gif" target="_blank">http://host.domain.tld/icons/p.gif</a>) and it needs to pick that file up from the correct place on disk (/usr/share/httpd/icons/p.gif). Since you already have the Alias command to redirect the subdirectory to right place on disk, you need to tell Apache to create the correct reference when building the file indexes.</p><p></p><p>If you are not getting proper results using the /icons/p.gif reference, try removing the leading "/" and create your AddIcon directive as follows:</p><p></p><p>[code]AddIcon icons/p.gif .ppt .pptx[/code]</p><p></p><p>Another very useful tool in troubleshooting this is to actively watch the access and error logs while you are attempting to open the directory.</p><p></p><p>You can use </p><p></p><p>[code]tail -f /var/log/apache2/access_log[/code] </p><p></p><p>and </p><p></p><p>[code]tail -f /var/log/apache2/error_log[/code] </p><p></p><p>CTRL-C will break those. Be sure your browser cache is cleared between attempts to ensure that the browser will attempt to retrieve the data from the server.</p></blockquote><p></p>
[QUOTE="Ember1205, post: 1720651, member: 374272"] AddIcon statements are part of the Autoindex feature and configuration of Apache. What you've done is to add an Alias statement in your main configuration file that is an exact duplicate of one already contained in that feature-specific file. Since I don't know how well-versed you are in Apache configuration, I'll lay out some basics here. When you configure Apache, you have to tell it where the root of the web site is on disk. For Mac, this is /Library/WebServer/Documents. When you write the URL for your web site, it looks like this: [url]http://host.domain.tld/[/url] and your Apache daemon considers that the root of the -site-. Anything you put AFTER that in the URL would be either a document or a path to a document WITHIN the directory where the site starts. [url]http://host.domain.tld/icons/[/url] would translate to /Library/WebServer/Documents/icons on disk by default. The Alias statement is a way to 'redirect' the /icons/ subdirectory to somewhere else on disk without violating security. In this case, /usr/share/httpd/icons/ Make sense so far? In this particular case, you're trying to get the browser to "pull" the correct image file to go with a particular file based on its extension. So, what needs to happen is that the browser needs to have the correct URL ([url]http://host.domain.tld/icons/p.gif[/url]) and it needs to pick that file up from the correct place on disk (/usr/share/httpd/icons/p.gif). Since you already have the Alias command to redirect the subdirectory to right place on disk, you need to tell Apache to create the correct reference when building the file indexes. If you are not getting proper results using the /icons/p.gif reference, try removing the leading "/" and create your AddIcon directive as follows: [code]AddIcon icons/p.gif .ppt .pptx[/code] Another very useful tool in troubleshooting this is to actively watch the access and error logs while you are attempting to open the directory. You can use [code]tail -f /var/log/apache2/access_log[/code] and [code]tail -f /var/log/apache2/error_log[/code] CTRL-C will break those. Be sure your browser cache is cleared between attempts to ensure that the browser will attempt to retrieve the data from the server. [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
Apple Computing Products:
macOS - Operating System
Apache directory icons?
Top