LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-17-2005, 08:43 AM   #1
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Rep: Reputation: 15
Subdomains on Apache2 with virtual hosts - how?


Greetings linux users!

I'm having a bit difficulties understanding and configuring apache2 vhosts and network stuff as I am relatively new to these things. Let me explain my problem. I recently registered a domain (in this thread I will refer to it as "mydomain.com") and I have configured a web site on it using Apache 2 on Slackware linux 10.1 (my own PC, static IP address), port 80. If I type into a web browser www.mydomain.com or just mydomain.com or simply enter my IP, I will get the web page I configured as default.
Now the thing I do not understand is how to configure Apache2 using namevirtualhost (single PC with static IP, multiple websites on it) to use subdomains like "computers.mydomain.com" or "animals.mydomain.com" so that if a user types one of those two links (or just about anything else I put into httpd.conf vhosts tabs) into a web browser, he will get a different page hosted on my PC and not the default one.

I know I could just use www.mydomain.com/computers or www.mydomain.com/animals but I would like store websites in different folders like /var/www/html/animals and /var/www/html/computers and use subdomains to access them as it gives a bit more security.

I use the following comfiguration but the subdomain there doesn't work. It says that it couldn't find the webpage requested.

Part of my httpd.conf:

NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /var/www/html/root
ServerName www.mydomain.com
ServerAlias mydomain.com
</VirtualHost>


<VirtualHost *:80>
DocumentRoot /var/www/html/downloads
ServerName downloads.mydomain.com
</VirtualHost>

And please don't point me to the official Apache 2 virtual host documentation aka. the place where I originally started. I don't quite understand it which is the reason why I ask here.

Thanks in advance!
 
Old 08-17-2005, 01:05 PM   #2
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Original Poster
Rep: Reputation: 15
Okay, I did another search on this forum using a bit different keywords and it gave some promising results. Glad to see this has been answered. It seems that I have to configure DNS entries. at my ISP.

I have a new question now. Is it possible to configure a single universal dns subdomain entry that would count for all subdomains? So that (anything).mydomain.com would get forwarded to my IP?
My ISP doesn't allow configuring DNS directly.
 
Old 08-18-2005, 06:53 AM   #3
<Ol>Origy
Member
 
Registered: Aug 2003
Location: Slovenia
Distribution: Arch, Debian, Embedded
Posts: 136

Original Poster
Rep: Reputation: 15
Ah nevermind. Talked to my ISP and they solved it.

Thank you for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems setting up virtual hosts with debian sarge and apache2 dthacker Debian 1 11-23-2005 06:25 PM
SuSE 9.2 - apache2 & tomcat5 - how to configure VIRTUAL HOSTS & JSP? nicolasdiogo Linux - Networking 2 03-20-2005 09:06 AM
Apache2 Virtual Dynamic Hosts and defaults techrolla Linux - Networking 1 11-01-2004 05:01 PM
Apache2, SSL, 2 Virtual Hosts franticbob Linux - Software 0 04-07-2004 10:48 PM
apache2 virtual hosts viniosity Linux - Software 4 02-07-2004 01:15 AM


All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration