• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Gokul Deepak

Gokul Deepak

GoCool and Debug

  • Home
  • WordPress
  • Android
  • How to
  • About Me

DevOps

Important Docker Commands to remember

November 12, 2022 by Gokul Deepak S Leave a Comment

You need not memorize these important docker commands. Repeated usage will make it easy for you to remember.

Important Docker Commands

  1. docker ps
  2. docker pull
  3. docker run
  4. docker stop
  5. docker restart
  6. docker exec
  7. docker search
  8. docker rename
  9. docker pause
  10. docker unpause
  11. docker kill
  12. docker login
  13. docker commit
  14. docker rmi
  15. docker cp
  16. docker logs
  17. docker info
  18. docker logout
  19. docker inspect
  20. docker history
  21. docker push

Filed Under: Docker

CORS error in Apache Tomcat – Solved

June 23, 2021 by Gokul Deepak S Leave a Comment

Error: Access to XMLHttpRequest at ‘http://10.12.13.39:8080/content/fetchAllcontent/1/Books/Philosophy’ from origin ‘http://localhost’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Solution: Add the below code in /opt/tomcat/conf/web.xml you can replace * in cors.allowed.origins with the domain you want eg: gokuldeepak.com

<filter>
    <filter-name>CorsFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
    <init-param>
        <param-name>cors.allowed.origins</param-name>
        <param-value>*</param-value>
    </init-param>
    <init-param>
        <param-name>cors.allowed.methods</param-name>
        <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
    </init-param>
    <init-param>
        <param-name>cors.allowed.headers</param-name>
        <param-value>Content-Type,X-Requested-With,Accept,Authorization,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
    </init-param>
    <init-param>
        <param-name>cors.exposed.headers</param-name>
        <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern> /* </url-pattern>
</filter-mapping>

Filed Under: DevOps Tagged With: Tomcat

Primary Sidebar

Popular Pages

  • Home
  • Important Docker Commands to remember
  • How to find the date of the Facebook group it was created
  • How to add ads.txt for Adsense - Simply Explained
  • Can't connect to Ubuntu with SSH
  • Combine two separate files line by line in Notepad++
  • AWS Instance Types
  • How to remove Linux OS in Tamilnadu Government Free Laptop
  • How to add ads.txt on Bluehost
  • Elementor Plugin and Nginx Configuration

Archives

Categories

  • Android
  • Apache
  • AWS
  • Blogger
  • Computer Tips
  • DevOps
  • Docker
  • Earn
  • Facebook Tips
  • Git
  • Google Tips
  • Hosting
  • How to
  • Laptop Tips
  • Laptops
  • Linux
  • Mobile
  • MongoDB
  • Nginx
  • Node JS
  • Notepad++
  • PostgresQL
  • Ubuntu
  • Wordpress
  • Xenforo

Tags

Android Android One AWS Bluehost Comparisions Custom ROM Elementor Facebook Genesis Genesis Sample Theme Google Drive How to Lineage OS Notes OnePlus One OwnCloud Rooting Smartphones Stock ROM Studiopress Tomcat Wordpress plugin

Copyright © 2023 ยท Maintained by GokulDeepak