0

I currently have a production site on my server and i'm looking to add a development site. The production site is using the only ip address I have for a single domain SSL certificate. Is there a way I can add the development site without purchasing another ip. I don't necessarily need SSL for the development site. Perhaps a mix of ip and name based virtualhosts? The current setup is as follows:

# Production
NameVirtualHost 123.45.678.910:80

<VirtualHost 123.45.678.910:80>
  DocumentRoot /var/www/html/production
  ServerName www.example.com
</VirtualHost>

NameVirtualHost 123.45.678.910:443

<VirtualHost 123.45.678.910:443>
  DocumentRoot /var/www/html/production
  ServerName www.example.com
</VirtualHost>

Thanks Paul

EDIT

Would something like this work?

# Production
NameVirtualHost 123.45.678.910:80

<VirtualHost 123.45.678.910:80>
  DocumentRoot /var/www/html/production
  ServerName www.example.com
</VirtualHost>

NameVirtualHost 123.45.678.910:443

<VirtualHost 123.45.678.910:443>
  DocumentRoot /var/www/html/production
  ServerName www.example.com
</VirtualHost>

# Development

<VirtualHost 123.45.678.910:80>
  DocumentRoot /var/www/html/development
  ServerName dev.example.com
</VirtualHost>

Or would I need to use a different port, maybe 8080?

4

2 回答 2

0

这在 Apache 文档中有所涉及,但“基本上”您不能通过 SSL 执行基于名称的虚拟主机;证书交换必须在主机标头发送之前发生,到那时为时已晚。不过,您可以在备用端口上创建虚拟 SSL 站点。

否则,您当然可以在非 SSL 端口上创建基于名称的虚拟主机。首先在生成的配置文件中定义您当前的生产站点以避免出现问题。这就像只在端口 80 上使用基于名称的虚拟主机,在 443 上再使用一个虚拟主机。

于 2013-09-04T05:24:40.613 回答
0

您可以:

于 2013-09-04T15:51:05.713 回答