I'm trying to install Locomotive CMS on a virtual rackspace server using their multisite option. I get as far as running the installation and choosing my first subdomain with no problems. But once I create this, the subdomain address gives a 404 error and the root domain give me a 'No site!' error!
I've set up the records in /etc/hosts and am using Unicorn. Am I missing something obvious?
Thanks
Try using pow (along with the powify gem) to setup your hosts. Works a breeze!
Related
I've followed Ryan Bate's guide to deploy two completely different rails apps one one VPS (cost saving, using it for development of small home projects). Link to railscast: http://railscasts.com/episodes/335-deploying-to-a-vps
My issue is: the default application is the one I deployed first, so when I visit the IP address, that is the app which is displayed. How do I configure the server to
Use a subdomain (not sure this is possible using just an IP address)
Change the default app
Had a play around in nginx.conf and read this stack q: NGinx Default public www location?
I can't seem to work it out! Thanks in advance.
I think I understand what you want to do. Your default app term confuses me. Let's throw that out and just say you want to deploy two different rails apps to different domains-- sub or TLD, it doesn't matter. Also, I think you are wanting to deploy them to the same VPS server. Ryan's screencast doesn't include how to do this.
What you are probably looking for is how to host multiple sites (and rails apps) with nginx. Like Ryan's screencast, there are many steps involved to get everything working. I recommend you first focus on domain setup (DNS), then nginx setup. Leaving serving your rails app with unicorn for last.
First
Setup your domain and subdomain to point to the VPS. One way is to create DNS A records point to your VPS IP.
Second
Configure nginx to serve both sites. To get you started in the right direction I recommend you read this: multiple websites on nginx & sites-available. It sounds like you already have nginx serving your app on your domain. So steps might be like:
$ cd /etc/nginx/sites-available/
$ cp default subdomain.example.com
Edit subdomain.example.com accordingly. See nginx docs for details. Also, make sure /sites-available/default and /sites-available/subdomain.example.com are not using _ as server_name directive. Set them to their respective domain names. Also, for now point the root to somewhere that will serve an index.html file (ie. leave rails out of it for now)
$ cd /etc/nginx/sites-enabled/
$ ln -s ../sites-available/eden.jrutherford.com .
$ service nginx restart
If all is well by this point you should be able to visit both domains in a browser and have nginx serve content.
Third
Configure a new unicorn for your subdomain. I'm sorry I don't have specific tips for this step . Follow Ryan's tutorial, search google, unicorn website.
Good Luck.
I have a vds server centos and directadmin installed.
I want to install spree commerce and followed the instructions here
Actually I have installed everything without problem (even spree commerce), but I don't know how to run the website under a domain name.
I have tried installing the script in the /home/myusername/domains/mydomainname.com/public_html folder but no luck. I can't access the website under mydomain.com
Thanks for your answers...
Not sure I understand what you mean by domain in this context.
If you've installed everything correctly you should be able to run rails server to start your webserver
and in a browser navigate to localhost:3000
to be able to navigate to your own domain you should set
Rails.application.routes.default_url_options[:host]= 'mydomainname.com'
in config/environments/development.rb file
and in your /etc/hosts file
127.0.0.1 localhost
127.0.0.1 mydomainname.com
Ok so what i'm trying to do is deploy my first rails project. I've asked this question and i think i figured out that you can't configure apache to work using an ip and you have to have a domain name.
The reason i can't use the domain name yet is because i'm recreating a site for someone and they don't want it to be down in between switching the domain from their current site to their new rails site.
I'd like to get my rails app running on a server so I can test it out and then once it's ready, switch the domain name.
How can i setup a server to run a rails project without using the domain name?
If you want to run the rails project locally in development mode, then just run the command rails s from the root of your project.
It is possible to deploy two apps to the same server, or two versions of the same app, I typically use sub-domains for this, website.com and then testing.website.com.
You will just need to have seperate databases and seperate virtualhost files.
You could also try to access the apache machine by it's IP address if it is on the local network.
I went to this tutorial http://railscasts.com/episodes/221-subdomains-in-rails-3 and trying to implement in http://ngtv2.info
but after I place the code in routes.rb
match '/' => 'projects#show', :constraints => { :subdomain => /.+/ }
and then typed kingpangilinan.ngtv2.info
the browser says that "Server not found", Firefox can't find the server at kingpangilinan.ngtv2.info
Any help is appreciated.
You have to setup your DNS to point to your webserver. Just telling Rails to answer for a specific domain doesn't setup the DNS to do the same.
$ nslookup kingpangilinan.ngtv2.info
** server can't find kingpangilinan.ngtv2.info: NXDOMAIN
Use the interface of your domain provider or ask them directly to setup a wildcard DNS entry.
If you are using Rails 3 you shouldn't be using that Railscast (it's from 2008 anyway). There's a newer version which is specifically targeted for Rails 3: http://railscasts.com/episodes/221-subdomains-in-rails-3
By the way: You should not deploy a yet unfinished app without any protection. Development should happen locally or at least behind a password secured website.
This has got nothing to do with Rails and everything to do with DNS and the way the Internet works.
You must configure the DNS zone for ngtv2.info with a wildcard subdomain entry before you can try setting up Rails to catch these subdomains.
To test subdomain routing out locally, you should try running the app on your computer and browsing to it at http://lvh.me:3000 instead of http://localhost:3000. Then you can also browse to http://anysubdomain.lvh.me:3000 and Rails will catch that it's a subdomain.
If you want to develop on your local machine using the subdomain constraint modify your /etc/hosts by adding
127.0.0.1 SUBDOMAIN.localhost.de
Then rails can infer the subdomain from your request. Make sure you use the URL you specified in the /etc/hosts and not localhost:3000.
I'm very new to Ruby environment ..
I want to run my Ruby on rails Application in apache in xampp on windows xp rather than WeBrick server which is in-built for ruby on rails...
I tried it by adding Virtual host in apache- http.conf file
When i run my application i'm able to see "Welcome Abroad"....
But when i click on "About your application’s environment"
it was showing error like the following
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
9/9/2011 10:47:31 AM
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
To deploy your app with apache you need to use phusion passenger http://www.modrails.com
There are plenty of how-to's around the web and the documentation is good enough to get the service running.
This means your Ruby on Rails server is NOT running.
You need to run your server first.
I made a batch file, start-server.bat which contains
d:
cd "D:\Ruby\Web\rails1"
"C:\RailsInstaller\Ruby1.9.3\bin\ruby.exe" script\rails server
then check the PORT number of the server that is running,
So since the port on the screenshot says 10524, you can run it on
http://localhost:10524/