On IBM i servers, the location of the LANSA system is determined by the HTTP Servers job's library list. The JSMDRTEXT exit program can be used to modify the library list at execution time. The exit program JSMLASEXT can be used to modify how LANSA is executed.
The CGI jobs' library list can also be set using the QIBM_CGI_LIBRARY_LIST variable. The QIBM_CGI_LIBRARY_LIST variable is set using the SetEnv directive.
Refer to Module mod_env on the IBM i Knowledge Center.