Open klren0312 opened 2 weeks ago
podman exec -it 镜像id /bin/bash
chmod 777 /tmp && apt-get update && apt install vim -y
vim /usr/local/tomcat/webapps/geoserver/WEB-INF/web.xml
直接到文件中粘贴
<filter> <filter-name>cross-origin</filter-name> <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>chainPreflight</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param-name> <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>allowedHeaders</param-name> <param-value>*</param-value> </init-param> </filter> <filter-mapping> <filter-name>cross-origin</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
https://github.com/geoserver/geoserver/blob/2.25.4/src/pom.xml
https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-servlets/9.4.55.v20240627 https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util/9.4.55.v20240627
右键获取链接,到镜像中wget下载即可
cd /usr/local/tomcat/webapps/geoserver/WEB-INF/lib wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlets/9.4.55.v20240627/jetty-servlets-9.4.55.v20240627.jar wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util/9.4.55.v20240627/jetty-util-9.4.55.v20240627.jar
podman restart 7f8b0dedd3d3
1. 进入镜像终端
2. 安装vim
3. 编辑tomcat配置文件
直接到文件中粘贴
4. 下载指定jetty版本
a. 访问对应geoserver版本的pom文件,查看jetty版本,我这里是2.25.4
https://github.com/geoserver/geoserver/blob/2.25.4/src/pom.xml
b. 下载指定jetty的jar包
https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-servlets/9.4.55.v20240627 https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util/9.4.55.v20240627
右键获取链接,到镜像中wget下载即可
5. 重启镜像