Use EhCache a note about the temp directory

Source: Internet
Author: User
Tags tomcat

In general Ehcache configuration, the default Diskstore path is set to Java.io.tmpdir, which is equal to the temporary directory of the current system.

However, on both Tomcat and Resin, the temporary directory is different, the application running on Tomcat is obtained by the JAVA.IO.TMPDIR system variable is the TEMP subdirectory under the Tomcat directory, and Resin returns the System Pro Time directory, Linux may be the/tmp

This problem does not exist under Linux if we use the root account to start Tomcat and Resin. However, we do not recommend the use of root to start Tomcat and Resin, we will create a separate non-privileged account, assuming that the account name is www to run the application server.

We need to authorize the directory where Tomcat and Resin are located to the WWW account so that the application server log files can be written properly, but because the Resin temp directory is the/tmp directory of the corresponding system, if Ehcache is used in the application and the storage path is set to Java. Io.tmpdir, you will find an error when booting, prompted not to create a file in the/tmp directory permissions, this is because the WWW account does not write the TMP directory permissions.

The solution is to modify the value of the Ehcache diskstore configuration to User.home, and specify the storage file path to the user's home directory.

Tomcat does not have this problem because its temp directory is in {tomcat}/temp, and the entire {TOMCAT} has been authorized to the WWW account.


Original: http://www.oschina.net/question/12_2368

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.