Use AssignUserId as variable in Apache MPM ITK

78

Solution 1

From Apache 2.4 on, mpm-itk has the AssignUserIDExpr and AssignGroupIDExpr directives, which allows an Apache expression to be used in dynamically defining a user and group. In combination with mod-rewrite it will probably do what you want.

http://mpm-itk.sesse.net/

Solution 2

You can use mod_macro.

Define one VirtualHost macro an use it with Use

<Macro Hosting $who>

    <Directory "/home/$who">
        allow from all
        Options +FollowSymLinks
    </Directory>

    <VirtualHost *:80>
        ServerName $who.domain.com
        AssignUserId $who $who
    </VirtualHost>
</Macro>

Use Hosting me
Use Hosting you
Share:
78

Related videos on Youtube

Magudesh
Author by

Magudesh

Updated on September 18, 2022

Comments

  • Magudesh
    Magudesh almost 2 years

    I am using eclipse to deploy java RESTful web project in amazon elastic beanstalk and it is successfully deployed. Snapshot of my Beanstalk dashboard is:

    here.

    When I try to access the http://event-api.us-west-2.elasticbeanstalk.com/ URL, it shows 404 error. Why am I getting this 404 error?

    I did not change web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>EventMngmtApi</display-name>
      <servlet>
        <servlet-name>Jersey REST Service</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    
         <init-param>
          <param-name>com.sun.jersey.config.property.packages</param-name>
          <param-value>com.vasithwam.users,com.vasithwam.event</param-value>
    
        </init-param>
    
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Jersey REST Service</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>
    </web-app>