apache - Unable to brew using R -
httpd.conf file config brew this:
<directory /usr/local/apache2/htdocs/brew> sethandler r-script rhandler brew::brew defaulttype text/html </directory>
under brew folder, have file:
<html> <body> <% library(cairo) filename <- paste(tempfile(tmpdir='/usr/local/apache2/htdocs'), '.png', sep='') cairopng(filename) x<-1:10000 plot(x, type="l", col="red") dev.off() %> <img src="<%=filename%>"/> </body> </html>
i set permission 777 on safe side, @ least until working.
when call http://localhost/brew/temp.brew, see file being generate under htdocs folder browser not displaying image, broken image. missing? again group.
when try brew simple this, print out on browser:
<% x<-1:1000 print(x) %>
this may apache related. when this:
<%=filename%>
i on browser:
/usr/local/apache2/htdocs/file199c5ea9644c.png
my apache home directory /usr/local/apache2/htdocs, when full path provided in img src="<%=filename%>" sees /usr/local/apache2/htdocs/filename.png, apache dont know is. ideas?
the local file name, full, known server (apache): client (your web browser), need url or relative path. in particular, /usr/local/apache2/htdocs
prefix should no longer there.
try replacing
<img src="<%=filename%>"/>
with
<img src="<%=gsub('/usr/local/apache2/htdocs', '', filename)%>"/>
Comments
Post a Comment