suexec execute /home directory with mod_user_dir apache.

Discussion in 'Installation/Configuration' started by vanhels, Mar 8, 2017.

  1. vanhels

    vanhels New Member

    hi @till The suexec problem path can be solved using the mod_userdir apache module, in this case suexec will spawn scripts from owner of /home/user/public_html in this example "user" so you don't need to define SuexecUserGroup in apache config:

    Mod_User_Config: [userdir.conf]

    <Directory "/home/*/public_html" >
    AllowOverride All
    Options +ExecCGI
    AddHandler cgi-script .cgi .pl .py .rb

    Page Oficial Apache Documentacion:

    ScriptAlias directories for security reasons. In this way, administrators can tightly control who is allowed to use CGI programs. However, if the proper security precautions are taken, there is no reason why CGI programs cannot be run from arbitrary directories. For example, you may wish to let users have web content in their home directories with the UserDir directive. If they want to have their own CGI programs, but don't have access to the main cgi-bin directory, they will need to be able to run CGI programs elsewhere.

    There are two steps to allowing CGI execution in an arbitrary directory. First, the cgi-script handler must be activated using the AddHandler or SetHandler directive. Second,ExecCGI must be specified in the Options directive.

    Options directive, inside your main server configuration file, to specify that CGI execution was permitted in a particular directory:

    <Directory "/usr/local/apache2/htdocs/somedir">

    The above directive tells Apache to permit the execution of CGI files. You will also need to tell the server what files are CGI files. The following AddHandler directive tells the server to treat all files with the cgi or pl extension as CGI programs:

    AddHandler cgi-script .cgi .pl

    Then there should be no problem changing the directories,


Share This Page