Mamp Pro 4 HTTP and HTTPS

对着背影说爱祢 提交于 2019-12-09 13:21:26

问题


Is it not possible in Mamp Pro 4 to have both http and https? The application I am working on requires both depending on the page.

I must be missing something as it makes no sense when I enable SSL only https works and http then stops working.

I tried going through the http.conf, but really have no idea whats causing this.

I think it just generates the vhost for https only and then removes http. Doesn't even look like you can manually edit it.

Any suggestion would be great.


回答1:


Well to update my own post and if anyone else has this problem.

The software is currently not capable of this on the same hostname.

According to Mamp support you have to create two hosts with the same name (e.g. sample.app and sample.app.).

  1. Enable one of the "sample.app" hostnames to use SSL
  2. Enable the second host entry "sample.app" to not use SSL. (Don't forget to hold Alt or Option when clicking on +)
  3. Point both to the same directory.

Mamp will highlight this in red, as its warning that you have two of the same hostnames.

So currently this is the only solution I am aware of for this issue.

Hope they resolve this in future updates as a lot of applications, especially ecommerce rely on the ability to switch between http and https.

You can see this on the Mamp Pro documentation here.




回答2:


I got a simple solution by edit template:

  1. Open Mamp Pro
  2. File > Edit Template > Apache > httpd-ssl.conf
  3. Add these line after

<VirtualHost *:80> ServerName MAMP_SSLVirtualHost_ServerName_MAMP MAMP_SSLVirtualHost_ServerAdmin_MAMP MAMP_SSLVirtualHost_DirectoryIndex_MAMP DocumentRoot MAMP_SSLVirtualHost_DocumentRoot_MAMP </VirtualHost>



来源:https://stackoverflow.com/questions/40077934/mamp-pro-4-http-and-https

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!