RApache config problem - configuration

My sysadmin installed RApache for me on our 64 bit Solaris box. I can access the RApacheInfo page here, indicating that the module was successfully installed. There is the following entry in the httpd.conf:
<Directory /websites/zbroom>
SetHandler r-script
RHandler brew::brew
</Directory>
which should require all files in the directory to be parsed through the brew function of the brew package. As can be seen on my test page, the R code is ignored. There are no errors thrown (nothing in the Apache logs).
This is the test code:
<html><head><title>R test</title></head>
<body>
<p>here is some normal text</p>
<%=rnorm(100) %>
<% print(rnorm(100)) %>
<p>Between this text and the first text there should be some R output.</p>
</body>
</html>
What do I need to change so that the R code will be evaluated and printed?

Following Dirk's advice I posted at the google RApache group. It appears the issue was not bad config, but that Apache needed a restart for things to take effect. Sigh, well at least the fix was easy.

Related

How to get rid of "WARNING: no homepage content found in homepage.md"?

I'm getting started with KSS using CSS in Depth by Keith Grant as a reference.
At 10.1.4, the author writes
Inside the css directory, create a new file at css/homepage.md. This will be a file in markdown that serves as an introduction to the pattern library. Copy this listing into the file.
# Pattern library
Page heading This is a collection of all the modules in our stylesheet. You may use any of these
modules when constructing a page.
Now run npm run build and the warning about home page content should be gone.
The point is that the warning is not gone for me,
WARNING: no homepage content found in homepage.md.
and indeed opening docs/index.html in the browser shows the content of the directory.
In case it might be related, here's the full output of the npm run kss command:
> simplemodule#1.0.0 kss
> kss --config kss-config.json
Version 9 of Highlight.js has reached EOL and is no longer supported.
Please upgrade or ask whatever dependency you are using to upgrade.
https://github.com/highlightjs/highlight.js/issues/2877
WARNING: no homepage content found in homepage.md
I have solved this problem.For details,please refer to the official demo homepage.md
note:The homepage.md file should be placed at the project root directory
to visit official demo

CGI Script displayed as Plain Text in Apache2 (localhost)

I currently have to do a web server in Apache2 that consists on a Login/Register web, and I have to call a CGI Script to validate the input data from the user. Well, when I call the script with the submit button, the CGI Script appears as Plain Text, and I don't know what else to do to fix it.
I have tried uncommenting CGI Modules in /etc/apache2/httpd.conf, setting a default directory for CGI Scripts, uncommenting the AddHandler for CGI and changing Options values in my localhost directory and in the CGI directory adding ExecCGI in them all. But it still does not work, it just appears as plain text.
P.S.: I followed this tutorial (http://httpd.apache.org/docs/2.2/howto/cgi.html) and also looked for the solution here in StackOverflow, but I got nothing working for me.
Edit: Also thank you for helping if you do :)
The problem was the directory configuration, so I kept the default http.config file, that has a preset ScriptAlias for the /cgi-bin/ directory to the following directory:
/Library/WebServer/CGI-Executables
Then I enabled the CGI Module by uncommenting the line (removing the '#' before the line) in the httpd.conf file from apache2:
LoadModule cgi_module libexec/apache2/mod_cgi.so
Finally I saved the file, and then I restarted the Apache2 server using the command:
sudo /usr/sbin/apachectl restart
Then I just pasted the .cgi script in the CGI-Executables directory, setting the permissions of the file as chmod a+x.
To run the script now you just have to access
localhost/cgi-bin/script.cgi
Thank you for the help anyways!

Enable Tidy on openshift

I'm trying to get the Tidy module to load for my PHP app that I'm hosting on Openshift. Editing the PHP.ini seems to not be allowed as when I restart the app, the file reverts to the old content.
I've tried adding the following to my php script but it doesn't seem to work:
ini_set('tidy.clean_output', '1');
I've also added this to the .htaccess
<IfModule mod_php5.c>
php_value tidy.clean_output On
</IfModule>
Any help gratefully appreciated.
According to this page (http://php.net/manual/en/tidy.installation.php), Tidy must be installed using the "--with-tidy" option when configuring PHP, along with, on Red Hat Linux, installing both libtidy and libtidy-devel. If you create a phpinfo page (http://php.net/manual/en/function.phpinfo.php) you can see by the generated output that Tidy is not enabled. You would not be able to enable this module just by updating your php.ini.
The best option would be to visit openshift.uservoice.com and add Tidy as a feature that you would like to have enabled, then you can have other users go vote on it.
Even if you compiled your own version of PHP on your gear Tidy would not work unless those two packages were installed as listed above.

openshift : need to edit httpd.conf to enable or add directive according to my needs but it's not work

i've build my application on localhost and running it without any error. i choose openshift to host my application code but i have a problem to make it works perfectly like on my localhost.
i want to add directive of AllowEncodedSlashes and set it to On in my apache2 configuration file, i have tried to edit the file from ~/php/configuration/etc/conf/httpd.conf and then restart the server using ctl_all restart. but the result are http error code 400 (Bad Request). before i add this directive into httpd.conf the result are http error code 404, i am just not sure if the changes are in effect or not. or apache is bugging?
is there anyone knows howto make this work for me?
See if you can add it into .htaccess file instead of httpd.conf file. Also the best way to troubleshoot these problems would be by reviewing your application logs for errors. All you have to do is run "rhc tail {appName}" from your client machine (where the rhc client tools are installed). That gives you the current log entries.
To get to the entire log, you'll want to ssh onto the gear(s) on which the language framework/cartridge is installed using this FAQ and run: more ~/{cartridgeID}/logs/*.log
where {cartridgeID} is your framework cartridge like nodejs-0.6, or your embedded cartridge logs like mysql-5.1.
I created a feature request for this. See this Trello card and feel free to vote it up.

why Coldfusion-MySQL-Apache isn't running on localhost if everything is setup and connected?

Newbie question - my first attempt at Coldfusion/MySQL and getting it to run locally.
I'm running Apache Webserver (2.2), I have importet two .sql files into MySQL (5.2.) workbench, forward engineered a database from these, setup working database connection and MySQL Server. This is also running. In Coldfusion8 Admin I added my database as a data source.
I thought this would be enough :-)
Still, on http://localhost I'm still only getting an index of all files in my Apache htdocs folder. If I open one of the files it just shows the Coldfusion Markup/HTML source code. Nothing parsed.
Thanks for any hints on what I could be missing?
EDIT:
Three questions trying to implenent:
1. Can I load modules using absolute paths, like D:/Coldfusion8/lib...?
2. My lib/wsconfig folder only contains a dll file named jrunwin32.dll. Trying to use this?
3. The lib/wsconfig folder does not contain a jrunserver.store file. Not sure what to do here
It sounds as if your Apache config is not correct, as it doesn't sound as if it's having the cfm files handled correctly.
First of all, is there a specific reason for using CF8? CF9 has been around for a while, so if going from scratch then I'd advise taking a look at that instead.
That aside, I'd check for the following in your httpd.conf (or whatever your apache config file is named)
Firstly, that .cfm is acceptable as a DirectoryIndex (can have other indexes as well)
DirectoryIndex index.cfm
Secondly, that the JRUN handler is configured properly (so again, in httpd.conf)
LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/1/mod_jrun22.so
<IfModule mod_jrun22.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/1/jrunserver.store
JRunConfig Bootstrap 127.0.0.1:51801
AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>
This is taken from my development VM, I have CF8 as a single-server install in /opt/coldfusion8/
Once you have those lines in (with the paths/ports etc appropriate for your environment) restart apache and it should work fine.
If you have installed CF8 in a Multiserver etc. install then please specify and will look to adjust my advice accordingly