【发布时间】:2015-11-13 22:04:45
【问题描述】:
也许是一个老话题,但我有点坚持使用实际简单的虚拟主机配置。也许我只是错过了一些东西......
我想用一些软件产品配置一个虚拟机。 我已经做了什么: - Jenkins bitnami 堆栈:在 dev.company.com:8080/jenkins 上运行良好
通过 yum 安装 httpd - 通过 WebDAV 设置我的 SVN 存储库:在 dev.company.com/repo 的端口 80 上也可以正常工作
/etc/httpd/conf.d 中的配置文件
<Location /repo>
DAV svn
SVNParentPath /srv/svn/repositories/
SVNListParentPath on
#<LimitExcept>
# GET PROPFIND OPTIONS REPORT>
AuthType Basic
AuthName "SVN Authorization Realm"
AuthUserFile /etc/svn-auth-conf
Require valid-user
#</LimitExcept>
</Location>
- 使用 WebRicks 安装和配置 Redmine。在 localhost:3000 上测试:工作正常
- 通过 HTTPD 使用 Phusion Passenger 运行 Redmine:在 dev.company.com 作为文档根目录运行良好
/etc/httpd/conf.d 中的配置文件
<VirtualHost *:80>
DocumentRoot /home/redmine/redmine/public
ServerName dev.company.com
ServerAlias www.dev.company.com
DirectoryIndex index.html index.php
Alias /redmine /home/redmine/redmine/public
PassengerLogLevel 3
RailsEnv production
PassengerDefaultUser apache
<Location /redmine>
PassengerBaseURI /redmine
PassengerAppRoot /home/redmine/redmine/public
</Location>
<Directory /home/redmine/redmine/public>
Order allow,deny
Allow from all
AllowOverride All
Require all granted
Options -MultiViews
RailsBaseURI /redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
</VirtualHost>
PassengerPreStart http://dev.company.com
现在我想为 /opt/project 和 /var/www/project 设置另一个 vhost 配置文件
我的 Vhost 配置文件如下所示:
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName dev.company.com/test
DirectoryIndex index.html index.php
Alias /test /var/www/html
<Directory /var/www/html>
Options all
Order allow,deny
Allow from all
AllowOverride All
Require all granted
PassengerEnabled off
</Directory>
<VirtualHost *:80>
DocumentRoot /opt/test
ServerName dev.company.com/test2
DirectoryIndex index.html index.php
Alias /test /opt/test
<Directory /opt/test>
Options all
Order allow,deny
Allow from all
AllowOverride All
Require all granted
PassengerEnabled off
</Directory>
始终读取第一个配置文件并在 dev.company.com:80 上运行。 以下所有 vhost 配置文件都将被忽略。
具有默认目录设置的默认 httpd.conf 文件,刚刚添加了 NameVirtualHost *:80(默认 Listen 80)。我还将 127.0.0.1 dev.company.com/test... 包含到 /etc/hosts 文件中,并多次重新启动 httpd 服务(以及完整的虚拟机)。
也许这只是一件简单的事情 - 但我没有任何线索。有人有什么想法吗?我真的很感激!
【问题讨论】:
-
啊我忘了 - 也无法通过 vhost 和 /etc/hosts 文件设置 redmine.company.com。
标签: apache passenger virtualhost redmine centos7