Adding SSL-support to Magento

来源:互联网 发布:师洋淘宝店叫什么 编辑:程序博客网 时间:2024/06/05 15:28

Adding SSL-support to Magento

We have got many requests lately about howto add SSL (https)-support in Magento. Here is instructions on how toadd SSL-support to a Magento-installation.

Who needs SSL?
SSL is important for stores who want their customers to be sure everything they enter in the Account-areaand Checkout-area isencrypted along the way from their browser to your server. Stores withpayment-gateways where the customer type in their creditcard-information directly in Magento and is not transferred to a secure page at the creditcard-providers servers will also need SSL.

So what do I need to get started?
First of all, setting up an SSL-certificate can becomplicated depending on your hosting-company’s facilities and it canalso mess up the Magento-store - so make sure you know what you aredoing at any time. We do NOT take any responsibility for the setup,blabla. You know the deal.

So, back to what you need. First of all you of course need a valid SSL-certificate. You also need a dedicated  IP-address on the server you’re running Magento on. And last, you need proper access to the Magento-server (SSH-access).

Step 1: Get the SSL-certificate and install it
There are many companies offering SSL-certificated. Some cost a lot of money (those displaying your company’s name in green text inthe left side of the URL in the browser - which most Online banks use.The cheaper ones, which are just fine for your needs offer a plain,secure certificated. RapidSSL is a company who sell the cheap ones, which works perfectly well.

Installing the certificate is different on most hosting-systems so this you’d need to check with your hosting-provider or give Google a  try.

Step 2: Get your own IP-address
If you’re not very much into servers, Apache and hosting in general I’drecommend you just asked your hosting-provider to give you a dedicatedIP address for your particular site. Tell you are going to use SSL andthey should know what you’re talking about. Most hosting-providerscharge a few extra bucks per month for a dedicated IP address and aslong as they’re not talking about tens of dollars every month it shouldbe fine.

One important thing with the dedicated IPaddress is that it makes thing much easier if you get the IP set up onyour domain before  you install Magento, as you’d most likely need tomove Magento to a new location on the server if you decide to add SSLat a later time.

Step 3: Adding SSL-support in Magento
Ok, this is maybe the easiest part. First you should, depending on yourserver-setup, symlink your “secure” directory to your “public”directory. SSH into your server and - if you are using DirectAdmin - goto the following folder:
./domains/yourdomain.com/

Now type “ls -l” and you should see a list of the folders. Now type the following command:
“ln -s private_html public_html”

This command might need be run as ‘root’ so make sure you have proper access to your box.

Alternative in DirectAdmin:
If you have the proper permissions in DirectAdmin you can go to DomainSetup -> Click your domain, and then enable “Make private_htmlsymbolic link to public_html”. Click on Save and it should be symlinkedautomatically.

Now you must log into Magento Admin -> System -> Settings -> Web and make sure the Secure Base URL is set to https://www.yourstore.com (the Unsecure URL must not be changed to https).

Congratulations! If you’ve doneeverything correct you should now see that you automatically get httpsin the address-bar on both the Account-pages and Checkout-pages.

To see a working site with this functionality, add some Magento-goodies from our site in the cart and proceed to checkout, and buy it