1

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

verhogen
  • 333
  • 2
  • 4
  • 14

1 Answers1

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