How do I configure my apache instance to simply load *.java files in browser instead of sending it to me as a download?
Asked
Active
Viewed 276 times
1 Answers
3
Put this somewhere convenient:
AddType text/plain .java
in your httpd.conf file. You can find this file via:
$ /usr/sbin/apachectl -V | egrep "(HTTPD_ROOT|SERVER_CONFIG_FILE)"
-D HTTPD_ROOT="/etc/httpd"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
(the typical location is /etc/httpd/conf/httpd.conf
)
then restart your apache with
/usr/sbin/apachectl graceful

Phil Hollenback
- 14,947
- 4
- 35
- 52

Ignacio Vazquez-Abrams
- 45,939
- 6
- 79
- 84
-
Thanks, is there also a way to set this as the default for all "unknown files"? – verhogen Jan 29 '11 at 08:05
-
http://httpd.apache.org/docs/current/mod/core.html#defaulttype – Ignacio Vazquez-Abrams Jan 29 '11 at 08:16