SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RoR Apache setting?

    This is a simple 'hello word' application.

    code structure is here

    http://www.smtservers.com/demo/

    I can access it here

    http://www.smtservers.com/demo/public/say/hello

    But the url is so long and other people can see my source code

    I want to access the same code like this

    http://www.smtservers.com/say/hello

    I ask the hosting company,he told me change .htaccess.

    Please give me a idea how to change the setting in .htaccess

    Thanks

    MS

  2. #2
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My question is like how to map ruby public folder to a url.

    I can not access httpd.conf.the hosting limited my function.

    Ms

  3. #3
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your problem is that your DocumentRoot needs to be set to your 'public' directory.
    It is actually your host who will need to add /demo/public to the VirtualHost setting in the Apache config since I doubt you have access to this.

    Alternatively if they won't do this for you you could create an .htaccess file in the root directory containing the following.....
    Code:
    Redirect 301 / /demo/public

  4. #4
    SitePoint Member
    Join Date
    Jun 2005
    Location
    Eastbourne, UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should be creating/uploading your app in a web-inaccessible area! The way you have it right now is incredibly insecure as anyone could access your code and database settings.

    Create your app in your home directory, then sym-link your htdocs folder (may well be called something else) to your apps public folder. After that all you have to do is add a default route to routes.rb so that yourdomain.com will go straight to your default page.

  5. #5
    SitePoint Evangelist lirux's Avatar
    Join Date
    Jan 2001
    Location
    Lisboa : Portugal
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like your host doesnt have good support for ruby on rails...
    There are lot's of hosts that do it well, you can see a list at http://wiki.rubyonrails.org/rails/pages/RailsWebHosts

    I like textdrive
    Duarte Carrilho da Graša
    RailsHelp.com: Searchable Rails reference
    CACA: Committee for the Annihilation of Complicated Acronyms


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •