Showing posts with label Configuration. Show all posts
Showing posts with label Configuration. Show all posts

Tuesday 12 December 2017

How to Enable SSL certificate in cloud.google.com

How to Enable SSL certificate in cloud.google.com


Open cloud.google.com
1. Goto your VM instance
2. Click on name of your instance
3. Edit instance
4. Checked "Firewalls Allow HTTPS traffic" and save


5. Goto Network services -> Load balancing -> Edit / add your Load balancer
6. Add / Edit "https protocol" on Frontend configuration and select / create new certificate




7. Again goto your VM instance list
8. Click on SSH



9. After open google cloud ssh window, write "sudo su" on ssh window
10. ssh-keygen
11. gcloud compute ssl-certificates list
12. gcloud compute ssl-certificates describe ssl2111(name of your ssl certificate)
13. nano /etc/apache2/sites-available/default-ssl.conf
Upload certificate files and update path here where you place your SSLCertificateFiles
<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        <Directory /var/www/html/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>
    DocumentRoot /var/www/html

    ..........
    ..........
    ..........
    ..........
    #SSLCertificateFile     /etc/ssl/certs/ssl-cert-snakeoil.pem
    #SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    SSLCertificateFile "/var/www/html/cert/cert.pem"
    SSLCertificateKeyFile "/var/www/html/cert/privkey.key"
    SSLCertificateChainFile "/var/www/html/cert/chain.crt"
    ..........
    ..........
    ..........
    ..........
</VirtualHost>
</IfModule>

14. sudo service apache2 restart
15. gcloud auth login
16. gcloud config set project projectname-010412(Your project id)
17. sudo a2ensite default-ssl
18. service apache2 reload
19. sudo a2enmod ssl
20. sudo service apache2 restart
21. gcloud compute firewall-rules create www-firewall     --target-tags https-tag --allow tcp:443
22. service apache2 reload 

That's It, Please check your SSL 

Tuesday 26 April 2016

Create dropdown/select box in magento system.xml for payment/shipping configuration

Create drop down in system.xml and show custom values in it, rather than using default magento classes only

Directory : app/code/local/Companyname/Modulename/config/system.xml

In system.xml

<config>
  <sections>
<payment>
  <groups>
<Modulename translate="label" module="Modulename">
<label>Payment Module</label>
       <sort_order>670</sort_order>
       <show_in_default>1</show_in_default>
       <show_in_website>1</show_in_website>
       <show_in_store>0</show_in_store>
<fields>
<paymentmethod translate="label comment">
   <label>Payment method</label>
   <comment>Omni Payment method.</comment>
   <frontend_type>select</frontend_type>
   <source_model>Modulename/Modelname</source_model>
   <sort_order>30</sort_order>
   <show_in_default>1</show_in_default>
   <show_in_website>0</show_in_website>
   <show_in_store>0</show_in_store>
</paymentmethod>
</fields>
</Modulename>
            </groups>
        </payment>
    </sections>
</config>

If you want to create your custom source_Model, you need to do the following steps: Create a Pmethod.php in app/code/local/Companyname/Modulename/Model/Pmethod.php Companyname_Modulename is our module name. You need to create a function name toOptionArray() as mention below, the value and label can be anything you want to be display in dropdown

In Pmethod.php 

class Companyname_Modulename_Model_Pmethod
{
    public function toOptionArray()
    {
        return array(
            array(
                'value' => 'key1',
                'label' => 'Label 1',
            ),
            array(
                'value' => 'key2',
                'label' => 'label 2',
            )
        );
    }
}