cancel
Showing results for 
Search instead for 
Did you mean: 

Hosts Specific Variables

Former Member
0 Kudos

I have created virtual hosts with the J2ee SAP Administrator.  I want to have environment variables at that virtual host level and not across the whole server.

My ultimate goal is to have a development and testing environment on the same server.  

http://dev-url/  (root directory /sap/apps/dev)

http://tst-url/  (root directory /sap/apps/tst)

Both of these virtual hosts will be using the same naming for the JDBC Connection and other server specific variables, but when in the dev-url I want it to point to my development resources and similarly for my testing environment.

I understand that I can do this at the application level, but I need it at the host level.

With tomcat, I can create a at the root level for each virtual host.  I have not been able to do this with the SAP product.

Any Suggestions?

Nathan Zentner

Accepted Solutions (0)

Answers (1)

Answers (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Nathan,

I think I have to better understand what you want here before answering:

"in the dev-url I want it to point to my development resources and similarly for my testing environment"

What do you mean here with resources? Is it just your application?

In WebAS the virtual host is behind the HTTP service, while the apps run under the Web Container (in 6.20 the names are different but principle is the same). This will prevent us to use an app with the same name a second time.

Regards,

Benny

Former Member
0 Kudos

Benny,

Not having the ability to associate apps to a specific virtual host is the problem.  Yes I do want to have the same

Two hosts, two context with same name, host specific resources, one server.

Hope this explains it enough.

Thanks,

Nathan Zentner

Former Member
0 Kudos

Hi Nathan,

I think it is possible to do that with the J2EE Engine, though I doubt it is quite user friendly.

You can configure both environments on a single host, just defining two different HTTP aliases. However, here is the procedure:

1. create a new virtual host (do not risk to spoil the default one )

2. deploy your application as a "default" one. "Default" means that its context root must be a slash (/). This is necessary, because you can use http aliases with default application's resources.

3. define two different HTTP aliases (using the Vusial Administrator tool). The path associated with it must point to directories that are located under the root directory of the above-mentioned application.

4. Replicate the content of the application to the new directories (simply copy&paste files and directories). Here you'd have to do some manual changes (for example, adjust URLs if you use any to reflect the new directory structures, etc.)

5. Call your apps by http://host:port/alias1/resource

I've tried that with a simple application - worked OK. Hope that works for you too.

And, if you'd allow me an advice - why don't you think of an alternative using the Java development tools provided by SAP? I think the above approach is kind of awkward

Best regards,

Ivo.

Former Member
0 Kudos

Ivo,

Yes this does sound fairly awkward.  Not something that I would want to do on a regular basis, for moving application from development to test then to production.

As an alternative, I could build an object That looks within the virtual hosts directory for an xml file to load the environment specific variables.  I would want it to start when the server does, reachable using naming and reloadable without restarting the server.

I was thinking of a servlet, that would start at server startup and was callable at a url to refresh.

Your thoughts?

Nathan.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Nathan,

in the full blown system there will be complete Change Management system that does all of this for you. This is included in the Java Development Infrastructure we currently work on. It will be part of 6.40 and delivers much more then just the management of different deployment targets.

There are a couple of describing articles on SDN.

keywords for you are : Design Time Repository (DTR), Component Build Service (CBS), Change Management System (CMS).

Regards,

Benny