home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2811
Discussions: 188,385, Posts: 2,243,515, Members: 232,615
Old November 16th, 2002, 05:01 AM   Digg it!   #1 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
Subdomains in Apache

Hello ladies and gentelmen. Quick question.

How would I setup subdomains in Apache under virtual hosts? I was told I could do it the "slow way" and create VirtualHosts for each domain, or do it the fast way, which the person didn't know. I'd like to do it the "fast way", if there is one. Currently I control DNS (via BIND on local Debian server), so it won't take me long to come back and say if this stuff worked or not. It's 2am, and I hope I'm making a bit of sense to you guys. I think I'm making perfect sense, but who knows, I might be making a complete fool of myself. Thanks in advance.

BTW, here's my config files for BIND and the VirtualHost section for Apache.

http://maverick.mahan.net/bind
http://maverick.mahan.net/httpd.conf


Last edited by Praetorian : November 16th, 2002 at 05:03 AM.
Praetorian is offline   Reply With Quote
Old November 16th, 2002, 06:54 PM     #2 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
*bump*

Praetorian is offline   Reply With Quote
Old November 16th, 2002, 11:51 PM     #3 (permalink)
Member
 
gothic's Avatar
 
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
I don't know about the easy or hard way.. But here's how I do it:


*snip*

NameVirtualHost *

<VirtualHost *>
ServerAdmin root@killinghand.org
DocumentRoot /home/httpd/htdocs
ServerName 208.137.8.252
ErrorLog logs/error.log
CustomLog logs/access.log refercustom env=!do_not_log
</VirtualHost>

<VirtualHost *>
ServerAdmin root@killinghand.org
DocumentRoot /home/websites/killingass/htdocs
ServerName www.killinghand.org
ServerAlias killinghand.org
ErrorLog logs/error.log
CustomLog logs/access.log refercustom env=!do_not_log
ScriptAlias /cgi-bin/ /home/websites/killingass/cgi-bin/
Alias /icons/ /home/httpd/icons/
ErrorDocument 404 /404.phtml
ErrorDocument 401 /401.phtml
</VirtualHost>

<VirtualHost *>
ServerAdmin root@badass.org
DocumentRoot /home/websites/killingass/htdocs
ServerName www.badass.org
ServerAlias badass.org
ErrorLog logs/error.log
CustomLog logs/access.log refercustom env=!do_not_log
ScriptAlias /cgi-bin/ /home/websites/killingass/cgi-bin/
ScriptAlias /mailman/ /var/mailman/cgi-bin/
Alias /pipermail/ /var/mailman/archives/public/
Alias /icons/ /home/httpd/icons/
ErrorDocument 404 /404.phtml
ErrorDocument 401 /401.phtml
</VirtualHost>

*snip*

I have a bunch more in there, but I didn't think you needed 10 pages..

*edit* Posted something I shouldn't of.. :P

gothic is offline   Reply With Quote
Old November 17th, 2002, 11:57 PM     #4 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
No, I know how to setup virtual hosts. I want to setup subdomains the "dynamic" way. Subdomain would be like http://maverick.mahan.net
Praetorian is offline   Reply With Quote
Old November 18th, 2002, 12:02 AM     #5 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,549
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
Check out this link prae.

http://httpd.apache.org/docs/vhosts/examples.html

Also check out this

http://www.cfdev.com/apache/virtualhosts.cfm

Next time RTFM (just kidding folks)

Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.

Last edited by jkrohn : November 18th, 2002 at 12:04 AM.
jkrohn is offline   Reply With Quote
Old November 18th, 2002, 12:25 PM     #6 (permalink)
Member
 
gothic's Avatar
 
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
"Dynamic" way? Can you elaborate a bit on that? I'm not aware of any way of creating virtual hosts in Apache without expressly creating the VirutalHost section.

Side note: Subdomains work the same way as domains do.
gothic is offline   Reply With Quote
Old November 18th, 2002, 10:16 PM     #7 (permalink)
Ultimate Member
 
Praetorian's Avatar
 
Join Date: Oct 2001
Location: Arizona
Posts: 2,538
Hmm...i was told this is it. I don't know though.

http://httpd.apache.org/docs/vhosts/mass.html
Praetorian is offline   Reply With Quote
Old November 19th, 2002, 02:02 PM     #8 (permalink)
Member
 
gothic's Avatar
 
Join Date: Oct 2001
Location: Palatine, IL
Posts: 375
Sounds interesting. Personally, I prefer the safety of adding in the virt hosts, and having explicit control of each and every setting for each Virt.. =]
gothic is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2897)
CPU wont boot (7)
3-days in and no threads about Gaza (160)
I think I just killed my computer w.. (24)
hp compaq nc6000 problems (139)
Upgrading RAM (5)
Folderchat Weekday thread (442)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (15)
Recent Discussions
New Build ( Finally ) (3)
CPU wont boot (7)
Problem With LightScribe DVD Dr.. (0)
GLaDOS is up. (3)
HP notebook reinstall Vista NO .. (5)
Building a gaming computer advi.. (4)
hp compaq nc6000 problems (139)
Folderchat Weekday thread (442)
Creative T-3000 Subwoofer (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 10:59 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28