setenv

Java: load a library that depends on other libs

一世执手 提交于 2019-12-18 13:39:21
问题 I want to load my own native libraries in my java application. Those native libraries depend upon third-party libraries (which may or may not be present when my application is installed on the client computer). Inside my java application, I ask the user to specify the location of dependent libs. Once I have this information, I am using it to update the "LD_LIBRARY_PATH" environment variable using JNI code. The following is the code snippet that I am using to change the "LD_LIBRARY_PATH"

How to find Windows SDK's SetEnv.cmd / SetEnv.cmd Does not work correctly

走远了吗. 提交于 2019-12-17 16:47:11
问题 We have a Team City Build Server running and want to compile a Visual C++ project. So far this would be easy, since I've setup our Windows Build Agent with the Windows SDK, but we don't have a solution / project file. The project files are instead created with CMake. CMake seems to be a little bit dumb (can't generate Solution when Visual Studio is not installed), but with some tricks, I could get it to do it. The solution can then be built with MSBuild. And here comes the problem. For this

Installin Tomcat on Windows 7

北城以北 提交于 2019-12-13 03:06:20
问题 I am looking to install Tomcat. So, I unzipped the file, set CATALINA_HOME to the path name I see on the command line ( c:\Users\myName\apache-tomcat-7.0.40 on my machine) and my setenv.bat looks like as follows: set "JRE_HOME=C:\Program Files\Java\jre6\bin;" set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07\bin;" exit /b 0 I also tried set "JRE_HOME=C:\Program Files\Java\jre6;" set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07;" exit /b 0 and just set "JRE_HOME=C:\Program Files\Java\jre6;"

How do you use SetEnv to read variables in Apache?

徘徊边缘 提交于 2019-12-12 20:42:44
问题 I want to set an env variable that has the DOC_ROOT info but nothing SetEnv PROJECT_BASE %{ENV:DOC_ROOT} SetEnv LAYOUT_HOME %{ENV:PROJECT_BASE}"/html/app/wordpress/" and then be able to access LAYOUT_HOME in php How can I do this? 回答1: Variables are accesible via : $_SERVER["LAYOUT_HOME"] and $_SERVER["PROJECT_BASE"] global variable. A simple test if to execute the next command in php <?php phpinfo(); ?> and check if the variable is present and is defined. If not, then may be exist some

Password protect a cname subdomain with .htaccess?

試著忘記壹切 提交于 2019-12-11 10:26:55
问题 I'm trying to build and test a "m." subdomain for a website I'm working on. "m.domain.com" is simply a cname for "domain.com" and will be used to set a server-side boolean so the mobile version of the site will serve exactly the same pages, just with different css and scripts. While I'm testing, I want to require a password for all requests made to m.domain.com. I've tried several .htaccess variants on environment variable solutions, and this is what I have right now: SetEnvIfNoCase Host m\

Why isn't my wrapper around setenv() working?

六眼飞鱼酱① 提交于 2019-12-10 20:14:54
问题 I have the method below, and it correctly sets the ret value to 0 (indicating success in setenv), but when I check to see if this environment variable is actually set, it's absent. Why would this be happening? void Class::mysetenv(char* a, char* b) { if(a==0 || b==0) return; int ret = setenv(strdup(a), strdup(b), 1); printf("ret: %d %s %s\n", ret, a, b); } 回答1: Your function leaks. The manpage of setenv says: This function makes copies of the strings pointed to by name and value So you don't

Allow from env with mod_rewrite not mod_setenvif in .htaccess

假装没事ソ 提交于 2019-12-10 19:39:37
问题 I am trying to control access to testing sites/hosts but not the production site using .htaccess and Apache 2.2. I am using mod_rewrite to detect the host name and set some environment variables used to control various aspects of the site but can not leverage this for controlling access. I can only control access with mod_setenvif. I can detect the host and set environment variables. (Simplified.) RewriteCond %{HTTP_HOST} test\..* RewriteRule ^ - [ENV=requireAuth:1,ENV=...] I then later try

Apache SetEnvIf trouble

北战南征 提交于 2019-12-10 17:07:01
问题 I have the following in my .htaccess file: SetEnvIf Host "^example\.com$" myvar=1 <IfDefine myvar> RewriteRule ^(.*)$ index2.php?q=$1 [L,QSA] </IfDefine> As far as I can tell, this should be working properly. However, "myvar" does not appear to get defined when I visit from example.com . I know that I have the mod_setenvif.c enabled (I've verified with an <IfModule> block). Any ideas why "myvar" isn't getting defined? 回答1: This is really a ServerFault question, but anyway: IfDefine doesn't

How to do conditional .htaccess password protect

一曲冷凌霜 提交于 2019-12-10 14:27:05
问题 I'm trying to password protect a specific url using a .htaccess. Different urls point to the same files but have different workings. I now need to password protect only one url. I'm trying to do this using setenvif but it doesn't seem to work. I might not fully understand the purpose or use of the apache setenv module. This is my code what doesn't seem to work SetEnvIfNoCase Host "topasswordprotect\.domain\.com$" protecturl <IfDefine protecturl> Require valid-user AuthName "Please enter your

Why change in LD_LIBRARY_PATH at Runtime dosen't Reflect on the Executable once the Executable gets loaded

泪湿孤枕 提交于 2019-12-10 13:06:19
问题 I'm trying to change the LD_LIBRARY_PATH from my C++ program. I'm able to get its value using getenv("LD_LIBRARY_PATH") and set its value using setenv() (and I know that this is working, because when I call getenv("LD_LIBRARY_PATH") again, I get the updated value), but changing its value from inside the program isn't having any effect on it: I still get this error-message: Failed to Load the shared library file If I set the value before the executable gets loaded or the application is started