drzrzzkh462254 2017-04-17 09:27
浏览 22
已采纳

在一个域名上配置两个symfony实例

I have a development server where I have hosted a site which is build on symfony framework (www.example.com) Now for this domain name "www.example.com", we have all SSL certificates and other things required for the website.

I have a requirement where I have to deploy one more symfony instance but without creating a new domain name. How can I achieve it? Can it point to www.example.com/newInstance ?

Can I run two websites on a same domain name? www.example.com/oldInstance and www.example.com/newInstance

I have less knowledge about networking, so looking for help on this one.

  • 写回答

2条回答 默认 最新

  • doujiao1949 2017-04-17 09:53
    关注

    If you are using Apache as web server you can use alias to point each directory

    <VirtualHost *:80>
      DocumentRoot "path/To/Your/DocumentRoot/oldInstance"
      ServerName www.example.com
    
      <Directory "path/To/Your/DocumentRoot/oldInstance">
        DirectoryIndex app.php
        Options Indexes    
        AllowOverride All
        Require all granted
      </Directory>
    
       Alias /newInstance "path/To/Your/DocumentRoot/newInstance"
    
       <Directory "path/To/Your/DocumentRoot/newInstance">
          DirectoryIndex app.php
          Options Indexes
          AllowOverride All
          Require all granted
      </Directory>  
    </VirtualHost>
    

    If you request http://example.com/ you will get oldInstance directory. If you request http://example.com/newInstance you will get newInstance directory.

    If you want get oldInstance directory by using http://example.com/oldInstance instead of http://example.com then you can configure another alias for that:

    Alias /oldInstance "path/To/Your/DocumentRoot/oldInstance"
    

    Remember to check if mod_alias is enabled in your Apache config.

    LoadModule alias_module modules/mod_alias.so
    

    I hope it helps you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题