Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9156785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:51:14+00:00 2026-06-17T12:51:14+00:00

I have a couple of Java applications running in TomCat containers behind Apache Httpd.

  • 0

I have a couple of Java applications running in TomCat containers behind Apache Httpd. In Apache Httdp you can set Env variables with SetEnv FOO bar, if you have mod_env installed. How can I read those variables in my Java applications running inside TomCat?
The Java applications are mostly build with Stripes, if that helps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:51:15+00:00Added an answer on June 17, 2026 at 12:51 pm

    Because Tomcat is started outside of Apache it does not have access to the Apache environment. This means you need some way of passing environment variables from Apache to Tomcat.

    If you are connecting Apache and Tomcat using mod_jk, you can use the JkEnvVar directive to pass specific variables to Tomcat. From the mod_jk documentation:

    The directive JkEnvVar allows you to forward environment variables from Apache server to Tomcat engine. You can add a default value as a second parameter to the directive. If the default value is not given explicitly, the variable will only be send, if it is set during runtime.
    The variables can be retrieved on the Tomcat side as request attributes via request.getAttribute(attributeName). Note that the variables send via JkEnvVar will not be listed in request.getAttributeNames().

    If you are using the HTTP proxy (mod_proxy) instead of mod_jk, you can pass environment variables as request headers using mod_headers, something like:

    RequestHeader set X-MYVAR %{MYVAR}e
    

    …and then in Tomcat you would have to extract the X-MYVAR header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a couple of applications running on Java 5 and would like now
I have a couple of java modules set up in IDEA and I am
Say I have a couple of java runtime environments running on my system which
I have a java application. It can be started with couple of command line
We have a couple of Java Web applications that serve different purposes (one for
I have a couple of Java applications that utilise Quartz 1.6.6 upon Weblogic with
I have a java web application that I'm running with tomcat. This application has
I have created a couple of java working sets for a project in my
I have a couple of questions relating to nested classes within Java. How do
I have passed the last couple of hours trying to downgrade Java to 1.6.0_13

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.