我们build立了一个运行Apache的Linuxnetworking服务器,并使用SSL证书。 我们正在将此应用程序放在NS设备的后面,因此需要将SSL移到NS。
将testing服务器设置为使用与生产完全相同的configuration进行testing。 最初,我们使用端口80在httpd.conf文件中设置了一个虚拟主机,我们使用redirect参数将用户redirect到https。
我已经注释掉了这些参数,并重新启动Apache并重新启动httpd服务,但我仍然得到redirect。 我清除了浏览器caching,但仍然redirect。 我似乎无法弄清楚为什么? 下面的httpd.conf条目:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html ServerName testserver02 # RedirectMatch permanent (?i)^/phpapp https://alias.company.org/phpapp # RedirectMatch permanent (?i)^/appname https://alias.company.org/appname # RedirectMatch permanent (?i)^/appname_form https://alias.company.org/appname_form </VirtualHost>
为了确保您没有看到客户端的caching行为,您可以使用telnet在端口80上进行手动HTTP请求,检查是否确实得到redirect。
telnet http://www.domain.tld 80
和请求会看起来像这样:
GET / HTTP/1.1 Host: www.domain.tld
接着是两个空行。
很less,我有发出启动/停止命令时不停止的进程。 发出停止命令后检查服务是否已经停止,如果仍在运行,则在重新启动之前将其终止。
答案很明显,假设你已经重新启动了正确的实例 – 别人正在做redirect。 假设你正在为VirtualHost添加条目,我将假定你在conf.d目录中指定了这些条目。 检查其他configuration的类似设置,包括核心httpd.conf。
该文件通常位于/etc/httpd/conf.d文件位于/etc/httpd/conf.d ,但这在Linux发行版中有所不同。 您也可以在/var/www/html目录(ies)中检查.htaccess文件。