Tag: 2020

  • Getting an A+ SSL Rating on Nginx Apache Server

    Saturday 8 August 15:18

    Getting A+ SSL Rating on Apache

    Getting an A+ SSL Rating on Lightsail is just a 5-minute task,

    It’s only turning off old versions of SSL from your configuration file.

    Getting a free SSL is well documented by the lightsail team here, in a 9 Step Tutorial, if you have not got an SSL please get one,

    SSL improves your SEO, maintains trust for the visitor and is a must for any website in 2020.

    After reading this post from Qualys, searching some more articles

    I could make out that getting A+ SSL rating and not allowing the previous versions of SSL on a website or a blog is both good for your SEO Strategy and Security part.

    So, here it is Get your site checked here on the Qualys Tool For SSL it’s Free!

    Here is a screenshot of a test when I just started this blog and was continuously improving on its security, SEO, and everything I could do for achieving a simple, secure and a pro website.

    SSL B Grade

    Getting the same as an A+ was just a 5 minutes task, from start to finish on a lightsail hosted website, using apache server, with bitnami image of wordpress.

    Here’s how I got this from B to A+

    Getting A+ Rating on SSL on a lightsail hosted website

    Just head over to your SSH Window and start with :

    sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf

    Soon you are into editing the bitnami.conf file, so we have to just turn off the old versions of SSL

    Find this line with “CTRL+W”, or whatever that line reads near SSL Protocol

    SSLProtocol all -SSLv2 -SSLv3

    Change the same to

    SSLProtocol TLSv1.2

    CTRL+O to write out and CTRL+X to Exit

    Restart the Apache

    sudo /opt/bitnami/ctlscript.sh restart

    Getting A+ SSL Rating Nginx Server


    sudo nano /etc/nginx/nginx.conf

    Change the lines that start with #SSL Settings to Exactly the code below this would also add the session timeout and Strict Security Header :

        ##
    
        ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        ##

    Once done just restart your server with :

    sudo service nginx reload && sudo service nginx restart

    This gives A+ SSL Rating.

    SSL is a must if you use AMP on your WordPress Blog. , Also here’s a collection of some website testing tools that I keep on updating.

    HSTS Preload on NGINX Server

    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

    This gives you a HSTS Header on your site, if you use Nginx Server, Enrolling to HSTS list is good for your sites security, this enables browsers to understand that your site is only served on a secured connection.

    You can enrol here for HSTS, First, you need to test on the same link then Enroll the domain.

    HSTS Preload on APACHE Server

    Mod Headers Looks Like :

    First, enable mod headers in your httpd.conf file,

    you can find in the /etc/apache2/httpd.conf :

    LoadModule headers_module modules/mod_headers.so
    

    then simply add the below line in your virtual host’s file.

    <VirtualHost *:443>
    ...
    Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
    ...
    </VirtualHost>
  • Amp Native AMP First Standard Mode On WordPress

    Accelerated Mobile Pages (AMP) have revolutionized the way websites load on mobile devices, offering lightning-fast performance and improved user experiences. For WordPress users, implementing AMP can be a game-changer, especially with plugins like AMP Native and AMP First Standard Mode. However, setting up and validating AMP on WordPress can sometimes be tricky. In this guide, we’ll explore how to use AMP Native and AMP First Standard Mode, validate your setup, and weigh the pros and cons of this approach.


    What is AMP Native & AMP First Standard Mode?

    • AMP Native: A WordPress plugin that enables AMP functionality without requiring a separate AMP version of your site. It integrates AMP directly into your existing theme.
    • AMP First Standard Mode: A configuration where your entire site is served as AMP pages, ensuring a consistent and fast experience across all devices.

    Why Use AMP Native & AMP First Standard Mode?

    1. Improved Performance: AMP pages load instantly, reducing bounce rates and improving user engagement.
    2. SEO Benefits: Google prioritizes AMP pages in search results, especially for mobile users.
    3. Simplified Setup: AMP Native eliminates the need for separate AMP templates, making it easier to implement.
    4. Consistency: AMP First Standard Mode ensures your entire site adheres to AMP guidelines.

    Step-by-Step Guide to Implement AMP Native & AMP First Standard Mode

    Follow these steps to set up and validate AMP Native and AMP First Standard Mode on your WordPress site:


    Step 1: Install the AMP Plugin

    1. Go to your WordPress dashboard.
    2. Navigate to Plugins > Add New.
    3. Search for AMP and install the official AMP plugin by WordPress.org.
    4. Activate the plugin.

    Step 2: Configure AMP Native

    1. Go to AMP > Settings in your WordPress dashboard.
    2. Under the Template Mode, select Native.
    • This ensures your existing theme is used for AMP pages.
    1. Save the changes.

    Step 3: Enable AMP First Standard Mode

    1. In the AMP > Settings section, enable AMP First Standard Mode.
    • This ensures your entire site is served as AMP pages.
    1. Save the changes.

    Step 4: Validate Your AMP Setup

    1. Use the AMP Validator to check if your pages comply with AMP standards.
    • Visit your site and append /amp/ to any URL (e.g., https://yoursite.com/sample-post/amp/).
    • Use the AMP Validator to test the page.
    1. Fix any validation errors:
    • Common issues include invalid CSS, missing AMP components, or unsupported tags.
    • Use the AMP Compatibility Tool in the plugin to identify and resolve issues.

    Step 5: Customize AMP Appearance

    1. Go to AMP > Design in your WordPress dashboard.
    2. Customize the appearance of your AMP pages:
    • Change colors, fonts, and layouts to match your brand.
    1. Save the changes.

    Pros and Cons of AMP Native & AMP First Standard Mode

    Pros

    1. Improved Performance: AMP pages load faster, enhancing user experience.
    2. SEO Advantages: AMP pages are prioritized in Google search results.
    3. Simplified Setup: No need for separate AMP templates or themes.
    4. Consistency: AMP First Standard Mode ensures all pages adhere to AMP guidelines.

    Cons

    1. Limited Customization: AMP restricts certain HTML, CSS, and JavaScript elements.
    2. Plugin Dependency: You rely on the AMP plugin for functionality.
    3. Validation Challenges: Some themes or plugins may not be fully AMP-compatible.
    4. Learning Curve: Beginners may find it challenging to troubleshoot validation errors.

    Troubleshooting Common Issues

    1. Validation Errors:
    • Use the AMP Compatibility Tool to identify issues.
    • Replace unsupported elements with AMP-compatible alternatives.
    1. Styling Issues:
    • Ensure your CSS adheres to AMP guidelines (e.g., inline styles only).
    • Use the AMP Design settings to customize your pages.
    1. Plugin Conflicts:
    • Disable plugins one by one to identify conflicts.
    • Use AMP-compatible plugins whenever possible.

    Best Practices for AMP on WordPress

    1. Test Thoroughly: Validate all pages and posts to ensure AMP compliance.
    2. Optimize Images: Use AMP-compatible image formats like WebP.
    3. Monitor Performance: Use tools like Google PageSpeed Insights to track improvements.
    4. Stay Updated: Regularly update the AMP plugin and your theme for compatibility.

    Conclusion

    Implementing AMP Native and AMP First Standard Mode on WordPress can significantly improve your site’s performance and SEO. While there are some challenges, the benefits of faster load times and better mobile experiences make it worth the effort. By following this guide, you can set up, validate, and optimize AMP for your WordPress site with confidence.

    Have you tried AMP Native or AMP First Standard Mode? Share your experience or ask questions in the comments below!