File upload to MySQL blob on Apache

I have a good question for a guru…

I have a Rails app (of course) that has a page where the visitor uploads
an image file. This image file is then saved as a blob in the MySQL
database.

And, this works. But… it only works when I run the application in
development mode on Webrick. When I deploy the app to my production
server with Apache2, then it doesn’t work. Therein lies my question.
What am I doing wrong or not doing?

Clearly the code is correct. When I look at the log files I see the
same results, except that the production/Apache2 does not have the image
file being passed as blob type parameter in the SQL statement.

So my suspicion is that the Apache2 is not configured correctly to allow
the image types. But what to do?

my httpd.conf is as follows…

<VirtualHost 192.168.xx.xxx:80>
ServerName localhost.localdomain
DocumentRoot /var/local/my_app/public/
ErrorLog /var/local/my_app/log/server.log

<Directory /var/local/my_app/public/>
	Options ExecCGI FollowSymLinks
	AddHandler cgi-script .cgi
	AllowOverride all
	Allow from all
	Order allow,deny
</Directory>
AddHandler fcgid-script .fcgi SocketPath /var/lib/apache2/fcgid/sock IdleTimeout 3600 ProcessLifeTime 7200 MaxProcessCount 8 DefaultMaxClassProcessCount 2 IPCConnectTimeout 8 IPCCommTimeout 60 DefaultInitEnv RAILS_ENV production

any help is most appreciated.

Thank You Railers!

Andy K.

solved my own problem,

turns out it was an issue of relative vs. absolute paths

since Webrick runs in the root of the app it was happy with the relative
file path. Apache runs elsewhere, as such it required an absolute path.

Hope this helps the next guy…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs