Apache在同一IP上配置多个站点,以便远程访问

时间:2014-04-14 12:06:15

标签: linux apache redmine vtiger

我有一个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。

1 个答案:

答案 0 :(得分:-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上的网站