Use different user on apache subdirectory

I'm using apache 2.4 and suPHP (to set the user to hwphp) to serve up the files for a domain. However, one subdirectory, cgi-bin, I want to run as a different user (hwphp-cgi) for security reasons (as I'm using the cgi-bin to host scripts that are running system commands and I don't want to allow the normal apache user that same access, as well as have access to /etc/shadow, etc.).

My current conf file:

<VirtualHost>     suPHP_ConfigPath /usr/local/submitty     AddDefaultCharset utf-8     AddExternalAuth pwauth /usr/sbin/pwauth     SetExternalAuthMethod pwauth pipe     ServerAdmin [email protected]     ServerName      DocumentRoot /usr/local/submitty/site/public     DirectoryIndex index.html index.php index.htm index.cgi      ScriptAlias "/cgi-bin/" "/usr/local/submitty/site/cgi-bin/"     SuexecUserGroup hwphp hwphp      <Files .*>         Order allow,deny         Deny from all     </Files>      <Files *~>         Order allow,deny         Deny from all     </Files>      <Files #*>         Order allow,deny         Deny from all     </Files>      <Directory />         AllowOverride None     </Directory>      <Directory /usr/local/submitty/site/public>       Require all granted       Order allow,deny       Allow from all     </Directory>      <Directory "/usr/local/submitty/site/cgi-bin">         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch         AddHandler cgi-script .cgi         Order allow,deny         Allow from all         SSLOptions +StdEnvVars     </Directory>      LogLevel crit     ErrorLog ${APACHE_LOG_DIR}/submitty.log     CustomLog ${APACHE_LOG_DIR}/submitty.log combined </VirtualHost> 

I believe I want to make a new VirtualHost but I can't seem how to do this for a subdirectory (as most examples require a different base URL which I'm hoping to avoid).


Category: apache 2.4 Time: 2016-07-28 Views: 1

Related post

  • Access Network Folder using Different User Credential 2012-07-06

    Domain Controller OS - Window Server 2008 R2 Client OS - Window XP, window 7 Window XP client name - Client1 Window XP Client Name - Client2 I had login as "abc.local\Q2020" on Client1 and accessing other Client2 shared folder via start > run

  • NodeJS and Apache on port 80 using different IP addresses - Apache needs port 80 clear even though it's configured to use port 80 of a different IP 2014-09-09

    I'm using a node.js app on port 80 of server.listen(80, '', function() {... And I want to use Apache on port 80 of another ip address, say, so I have this in my httpd.conf Listen ServerName

  • Puppet run multiple using different users 2014-08-06

    I have a question, Is it possible in puppet to do things as different user, for instance I want to install git, vim, curl as root and install postgresql as vagrant. Is it possible to do? class apt_update { exec { "aptGetUpdate": command => &q

  • Windows 7 Network using different user 2011-04-06

    following problem: I have a windows 7 box and alot of xp boxes. Every xp box supplies a network drive. But my windows 7 box signs in with some user that has not got any privileges. Can I set a default network user in Windows 7? So my 7 box doesn't us

  • Create / Edit files in specific folder using different user / group 2011-12-23

    I want to know if the following scenario is possible. I am a user called www-admin and I am in the group www-admin. I am also a sudoer. I want to have all the files I create in the folder /var/www/domain to have the group domain and the user domain.

  • How to login one remote server to another remote server with different user name using different user private key? 2015-12-12

    I have 2 remote servers X and Y. I am able to login as user A with on remote server X using a private key. From server X to server Y I am also able to login as user A with the same private key. My problem is, servers X and Y server have another user

  • How to run PHP files as another user with Apache and FastCGI? 2011-01-24

    As per older questions, such as using mod_fcgid instead of mod_php and PHP as CGI or Apache Module? (and tangentially some other questions) I came to an understanding that running PHP as CGI or FastCGI would make my .php files be ran as the owner ins

  • "login" to phpMyAdmin via different users 2010-09-27

    I want a non-techie (marketing/sales) to have access to the data I manage regularly via phpMyAdmin: without any ability to alter/insert/delete without me having to build a special database-viewer-app I have created a new User with limited privileges,

  • Apache2 as ReverseProxy Using htaccess; Limit acces to subdirectory with different user than to root folder 2015-07-17

    I have a WebApplication behind a Apache2.2, which is used as a reverse proxy. Now I want to limit access to the root folder of the application and to the subfolder docs. However I need different users to do that, since not everyone who should get acc

  • Allow Apache to run a command as a different user 2010-07-03

    I have a script that executes several commands in a user's home directory. The files are owned by the user and Apache (the www-data group) only has read privileges to them. The script needs to be executed on demand by PHP via exec(), and performs som

  • Run apache as different user for different domains 2011-01-31

    I have a server that is running multiple websites using vhosts, but I want each site to run under a different user/group and wondering if anyone knows how to do this in apache --------------Solutions------------- Use Apache-ITK, peruser or separate i

  • Running Apache as a different user 2011-07-29

    When I run the ps -efH command to list out all the process, I can see Apache running as root and seems to have sub-processes running as www-data. Here's the excerpt: root 30117 1 0 09:10 ? 00:00:00 /usr/sbin/apache2 -k start www-data 30119 30117 0 09

  • Running apache + mod_wsgi as different user 2012-06-11

    I have a django project, which I am moving from the dev-server to apache. I have managed to get it server with mod_wsgi, but it runs as apache. Mod_wsgi documentation says, that if apache is run as root, it is possible to run mod_wsgi process as a di

  • Apache Alias / VirtualHost run as different user 2012-11-15

    I tried to create an alias or virtual host to run as different user. Well below is part of apache httpd.conf that doesn't work. Or, is it even possible? <VirtualHost blah:80> user DifferentUser group DifferentGroup ServerAdmin blah DocumentRoot blah

  • Apache uses wrong user 2015-12-05

    For some reason when I upload to my website, Apache saves the file as user www-data and group www-data, rather than user myusername and group www-data. How do I fix this? --------------Solutions------------- Apache does saves files as www-data, becau

  • How to let users update their Wordpress installs, when you use cpanel to create accounts for users, and apache runs as 'nobody' 2009-09-06

    I'm using cpanel, that runs on red hat linux, which by default runs Apache as a user called nobody. Ubuntu does something similar, but call the user www-data. By default, when you create a new account for the user, all the files belong to the new use

  • Is it possible to use different OpenDNS settings for different users? 2009-09-10

    I've set up my home network to use OpenDNS, but it would be nice if I could apply different settings to different users, or different computers. Is this possible? My router/DHCP server is a Linksys WRT54GL, using the Linksys firmware. The reason I'm

  • How to print in Windows (Vista) using a different user? 2010-06-24

    Is it possible to print as different user in Windows (Vista) without switching user? I don't want to create profile for another user. (I need this because of some printers that are accessible only through LPR.) --------------Solutions------------- As

  • Run Apache server as a different user 2011-08-02

    I have a question about Apache server. The scenario is following: I start Apache server to run a website, which need to log in. A user named Ray log on this website, then the server will run by Ray. (I am also running, maybe this is a sub-process). I

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 1.852 (s). 13 q(s)