Ruby/Rails/Discourse How To Set Root Directory

333 views Asked by At

I am trying to run wordpress using apache and php as well as discourse using ruby. I am currently doing this by using proxies. Here's what I'm trying to accomplish:

When the user visits http://something.com/ he gets to see my wordpress site.

When the user visits http://something.com/forum he gets to see the discourse site.

The apache proxy is working. I have verified that the discourse page loads, but unfortunately all the assets do not load. Why? The script tags look like this:

<script src="/assets/..."></script>

The issue is that then the request goes to http://something/assets/..., which is not what I want. I have tried to do the following things:

  1. Modify config/application.rb. I changed the config.relative_url_root to "/var/www/discourse" and to "/forum". The webpage will throw this error:

Not Found: /

  1. I have tried to set a tag in the index.html file, but I could not find it under the public/ directory.

  2. I have attempted to modify the config/routes.rb file, but the server would not even start.

You might want to know that I am not a ruby programmer, though I do have programming experience with other languages.

Also, when I modified the config/application.rb file I did not enter any command to reload the file. When I modified the config/routes.rb file, I put my extra code on the very top. I forgot what I did, but it had something to do with setting the root directory.

So: long story short: How do I set the root directory for discourse/ruby on rails?

1

There are 1 answers

0
Nathan On BEST ANSWER

EDIT: I just found out an excellent forum software came out. A lot better than discourse, in speed, ease of use and installation, and looks. It's called Flarum. And it's awesome.

It's still in beta, so there are a few issues, but otherwise I'm willing to use it. Rumor says it will be released sometime in July 2015, but I don't know. All I know is that Flarum is the forum for me.

It's community support is OK, as it comes from esotalk and fluxbb so yeah.

Old answer:

While I can't exactly say this is an answer, I found the solution to my problem.

Although discourse is an excellent forum software and I highly recommend it, I'm sorry discourse for saying this, but ruby on rails and apache simply do not like each other. Instead, I will be switching to codoforum, an excellent forum that is still in beta. It looks a little worse than discourse, but I find it acceptable for my needs. It is also a little faster.

Codoforum's website. Codoforum is written in PHP, so it is really easy to integrate with Wordpress.