Set SSL connection (https) for the MAMP Moodle Package

Apple, Moodle Add comments

moodle_poweredDownload the MAMP Moodle package and follow the installation process.
Note: when I run MAMP, I changed the Apache Port to 80 into MAMP preferences.

Then follow all the steps on this page: http://www.webopius.com/content/355/getting-mamp-working-with-ssl-on-os-x (Note: I didn’t set the optional virtualhost). This will not be enough to make Moodle works straight with https, that’s why I’m writing this post. But you’re almost there :)

In /Application/MAMP/conf/apache/ssl.conf, change the document root (DocumentRoot) for the one you have into /Application/MAMP/conf/apache/httpd.conf

Turn off MAMP if it’s not already done

Go into your apache folder (‘cd /Applications/MAMP/bin/apache2′)

Run your apache 2 server into ssl mode (‘sudo ./apachectl startssl’)

Bingo, it should work.




3 Responses to “Set SSL connection (https) for the MAMP Moodle Package”

  1. Jerome says: |

    Reminder in case the webopius remove their great tutorial:
    1. backup your MAMP conf directory.
    2. openssl genrsa -des3 -out server.key 1024
    3. openssl req -new -key server.key -out server.csr
    Common Name (eg, YOUR name) []:jerome.moodle.local
    A challenge password []:
    4. openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
    5. cp server.key server.tmp
    6. openssl rsa -in server.tmp -out server.key
    7. mkdir /Applications/MAMP/conf/ssl
    8. cp server.crt /Applications/MAMP/conf/ssl
    9. cp server.key /Applications/MAMP/conf/ssl
    10. /Applications/MAMP/conf/apache/ssl.conf:
    comment IfDefine SSL tag to closing tag (but not the content)
    SSLCertificateFile /Applications/MAMP/conf/ssl/server.crt
    SSLCertificateKeyFile /Applications/MAMP/conf/ssl/server.key
    11. /Applications/MAMP/conf/apache/httpd.conf:
    Listen 80
    comment IfDefine SSL tag to closing tag (but not the content)

  2. Hugo says: |

    I’m still having problem using curl with after I followed your guide.

    If I load a PHP script using
    “curl_setopt ( $ch , CURLOPT_URL , “https://members.iodalliance.com/login.php” ) ;”

    I still get the blank page under http://localhost:80/

    Bad Request when using http://localhost:443/

    Not Found when using https://localhost:443

    Someone help me… I have looked up pretty much all the pages on Google and spend over a day trying out everything.

    Thanks.

  3. Jerome says: |

    Hi Hugo,
    If I understood well, you succeeded to install Moodle on MAMP with SSL activated.
    So what you meant is that your cURL code doesn’t work because of this specific MAMP SSL installation? If yes can you assure that your code is working on WAMP or LAMP? If no, then it is not related to this SSL MAMP settings but it is a cURL/SSL related problem.
    Let me know.

Leave a Reply

Theme by NattyWP