1

我现在已经在 apache 的端口 80 上安装了 subversion,以便为子版本开发 Web 用户界面我需要在同一台机器上使用 php,即在 amazon ec2 实例中为此我必须运行多个 apache 实例端口 80 用于 subversion,另一个用于 php 如何配置可以任何人请帮助我

4

1 回答 1

0

You don't need multiple instances of apache. The easiest way to accomplish this is to enable named virtual hosts. To do this edit /etc/init.d/httpd/conf/httpd.conf (or wherever this file is located on your distro) and add this line to the bottom

NameVirtualHost *:80

And then for each site you can either add to the main httpd.conf (not recommended) or you can include individual conf files. To include files you add this line

Include [path to site config files]/*.conf

And then for each site in a config file you can do something like this (note any options work)

<VirtualHost *:80>
    DocumentRoot [path to the document root]
    ServerName [the domain]
    ServerAlias [any alias]
     <Directory "[path to the document root]">
        FileETag None
        Options FollowSymLinks  
        AllowOverride None  
        Order allow,deny  
        Allow from all  
     </Directory>
</VirtualHost>

If you don't have domain names for it you can put whatever you like in there, and then just edit your hosts file to look for the ec2 IP when you go to that "domain". You can also add any apache options you want to the virtual site.

Hope this helps.

于 2013-09-30T22:08:10.013 回答