简体   繁体   中英

Deploying Ruby on Rails App using Passenger & Apache

I am trying to deploy my Ruby on Rails application using Phusion Passenger and the Apache2 module on MacOS. I believe I have installed all dependencies and gems correctly and think a problem lies in my configuration files. I do not have a domain so I am trying to use localhost to deploy.

this first file is the configuration for the apache2 web server and is located in /private/etc/apache2/httpd.conf I think my issue is with the ServerName . I do not have a domain to publicly host this web application from yet. I am trying to locally deploy it first. I have been using localhost:3000 for my development and want to deploy it using that as well. Maybe I am not understanding something vital here with deploying and ServerName .

httpd.conf

<VirtualHost *:80>
  ServerName localhost.depot
  DocumentRoot /Users/rubythree/Documents/agile-web-development-with-rails-5.1/production/depot/public
  SetEnv SECRET_KEY_BASE "secret_key_here"
  <Directory /Users/rubythree/Documents/agile-web-development-with-rails-5.1/production/depot/public>
    AllowOverride all
    Options -MultiViews
    Require all granted
  </Directory>
</VirtualHost>

the next file where an issue might be is the hosts file located in /private/etc/hosts where I added the following line...

hosts

127.1.1.1     localhost.depot

I am new to Phusion Passenger and Apache and am pretty sure I am missing something in my configuration files here. When i try to access the ip 127.1.1.1 after a while of loading the browser will not be able to reach the server. running curl 127.1.1.1 will not return anything either, it will timeout. Any help or direction is appreciated :)

Even if ServerName does not match - apache will serve the first virtualhost as default.

"This machine" address is 127.0.0.1 , also make sure apache is actually running and has no errors in logs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM