开发者

Tomcat with sub folder symlink

开发者 https://www.devze.com 2023-02-07 07:44 出处:网络
I have a webapp that is actually a symlink named: App-0.0.1-SNAPSHOT and it is working fine. Now instead of that, i want to create the folder App-0.0.1-SNAPSHOT and use the symlinks in the subdirect

I have a webapp that is actually a symlink named: App-0.0.1-SNAPSHOT and it is working fine.

Now instead of that, i want to create the folder App-0.0.1-SNAPSHOT and use the symlinks in the subdirectories.

I want the WEB-INF to link to one place.

And i want the Client files (/js and /css) to link to another place.

In this case i am getting 404.

This article is actually doing the same, but for some reasong i cant get it done....

Again, linking to the webapp root folder works fine.

Can you suggest a solut开发者_运维百科ion?

thanks


I found that using the command sudo mount --bind olddir newdir gets me out of trouble. If you don't have root access then this won't work for you. See mount --help or man mount for some more info on binding but it basically mounts one directory on top of another so it has the same affect as a symlink but it gets around tomcat's limitation with symlinks.

In your example, you'd probably want something like sudo mount --bind /path/to/your/sandbox/js /var/lib/tomcat7/webapps/App-0.0.1-SNAPSHOT/js and then similar for the css directory.


For security reasons, by default Tomcat does not follow symlinks. You may be able to configure it to do so -- see this article.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号