How to run spree commerce under a domain? - ruby-on-rails

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

Related

Deploy Rails server on Digital Ocean, works with direct IP address only, not with domain name

Got server deployed in production mode through this tutorial.
It works on my direct Digital Ocean IP address, but my domain name still shows ZPanel
Have you installed mod_passenger?
Have you created the virtual host in your apache httpd.conf?
Have you restarted apache?
Hint: put a index.html file in your application - public/ directory and some gibberish in it, then see if it loads fine in your browser. If it does not, then your apache config needs work, if it does but the Rails app still won't work, you should look at that one instead.

Deploying rails app on Digital Ocean with passenger and NGINX

This is the very first app I am deploying so I'm not 100% familiar with the whole process.
Right now, all my code for the app is on my server, and if i run rails s and bind it to my droplet ip, it shows up perfectly(i.e. if i go to myipaddress:3000).
But, if I just go to myipaddress on my browser, i just get a 500 error page.
I am confused about the whole process, do i have to have my rails s running the whole time when deployed and running on the server?
If not what am I doing wrong and how can i fix it so that it just shows up when I go to my droplet ipaddress?
My nginx.conf file has its server name pointed to my droplet ip and its root pointed at my apps root folder.
Also, im not getting any errors logged into my nginx/log/error.log file
First of all you don't need to start server with rails s.
You just need to install passenger and nginx for start application with installation of ruby on rails.
And if you just want to check your app is running or not then start server with rails s into digitalocean and try to open it with browser with `ip:3000' then it will work.
From this Ref. link you can start with passenger and nginx.
Let me know if you need more help.

Adding Subdomain for my ruby on rails server, how to do?

i've got some problems with my ruby on rails server.
It is running under localhost:3333 in my debian vm under a windows8 host.
I've installed apache2 and passengermodul for apache to get ruby. And then I've installed rails.
Now I need a subdomain wich calls the ruby on rails server.
for example admin.localhost:3333
Is something like that possible? And when how can I configurate it?
You can use the lvh.me domain. That domain has a DNS entry that will redirect to localhost. This also works for subdomains, so you can visit admin.lvh.me:3000 and it will redirect to localhost:3000 while still having the subdomain available in the Rails request.
The advantage is that you don't have to edit your localhost file.
Add custom hosts with subdomains to the hosts file, follow these steps
In your terminal, open hosts file
cd /etc
sudo nano hosts
Add the host as mentioned in the following lines to the hosts file, you can add as many as you want
127.0.0.1 admin.localhost
127.0.0.1 subdomain.localhost
Save the file, CTRL + X then press Y
Done.
To run with a custom port, specify the port number while starting the server,
rails s -p 3333
Now you can run your application with, admin.localhost:3333
Hope this helps!

Attempting (and failing) to install Locomotive CMS

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!

how to deploy ruby on rails application in xampp in windows xp?

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/

Resources