【问题标题】:Apache Configure Multiple Site on same IP, to be access remotelyApache 在同一 IP 上配置多个站点,以便远程访问
【发布时间】:2014-04-14 12:06:15
【问题描述】:

我有一个 vps 服务器。 LAMP 安装在其中。

Consider the IP as 99.88.77.66

我想在这个站点上运行两个应用程序。一个是vtiger,另一个是redmine。

Installation Location
redmine: /var/www/html/redmine
vtiger: /var/www/html/vtigerCRM

我将 httpd.conf 配置为..

ServerName 99.88.77.66:80

..

DocumentRoot "/var/www/html"

..

<Directory "/var/www/html">

..

NameVirtualHost *:80

..

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/redmine/public"
    ServerName localhost
    ServerAlias redmine
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/var/www/html/vtigerCRM"
    ServerName localhost
    ServerAlias vtiger
</VirtualHost>

/etc/hosts as..

127.0.0.1       redmine
127.0.0.1       vtiger
127.0.0.1       localhost

请帮助我以这样的方式进行配置,通过访问 http://99.88.77.66/redmine -- 我将能够访问 redmine 并通过 http://99.88.77.66/vtiger -- vtigerCRM。

【问题讨论】:

  • 您不需要虚拟主机通过相同的 IP 和不同的文件夹访问两个站点。只有一个主机名和两个文件夹。
  • 嗨,我可以通过http://99.88.77.66/vtigerCRM 访问,但是当我使用 redmine 时,目录列表正在发生。默认情况下 redmine documentroot 假设为 http://99.88.77.66/redmine/public
  • 为此设置重写?
  • 我没看懂抱歉,如果可以的话请你帮我重新写一下好吗?
  • 放入/redmine/.htaccess: RewriteEngine On RewriteRule ^$ /public/ [R=301,L]

标签: linux apache redmine vtiger


【解决方案1】:

你将无法访问它,但你可以配置,

<VirtualHost *:80>
DocumentRoot "/var/www/html/vtigerCRM"
ServerName vtigercrm.com
ServerAlias www.vtigercrm.com

和您的 /etc/hosts(在 Linux/mac 上)或 system32/drivers/etc/hosts(在 Windows 上)文件添加

99.88.77.66 vtigercrm.com
99.88.77.66 redmine.com

您将能够访问您的新 IP 上的网站

【讨论】:

  • 阅读问题,这不是他想要的。他甚至不需要使用虚拟主机来完成他想要完成的任务。
猜你喜欢
  • 2014-12-31
  • 2012-09-30
  • 2016-04-22
  • 2019-12-29
  • 2021-12-03
  • 1970-01-01
  • 2017-09-13
  • 2014-05-01
相关资源
最近更新 更多