在http上执行的Apache-php可以,但是https不是

我有新的专用Linuxnetworking服务器。

我的托pipe服务提供商给我一个PHP的Apache服务器的设置。

当我用ip打开浏览器中的url,即: http://xxx.yyy.zzz.vvv/test.php ,我得到执行php脚本,它工作正常。 所以,在这种情况下一切正常。

如果我在浏览器中调用https,就会发生问题,如https://xxx.yyy.zzz.vvv/test.php

在这种情况下,我得到浏览器选项另存为,我所能做的就是保存在我的电脑上的PHP文件。

所以,在我看来,有一些与Apache的configuration错误。

提供商支持告诉我,这将工作正常,当我在Apache服务器build立证书。 但是,我不确定。

你能告诉我提供者的支持是否正确。

另外,在服务器上安装plesk。 过去,plesk遇到了很多问题。 plesk是否可以解决这个问题?

如果你能帮我解决这个问题。 先谢谢你!

你的主机在于,如果没有证书,你会得到一个不好的证书消息,而不是源代码下载。 我的猜测是你的https设置过于严格,避免脚本被执行。 我正在发送一个正确的可configuration的https .conf文件的副本:

NameVirtualHost domain.tld:80 <VirtualHost your_server_ip:80> ServerAdmin [email protected] DocumentRoot /path/to/site/root/ ServerName domain.tld ScriptAlias /cgi-bin/ "/path/to/site/root/" </VirtualHost> NameVirtualHost domain.tld:443 <VirtualHost your_server_ip:443> SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "/path/to/your/file.crt" SSLCertificateKeyFile "/path/to/your/file.key" <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> BrowserMatch ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog "logs/domain.tld-ssl-request_log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" DocumentRoot /path/to/domain/root ServerName domain.tld ServerAdmin [email protected] ScriptAlias /cgi-bin/ "/path/to/domain/cgi-bin/" </VirtualHost> 

在你的httpd.conf中你可能想要包含/检查这个:

 <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin Include /etc/httpd/conf/ssl/*.conf </IfModule> 

在我的情况下,我已经与SSL证书的域名分开的文件,所以我把它们包括在上面的声明。

最后确保你的服务器上安装了OpenSSL包。

就是这样,你可以生成自签名证书来testing它。