Three ways to set up Tomcat environment variables under Linux __linux

Source: Internet
Author: User

After you start Veridata under Linux, you can't access the web for long. The guess is that the tomcat environment variables are incorrectly set up under Linux, so modifying the Tomcat environment variables solves the problem.


Note: Java_home is the directory where the JDK is installed; the values of multiple variables are used; The value of the classpath cannot be discarded. Export indicates that the current directory is exported as a global variable, and the case must be strictly differentiated.

1, directly Edit profile file

This method modifies global variables and therefore has permissions for all users who use the Java environment variables under the shell, but may pose a security problem to the system. The operation is as follows:

[Root@ora-rac2 ~]# Vi/etc/profile

Export java_home=/cdr/jdk1.7.0_51
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar: $CLASSPATH
Export Catalina_home=/u01/ggs/veridata/web
Export Catalina_base=/u01/ggs/veridata/web

After saving, exit

[Root@ora-rac2 ~]# Source/etc/profile

Closes the currently connected session to take effect.


2, modify the. bash_profile file

The method will be to modify the user environment variables, so the permission to use environment variables is controlled at the user level, that is, the environment variables that are set after using SU to different users are valid only for the current user, so this method is more secure. The operation is as follows:

[Root@centos-1 ~]# Su-oracle
[Oracle@centos-1 ~]$ pwd
/home/oracle
[Oracle@centos-1 ~]$ Vi. Bash_profile

Export Catalina_home=/u01/ggs/veridata/web
Export Catalina_base=/u01/ggs/veridata/web

After the save, exit, you can take effect.

3, directly in the shell terminal to execute the command to set the variable

This method is only temporary, that is, if the shell is changed, the value of the variable currently set does not take effect, so it is not supported. The operation is as follows:

[Root@ora-rac2 ~]# Export CATALINA_HOME=/U01/GGS/VERIDATA/WEB1
[Root@ora-rac2 ~]# Export CATALINA_BASE=/U01/GGS/VERIDATA/WEB1
[Root@ora-rac2 ~]#
[Root@ora-rac2 ~]# Echo $CATALINA _home
/u01/ggs/veridata/web1
[Root@ora-rac2 ~]# Echo $CATALINA _base
/u01/ggs/veridata/web1
[Root@ora-rac2 ~]#



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.