【问题标题】:Middleman server and apache on cloud云上的中间人服务器和 apache
【发布时间】:2013-10-11 08:29:14
【问题描述】:

我有一个运行在 Middleman Server 上的 ruby​​ on rails 应用程序。我在 Windows azure ubuntu 虚拟机中安装了该应用程序。完成安装后,我通过提供此命令“中间人服务器”启动服务器后,我的应用程序运行良好。之后,我按照此过程为该应用程序安装了 apache Web 服务器

http://nathanhoad.net/how-to-ruby-on-rails-ubuntu-apache-with-passenger

但是在完成上述过程后我得到了这个错误

“有效!这是此服务器的默认网页。网络服务器软件正在运行,但尚未添加任何内容。”

请帮助我如何为通常在中间人服务器上运行的 ruby​​ on rails 应用程序安装网络服务器。

【问题讨论】:

  • 您运行的是 Ruby on Rails 应用程序还是 Middleman?通常 Middleman 用于使用命令middleman build 生成静态站点。而且我不相信Passenger会与Middleman合作。

标签: ruby-on-rails apache ubuntu azure middleman


【解决方案1】:

你说你已经安装了 Apache,这是你的网络服务器。如果你安装了Passenger,你就有了一个用于Rails 或Middleman 的应用服务器。查看Phusion Passenger users guide, Apache version。我按照那个来设置。您是在工作时查看src,还是在运行middleman build 后查看build?您正在构建什么,Rails 或 Middleman 应用程序/网站?

我一直在搞乱中间人开发设置的不同方法。我最终尝试了一些不同的配置,并将它们记录在 Gist 中。向下滚动,有一些关于我的乘客版本的信息,我对 MM 很新,那是我第一次尝试乘客,所以请考虑到这一点。我认为最棘手的部分是Passenger 需要public 文件夹,但Middleman 根本不使用public 文件夹。我认为与其他方法相比,Passenger with Middleman 有更多的“陷阱”。查看我的 Gist 中的 3.0。

我的虚拟主机文件如下所示:

# Testing Middleman Development Approaches #3 with Passenger,
# note the public folder is used to serve the src directory
<VirtualHost *:80>
    ServerName mm_passenger.loc
    DocumentRoot /Users/davekaplan/mm_passenger/public
    ServerAlias mm_passenger.loc.*.xip.io
    <Directory /Users/davekaplan/mm_passenger/public>
        AllowOverride all
        Options -MultiViews
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName mm_passenger.build
    DocumentRoot /Users/davekaplan/mm_passenger/build
    <Directory /Users/davekaplan/mm_passenger/build>
        AllowOverride all
        Options -MultiViews
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

我在 Mac 上运行 Apache 和 Passenger。我为 Apache /etc/apache/extra/httpd-vhosts.conf 文件和我的/etc/hosts 文件创建了一个虚拟主机(站点文件的路径)。

不要放弃!

戴夫

【讨论】:

    猜你喜欢
    • 2014-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-28
    • 2015-08-12
    • 2017-04-19
    • 1970-01-01
    • 2016-04-04
    相关资源
    最近更新 更多