How do I configure my apache instance to simply load *.java files in browser instead of sending it to me as a download?

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

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
link|improve this answer
Thanks, is there also a way to set this as the default for all "unknown files"? – verhogen Jan 29 '11 at 8:05
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.