You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by anthony G <sc...@gmail.com> on 2005/03/08 05:11:45 UTC

[users@httpd] Adding Alias without Restarting Apache

I'am running Apache 2.0.53 on Windows 2003 Web Edition.  I need to
know how to setup multiple Alias 's without having to restart Apache
every time I add them to httpd.conf file.

For Example I Know I can add this to my Virtual Host in httpd.conf but
then I would have to restart Apache for it to work.

Alias /UserX "E:\Websites\UserX\ROOT"

What is the best way to do this without having to restart apache
everytime new user is added.

Thank You,

-Anthony

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding Alias without Restarting Apache

Posted by Noah <si...@onastick.net>.
On Tue, Mar 08, 2005 at 08:38:34PM -0800, anthony G wrote:
> Thanks for your help with some maniuplation it worked great for the
> virtual directory.
> 
> I have another question. 
> 
> I need to be able to specify my virtual hosts directory without

[snip]

> However my directorires do not match the domains we are setting up.  I
> need to setup something like this
> 
> Http://www.iamauser.com goes to E:\websites\user1\root

mod_rewrite, using rewrite maps:

    http://httpd.apache.org/docs/mod/mod_rewrite.html
    http://httpd.apache.org/docs/misc/rewriteguide.html

For large numbers of virtual hosts, I'd suggest the DBM option. I've run
Apache instance with several thousand virtualhosts configured this way
withtout issue.

--n
    

-- 
<huey> dd of=/dev/fd0 if=/dev/flippy bs=1024
<huey> ^^^ Making Flippy Floppy


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding Alias without Restarting Apache

Posted by anthony G <sc...@gmail.com>.
Thanks for your help with some maniuplation it worked great for the
virtual directory.

I have another question. 

I need to be able to specify my virtual hosts directory without
restarting apache, not even using the graceful restart.

I have tried using dynamic virtual hosting as such

<VirtualHost 192.168.2.47>
   UseCanonicalName Off
   VirtualDocumentRoot "E:\Websites\%-2\ROOT"
   CustomLog logs\access_log vcommon
</VirtualHost>


but this matches the domain to directory if they are named the same. 
What I currently have setup does this

Http://www.iamauser.com goes to E:\websites\iamauser\root

However my directorires do not match the domains we are setting up.  I
need to setup something like this

Http://www.iamauser.com goes to E:\websites\user1\root

 Any idea on how to configure this for multiple virtual hosts without
restarting apache would be greatly appreciated.

Thank You,

-Anthony

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Adding Alias without Restarting Apache

Posted by Noah <si...@onastick.net>.
On Mon, Mar 07, 2005 at 08:11:45PM -0800, anthony G wrote:
> I'am running Apache 2.0.53 on Windows 2003 Web Edition.  I need to
> know how to setup multiple Alias 's without having to restart Apache
> every time I add them to httpd.conf file.
> 
> For Example I Know I can add this to my Virtual Host in httpd.conf but
> then I would have to restart Apache for it to work.
> 
> Alias /UserX "E:\Websites\UserX\ROOT"

Sounds like a job for mod_rewrite. You'll need to ensure that you're
loading mod_rewrite.so, and then add something like the following (keeping in mind that I'm not a win32 guy, so I'm guessing a bit):

RewriteEngine on
RewriteRule /([^/]+)/(.*) E:\Websites\$1\ROOT\$2 [L]

This will work if all incoming requests are in the form:

http://www.example.com/User1
http://www.example.com/User2
etc,

If you have *any* directories under '/' that are *not* user directories,
then a bit more finagling will be required; something along the lines
of:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/nonuserdirectory
RewriteCond %{REQUEST_URI} !^/another_nonuserdirectory
RewriteRule /([^/]+)/(.*) E:\Websites\$1\ROOT\$2 [L]

(both these rules are untested; Caveat Administrator)

Obviously, the precise recipe will be site-dependant. =)

Some mod_rewrite links:

http://httpd.apache.org/docs/mod/mod_rewrite.html
http://httpd.apache.org/docs/misc/rewriteguide.html

I'd recommend playing with this on a test system with RewriteLogLevel
cranked up to 9 until you get the behavior you want.

--n

-- 
<huey> dd of=/dev/fd0 if=/dev/flippy bs=1024
<huey> ^^^ Making Flippy Floppy


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org