# Moving public directory outside of rails structure

**URL:** <https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965>\
**Category:** Rails\
**Created:** [November 14, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965 "2006-11-14T19:43:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [November 14, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965/1 "2006-11-14T19:43:17Z")

</div>

Hi,

I deployed my Rails app to Media Temple where they have a 64mb limit on  
everything inside the RoR application container. This means that with my  
file uploading going to my public directory, that 64mb limit will be hit  
very quickly.

I need to move my public directory “higher” up on the server to a new  
path so that its outside my application directory.

What are the steps I need to take to do this?

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [November 14, 2006, 8:49pm UTC](https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965/2 "2006-11-14T20:49:52Z")

</div>

On Nov 14, 8:43 pm, Eric G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> What are the steps I need to take to do this?  
> Use symbolic links pointing to a directory outside the application  
> tree? This is of course assuming that Media Temple uses \*NIX servers.  
> Currently that’s how I manage certain subdirectories in my public  
> directory, albeit for a different reason.

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [November 14, 2006, 8:55pm UTC](https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965/3 "2006-11-14T20:55:58Z")

</div>

Could you give me an example of how I could use these symbolic links.

Do you have any code you can show me? Where do i put these links?  
Sorry, Im kind of a newb at this stuff.

Eric

Phil wrote:

> On Nov 14, 8:43 pm, Eric G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > What are the steps I need to take to do this?  
> > Use symbolic links pointing to a directory outside the application  
> > tree? This is of course assuming that Media Temple uses \*NIX servers.  
> > Currently that’s how I manage certain subdirectories in my public  
> > directory, albeit for a different reason.

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [November 14, 2006, 9:13pm UTC](https://www.ruby-forum.com/t/moving-public-directory-outside-of-rails-structure/75965/4 "2006-11-14T21:13:59Z")

</div>

On Nov 14, 9:55 pm, Eric G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Could you give me an example of how I could use these symbolic links.
> 
> Do you have any code you can show me? Where do i put these links?  
> Sorry, Im kind of a newb at this stuff.
> 
> Eric

Symbolic links are a feature in \*NIX filesystems. A way you could use  
it for the problem you have is to create a directory, say “uploads”,  
somewhere above the Rails directory. Let’s say the full path to this  
directory is /home/username/uploads, and your Rails application lives  
at /home/username/railsapp.

In the /home/username/railsapp/public directory, you would then create  
a link called uploads, pointing to /home/username/uploads. This means  
that when you access /home/username/railsapp/public/uploads, it  
actually maps to /home/username/uploads. Follow me?

That way, you have a directory higher up in the filesystem hierarchy  
that is still accessible by the webserver.

If you have SSH access, the \*NIX command to create a symlink is “ln -s  
/the/path/to/link/to [name]”. If you omit the name parameter, it  
defaults to the last component of the path argument (in this contrived  
example, that would be “to”). If you don’t have shell access, you’d  
have to find out how to create a symlink via a web interface or  
something similar. I don’ t know if it’s possible to create them via  
FTP.

I hope I’ve made myself clear enough. If not, just yell at me.

~P
