/    Sign up×
Community /Pin to ProfileBookmark

Apache question

When you set up a new domain you have to write a new virtual host to httpd.conf… then you have to restart the server… Is their a way to do this without the restart. Surely a big ISP doesn’t restart apache every time a new domain is added.

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@ScleppelFeb 07.2006 — [URL=http://httpd.apache.org/docs/1.3/vhosts/mass.html]Dynamically configured mass virtual hosting[/URL]
Adding virtual hosts is simply a matter of creating the appropriate directories in the filesystem and entries in the DNS - you don't need to reconfigure or restart Apache.[/QUOTE]
Copy linkTweet thisAlerts:
@bokehauthorFeb 08.2006 — [B]mod_vhost_alias... That pesky "www."[/B]

Is it possible when using this module to get [B][I]www.domain.com[/I][/B] and [B][I]domain.com[/I][/B] to map to the same directory?
Copy linkTweet thisAlerts:
@cbrookesFeb 08.2006 — Probably something like this:

VirtualDocumentRoot /usr/local/apache/vhosts/%-2+

should allow:

<anything>.domain.com

and point it at:

/usr/local/apache/vhosts/domain.com
Copy linkTweet thisAlerts:
@bokehauthorFeb 08.2006 — Is it possible to do it the other way around? i.e. [B]domain.com[/B] and [B]www.domain.com[/B] mapped to /usr/local/apache/vhosts/[B]www.[/B]domain.com

While [B]subdomain.domain.com[/B] is still mapped to /usr/local/apache/vhosts/[B]subdomain.[/B]domain.com
Copy linkTweet thisAlerts:
@cbrookesFeb 08.2006 — If you use %-3+ instead then it will solve the second part of the question. To add the 'www' if it is missing is more tricky and you will probably need to use the url rewriting for that (mod_rewrite). A simple approach would be to define a redirect for domain.com to www.domain.com ... but I'm not necessarily suggesting that this is the best approach (getting a bit out of my depth here).
Copy linkTweet thisAlerts:
@bokehauthorFeb 08.2006 — [B]%-2+[/B] --- [B]%-3+[/B] --- [B]%-1+[/B] --- None of these work at all! [B]%0[/B] does work so I know the path is good! Any ideas?
Copy linkTweet thisAlerts:
@bokehauthorFeb 08.2006 — [B]-2+[/B] the penultimate and all preceding parts[/QUOTE] That means [B]domain.com[/B] maps to [B]/domain[/B] and [B]www.domain.com[/B] maps to [B]/www.domain[/B] Thats not ignoring the [B]www.[/B]
Copy linkTweet thisAlerts:
@ScleppelFeb 08.2006 — Perhaps you have to use a symlink or something like that to redirect the directories. But i really don't know.
×

Success!

Help @bokeh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...