[cgiwrap-users] multiple vhosts per user
Brought to you by:
nneul
From: Andreas H. <a.h...@sy...> - 2003-06-26 13:31:18
|
Hello, we have a setup like this: /home/user1/html/domain1.foo; /home/user1/html/domain2.bar ... that is, user1 has registered two domains, there are two (IP-based) vhosts running with /home/user1/html/domain1.foo and /home/user1/html/domain2.bar as DocumentRoot, respectively. I want to automatically execute all CGIs like http://domain1.foo/script1.cgi with a single cgiwrap installation under /usr/lib/cgi-bin, which is ScriptAliased to /cgi-bin/ for all vhosts. However, I can't get cgiwrap to execute the right script. I compiled cgiwrap with --with-cgi-dir=html because I thought that would be the common directory for all CGIs to be executed, with domain1.foo and so on being subdirectories. I added to the configuration of vhost domain1.foo: AddHandler cgi-wrapper .cgi Action cgi-wrapper /cgi-bin/cgiwrapd/user1/domain1.foo Now I get this output: ----- Environment Variables: QUERY_STRING: '' SCRIPT_NAME: '/cgi-bin/cgiwrapd' SCRIPT_FILENAME: '/usr/lib/cgi-bin/cgiwrapd' REDIRECT_URL: '/cgi-bin/cgiwrapd/user1/domain1.foo/akatime.cgi' PATH_INFO: '/user1/domain1.foo/akatime.cgi' PATH_TRANSLATED: '/home/user1/html/domain1.foo/user1/domain1.foo/akatime.cgi' REMOTE_USER: '<NULL>' REMOTE_HOST: '<NULL>' REMOTE_ADDR: '1.2.3.4' Trying to extract user from PATH_INFO. Retrieved User Name: 'user1' User Data Retrieved: UserID: 'test1' UID: '1001' GID: '100' Home Dir: '/home/user1' Checking remote host information. Checking user minimum uid. Checking for required REDIRECT_URL. Checking for CGIWRAP_REQUIRE_USER in environment. Determining virtual host for access control. Access Control Virtual Host: 'domain1.foo' VHost Allow File: '/etc/apache/cgiwrap.allow.d/domain1.foo' VHost Deny File: '/etc/apache/cgiwrap.deny.d/domain1.foo' Checking Access Files: Allow file exists: '/etc/apache/cgiwrap.allow.d/domain1.foo' Checking allow file for 'user1' Found 'user1' Script Base Directory: '/home/user1/html' Fetching script string Trying to extract script from PATH_INFO Extracted PATH_INFO 'domain1.foo/akatime.cgi' Building script path Condensing slashes. Script Relative Path: 'domain1.foo' Script Absolute Path: '/home/user1/html/domain1.foo' Fixing Environment Variables. Environment Variables: QUERY_STRING: '' SCRIPT_NAME: '/cgi-bin/cgiwrapd/user1/domain1.foo' SCRIPT_FILENAME: '/home/user1/html/domain1.foo' REDIRECT_URL: '/cgi-bin/cgiwrapd/user1/domain1.foo/akatime.cgi' PATH_INFO: '/akatime.cgi' PATH_TRANSLATED: '/home/user1/html/domain1.foo/akatime.cgi' REMOTE_USER: '<NULL>' REMOTE_HOST: '<NULL>' REMOTE_ADDR: '1.2.3.4' Logging Request (File) UIDs/GIDs Changed To: RUID: '1001' EUID: '1001' RGID: '100' EGID: '100' Changing current directory to '/home/user1/html' ***************** * CGIWrap Error * ***************** Execution of (domain1.foo) is not permitted for the following reason: Script is not a regular file ----- What's under PATH_TRANSLATED after fixing is the correct absolute path to the script. However, SCRIPT_NAME points to the directory above it, somehow the name of the cig was cut off by cgiwrap. I tried various experiments with different Action-Handlers and the like, but nothing worked. I tried different combinations of compiling with -- with-use-redirect-url and --with-use-script-url, also. Any ideas? I don't know much about mod_rewrite, perhaps this could do the trick. Thanks in advance, A. Heinlein |