# Simplest CMS design question

**URL:** <https://www.ruby-forum.com/t/simplest-cms-design-question/175813>\
**Category:** Rails\
**Created:** [September 20, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/simplest-cms-design-question/175813 "2009-09-20T13:19:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 20, 2009, 1:19pm UTC](https://www.ruby-forum.com/t/simplest-cms-design-question/175813/1 "2009-09-20T13:19:00Z")

</div>

Hi all,

What would be the best design if I wanted a RubyOnRails basic CMS that  
would allow HTML/images to be uploaded and viewed by users who were  
allowed to see them. In particular what would be a good / robust way  
to host the files? For example:

a) Let Apache web server (i.e. not RoR engine) host them - this would  
require RoR could save the files out on the Unix/Linux box to an  
approach location under the web server (not sure how possible this  
is). Also it means that user management would need to be  
integrated/handled by Apache (could be an issue perhaps?)

b) Let RoR application store them in it’s own directory area, but not  
under the “/public” directory as this could be visible on web for the  
right URL - once stored on file, then the image tag URL in the HTML  
pages would need to tell the RoR application to get them via a  
specific controller/action which would then have to retrieve them and  
stream them out…

c) As per b) above but stored in a mysql database

–  
Greg  
[http://blog.gregnet.org/](http://blog.gregnet.org/)

---

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [September 20, 2009, 1:24pm UTC](https://www.ruby-forum.com/t/simplest-cms-design-question/175813/2 "2009-09-20T13:24:16Z")

</div>

On 20 Sep 2009, at 13:14, Greg H. wrote:

> b) Let RoR application store them in it’s own directory area, but not  
> under the “/public” directory as this could be visible on web for the  
> right URL - once stored on file, then the image tag URL in the HTML  
> pages would need to tell the RoR application to get them via a  
> specific controller/action which would then have to retrieve them and  
> stream them out…
> 
> c) As per b) above but stored in a mysql database

I’d go for Apache with the mod X-Sendfile compiled into it. There’s an  
option in the latest Rails version afaik to use it out of the box and  
in previous versions it’s just a matter of installing a plugin or  
crafting the headers yourself. It basically comes down to handling  
authentication etc with Rails and serving the file through Apache  
directly using a special header.

[http://www.google.com/search?client=safari&rls=en&q=rails+2.3+x+sendfile&ie=UTF-8&oe=UTF-8](http://www.google.com/search?client=safari&rls=en&q=rails+2.3+x+sendfile&ie=UTF-8&oe=UTF-8)

Best regards

Peter De Berdt
