Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st July 2012, 18:18
MaddinXx MaddinXx is offline
Senior Member
 
Join Date: Jul 2011
Location: Switzerland
Posts: 197
Thanks: 25
Thanked 62 Times in 46 Posts
Default mod_ruby sending file as download instead of running

Hello everyone

Today I did a quick check if everything on my server is running as it should.

However, Ruby (mod_ruby) doesn't.

Server
Debian Squeeze 64-bit
ISPConfig 3.0.4.6

The problem is, that if you are trying to open a ruby file (ruby.rb e.g.) it prompts you do download instead of running it.

vHost looks like:

Code:
<Directory /var/www/slug.li>
		AllowOverride None
		Order Deny,Allow
		Deny from all
</Directory>

		<VirtualHost *:82>
			DocumentRoot /var/www/slug.li/web
	
		ServerName slug.li
		ServerAlias www.slug.li
		ServerAdmin admin@rackster-server.ch

		ErrorLog /var/log/ispconfig/httpd/slug.li/error.log

		# Custom error pages
		Alias /error/ /var/www/error/
		<Directory /var/www/error/>
			Options FollowSymLinks
			AllowOverride None
			Order allow,deny
			allow from all
		</Directory>

		ErrorDocument 400 /error/400.html
		ErrorDocument 401 /error/401.html
		ErrorDocument 403 /error/403.html
		ErrorDocument 404 /error/404.html
		ErrorDocument 405 /error/405.html
		ErrorDocument 500 /error/500.html
		ErrorDocument 502 /error/502.html
		ErrorDocument 503 /error/503.html

		<IfModule mod_ssl.c>
		</IfModule>

		<Directory /var/www/slug.li/web>
				Options FollowSymLinks
				AllowOverride All
				Order allow,deny
				Allow from all
				<Files ~ '.php[s3-6]{0,1}$'>
						Order allow,deny
						Deny from all
						Allow from none
				</Files>
		</Directory>
		<Directory /var/www/clients/client6/web47/web>
				Options FollowSymLinks
				AllowOverride All
				Order allow,deny
				Allow from all
				<Files ~ '.php[s3-6]{0,1}$'>
						Order allow,deny
						Deny from all
						Allow from none
				</Files>
		</Directory>

		<IfModule mod_ruby.c>
			<Directory /var/www/slug.li/web>
				Options +ExecCGI
			</Directory>
			RubyRequire apache/ruby-run
			#RubySafeLevel 0
			<Files *.rb>
				SetHandler ruby-object
				RubyHandler Apache::RubyRun.instance
			</Files>
			<Files *.rbx>
				SetHandler ruby-object
				RubyHandler Apache::RubyRun.instance
			</Files>
		</IfModule>


		# suexec enabled
		<IfModule mod_suexec.c>
			SuexecUserGroup web47 client6
		</IfModule>
		# Clear PHP settings of this website
		<FilesMatch "\.ph(p3?|tml)$">
				SetHandler None
		</FilesMatch>

		RewriteEngine on
		RewriteCond %{HTTP_HOST} ^www.slug.li$ [NC]
		RewriteRule ^(.*)$ http://slug.li$1 [R=301,L]

		# add support for apache mpm_itk
		<IfModule mpm_itk_module>
			AssignUserId web47 client6
		</IfModule>

		<IfModule mod_dav_fs.c>
		# Do not execute PHP files in webdav directory
			<Directory /var/www/clients/client6/web47/webdav>
			<FilesMatch "\.ph(p3?|tml)$">
					SetHandler None
				</FilesMatch>
			</Directory>
			DavLockDB /var/www/clients/client6/web47/tmp/DavLock
			# DO NOT REMOVE THE COMMENTS!
			# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
			# WEBDAV END
		</IfModule>


</VirtualHost>
In ISPConfig, Ruby and SuEXEC are enabled, nothing else.

You might see that Apache is running on port 82. I'm using nginx in front of apache - but I told nginx to pass all .rb files to apache (and even with access via :82/ruby.rb it doesn't work).

Is their a special version of ruby that must be installed on the server?

I tried with:

- No Ruby (that doesn't make sense at all, or isn't ruby required?)
- Ruby 1.8 (apt-get install ruby)
- Ruby 1.9.1 (apt-get install ruby1.9.1)

Help is appreciated

Thanks!
MaddinXx
Reply With Quote
Sponsored Links
  #2  
Old 22nd July 2012, 00:17
MaddinXx MaddinXx is offline
Senior Member
 
Join Date: Jul 2011
Location: Switzerland
Posts: 197
Thanks: 25
Thanked 62 Times in 46 Posts
Default

Got it working by:

Code:
nano /etc/mime.types
and commenting out:

Code:
#application/x-ruby rb
like described in a tutorial here on HTF.
Reply With Quote
The Following User Says Thank You to MaddinXx For This Useful Post:
falko (22nd July 2012)
Reply

Bookmarks

Tags
mod_ruby, ruby

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig 3.0.3.3 Autoresponder, adding subdomain problem BlackHat Installation/Configuration 4 18th October 2011 14:24
Can't receive mails baicunko Server Operation 12 3rd August 2011 22:02
Hacked server Captain Installation/Configuration 8 23rd December 2010 10:39
Fedora 12 - Strage problem - Freezes K_meleonu Installation/Configuration 6 3rd March 2010 18:42
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 05:19


All times are GMT +2. The time now is 14:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.