Abadis
Abadis

Reputation: 2841

Magento SSL in Localhost

I am using Magento for my online store.Yesterday I changed its SSL settings from

Magento Admin area -> System -> Configuration -> Web

and now I can not access the admin area.It gives me error 404.How can I change SSL setting without having access to admin area ? thanks in advance

Upvotes: 0

Views: 4003

Answers (2)

Senthilnathan Gopal
Senthilnathan Gopal

Reputation: 31

Please follow these steps(Make sure you are running it in admin user or sudo):

Ref: https://www.youtube.com/watch?v=AAVAGb3QhSc

Step 1: Creating your certificate signing request (CSR) with OpenSSL - cat /etc/*release, I have Ubuntu 16.04 on my localhost. - apache2 -v, I installed apache 2.4.18 on my localhost

  • Run the following command lines:

    1. Enable the ssl module on Apache2: a2enmod ssl
    2. Restart the Apache2: service apache2 restart
    3. Create the folder named ssl for saving the pravite key file and certificate signing request file: mkdir /etc/apache2/ssl
    4. Generate the files: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/openssl.key -out /etc/apache2/ssl/openssl.crt

    Enter the following information: Country Name (2 letter code) [AU]: US State or Province Name (full name) [Some-State]: New York Locality Name (eg, city) []: New York City Organization Name (eg, company) [Internet Widgits Pty Ltd]: Your Company Organizational Unit Name (eg, section) []: Department of Kittens Common Name (e.g. server FQDN or YOUR name) []: localhost Email Address []: [email protected]

Step 2: Configuring Your SSL Certificate - Edit the file named default-ssl.conf in the path /etc/apache2/sites-available/ Replace the text "/etc/ssl/certs/ssl-cert-snakeoil.pem" with the "/etc/apache2/ssl/openssl.crt" Replace the text "/etc/ssl/private/ssl-cert-snakeoil.key" with the "/etc/apache2/ssl/openssl.key" - Enable the default-ssl.conf: a2ensite default-ssl.conf - Test your Apache2 configuration file before restarting: apachectl configtest - Restart apache2: service apache2 restart

Step 3: Configuring the SSL Certificate for your website. - Create the file named localhost-ssl.conf in the path /etc/apache2/sites-available/ - Test your Apache2 configuration file before restarting: apachectl configtest - Restart apache2: service apache2 restart

Then follow, Omid Kosari steps to enable https in magento DB

  1. Open your core_config_data table in phpMyAdmin.

  2. Find the row with the path web/secure/use_in_adminhtml and change its value field from 1 to 0 to enable accessing admin panel from unsecure http://www.yourwebsite.com/admin url

  3. Changing web/secure/use_in_frontend toggles customer shopping cart security, 1=on and 0=off which probably isn't of importance as you're trying to regain administrative access

  4. Clear /var/cache, /var/session and after you've done the above and regained access your system, reindex your URL_rewrite index after changing settings. This is necessary because your config is cached and clearing it forces a reread of the configuration data from the core_config_data table.

Upvotes: 3

Omid Kosari
Omid Kosari

Reputation: 287

  1. Open your core_config_data table in phpMyAdmin.

  2. Find the row with the path web/secure/use_in_adminhtml and change its value field from 1 to 0 to enable accessing admin panel from unsecure http://www.yourwebsite.com/admin url

    Changing web/secure/use_in_frontend toggles customer shopping cart security, 1=on and 0=off which probably isn't of importance as you're trying to regain administrative access

  3. Clear /var/cache, /var/session and after you've done the above and regained access your system, reindex your URL_rewrite index after changing settings. This is necessary because your config is cached and clearing it forces a reread of the configuration data from the core_config_data table.

Upvotes: 4

Related Questions