httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Carey <>
Subject [users@httpd] I/O does not work with CGI applications and the AliasMatch directive
Date Thu, 20 Feb 2003 17:22:56 GMT

I added the ExeCGI directive to the default httpd.conf file to all cgi  
Then I used the AliasMatch directive to remove the "~" from the username 
in the URL.
When using the "~" in a URL a cgi application can create files for 
reading and writing.
However if you use AliasMatch the application cannot create files for 
read and write access.

<Directory /home/*/public_html>
      AllowOverride FileInfo AuthConfig Limit
      Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 
      <Limit GET POST OPTIONS>
          Order allow,deny
          Allow from all
      <LimitExcept GET POST OPTIONS>
          Order deny,allow
          Deny from all

file.cgi creates a file in the user directory and prints out html  content.

/* File.c */
     int fd = 0;
     print("Content-Type: text/html\n\n");
     fd = open("/home/user/file", O_RDWR | O_CREAT | O_TRUNC);
     if(fd == -1)
         printf("Could not create file: %d<br>\n",errno);
         printf("strerror says open failed: %s<br>\n",strerror(errno));
         printf("File created<br>\n");
/* end File.c */

In the above case, the output is: File created!

AliasMatch ^/upages/([a-zA-Z0-9]*)/?(.*) /home/$1/public_html/$2

file.cgi does not create a file in the user directory but prints out 
html content.

The error log shows the normal request string with the 200 response code.
Then I added the strerror(errno) to the code to get more information which
returned: Permission Denied.

Is there a way to use AliasMatch and I/O routines in cgi applications?

Thank You!


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message