Solved

Apache2 Mass Hosting

Posted on 2004-04-12
3
319 Views
Last Modified: 2012-08-13
The question is valued at 500 points and here is what I need:

I know that a really nice mass-hosting can be organised using mod_rewrite and here is what I need:
1. We've got a file (/etc/vhosts) with this structure:

site1.net                              /home/user2
supersite2.org                      /home/bobby
mysite.de                            /home/anythingelse

so we've got a map with corresponding home dir where we'll find the "docs" folder (that has htdocs meaning) and "cgi-bin"

We're not discussing any log files here

What I need is to configure the apache to:
1. if the request is http://mywebhost.com/users/user2 - then use /home/user2 (if it''s not found - show the default server page - not any vhost)
2. if the request is http://site1.net look for the match in the /etc/vhosts and use /home/user2 (use the default server page if not found)

So I'll need the example part of the httpd.conf that lets me do the things like that for apache2

Hope that it's clear, will clarify if needed
0
Comment
Question by:advert2k2p
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Mercantilum earned 500 total points
ID: 10853580
Using mod_rewrite

1. Ensure engine is on

RewriteEngine On

2. rule to actual users directories, e.g. user1, user2

RewriteRule  ^http://mywebhost.com/users/user1    http://site1.net   [L,R]    
RewriteRule  ^http://mywebhost.com/users/bobby   http://supersite2.org   [L,R]    

3. rule for other non existent users

RewriteRule  ^http://mywebhost.com/users/(.*)      http://mywebhost.com   [L]    

This should redirect user1 to site1.net, bobby to supersite2.org, and any other users/user to the home page (no redirect, same server).
The [L,R] means L: if match stop here (Last rule), R: redirect.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 11761061
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

    ACCEPT: Mercantilum

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Periwinkle
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question