LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-28-2005, 05:22 AM   #1
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 69
Apache directory preceding domain in url


Hi!

I have about 4 or 5 things that I'm going to combine into 1 topic. Probably not a great idea, but they are all very closely related, and rather than post multiple topics, I'll take the risk that some guru will know the answer to all my problems (and no, I'm not looking for Dr. Phil ).

And to preempt the search feature response: I did. But portions of this are VERY likely the case of not knowing the keywords to search for...

First off, the main point of the post, the subject you see above:

1) As can be seen just about anywhere on the web, how do I make http://domain.com/peaches available when typed into the address bar as: http://peaches.domain.com ?

2a) To further the above, and complicate it:
How can I serve up a website from another box running apache when the url is typed as above. What I mean: When a visitor types http://domain.com they get served up a page from my main server. However, should they type http://olives.domain.com The second server serves up the pages for that subdomain (which seems to complicate #1 even more)?

2b) (How) Can I password protect this subdomain using an .htaccess file? Will that cause me too much heartburn, or is it even possible?

3) If DNS is involved with a portion of this (beyond setting up a basic association of domain.com to IP 1.2.3.4) any help in that area would be much appreciated as I've yet to get beyond the first chapter in DNS & BIND from O'Reilly.

Yeah, I think there were actually a few more related questions that I can't drum up right now, but I think that'll suffice.

Thanks for reading, and if you can supply an answer too, that would be great

I have the following (that may be pertinent):
Gentoo
Apache 2.0.x
PHP 4.3.9 (but thinking of updating tomorrow...)
Linksys WRT54G
1 WAN IP, several domains, several static LAN IP's, but the main server is 192.168.1.24 and the secondary is 192.168.1.80 if that helps in troubleshooting/examples.

Cool

Last edited by MasterC; 02-28-2005 at 05:28 AM.
 
Old 02-28-2005, 05:36 AM   #2
camh
Member
 
Registered: Feb 2005
Distribution: Slack/Debian
Posts: 163
Blog Entries: 2

Rep: Reputation: 33
bah .. ignore this one

Last edited by camh; 02-28-2005 at 05:58 AM.
 
Old 02-28-2005, 05:57 AM   #3
camh
Member
 
Registered: Feb 2005
Distribution: Slack/Debian
Posts: 163
Blog Entries: 2

Rep: Reputation: 33
Quote:
1) As can be seen just about anywhere on the web, how do I make http://domain.com/peaches available when typed into the address bar as: http://peaches.domain.com ?
A) Follow the solution for 2a) first, and make the appropriate entry (peaches in this case)
B) read http://httpd.apache.org/docs-2.0/vhosts/name-based.html

Quote:
2a) To further the above, and complicate it:
How can I serve up a website from another box running apache when the url is typed as above. What I mean: When a visitor types http://domain.com they get served up a page from my main server. However, should they type http://olives.domain.com The second server serves up the pages for that subdomain (which seems to complicate #1 even more)?
This is done using dns. you can just set up an entry for olives.domain.com that points to xxx.xxx.xxx.xxx. this file is usually /var/named/domain.com.db (provided you are using bind for DNS services) add a line like:

olives 14400 IN A xxx.xxx.xxx.xxx

(where 14400 is your TTL - your's may differ - and xxx.xxx.xxx.xxx is the server ip hosting 'olives')

Looking at your system specs, it looks like you are behind a cable/dsl router. If this is the case, you might be forced to have olives.domain.com run on a different port (only to the end user) .. eg: http://olives.domain.com:81 -- you would then set up a port forward on your router to direct all requests on port 81 to ip xxx.xxx.xxx.xxx (server running olives.domain.com)

Quote:
2b) (How) Can I password protect this subdomain using an .htaccess file? Will that cause me too much heartburn, or is it even possible?
http://httpd.apache.org/docs/howto/htaccess.html

Quote:
3) If DNS is involved with a portion of this (beyond setting up a basic association of domain.com to IP 1.2.3.4) any help in that area would be much appreciated as I've yet to get beyond the first chapter in DNS & BIND from O'Reilly.
the answer i gave for 2a) should work ... but i'd read the book :P


Hope this helps

Last edited by camh; 02-28-2005 at 06:26 AM.
 
Old 02-28-2005, 08:23 AM   #4
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
If you have wildcards with your domain registrar then anything dotted before your domain name should get sent to your one server. From there you can set it up using virtual hosts in apache to either serve a different directory for that site or redirect the requests to another webserver. This involves no DNS modifications at all, aside from using wildcards for your main domain, and is done through the web server.

I'll leave it up to you to find the information on virtual hosts and redirectors in apache but here's a hint :-)

masterc.kollins.homelinux.net

Last edited by Darin; 02-28-2005 at 08:47 AM.
 
Old 02-28-2005, 04:10 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
If you only have one ip and need to direct a host to another box, take a look at apache's proxying feature as well.
 
Old 02-28-2005, 05:23 PM   #6
captain skywave
Member
 
Registered: Nov 2004
Location: Europe
Distribution: WIN8.1 ENT, WIN SERVER 2012 R2, openSUSE 42.1 LEAP
Posts: 118

Rep: Reputation: 15
..very funny..

..so - let's see:
..don't ask stupid q's again..?
..at least not until you know the answers yourself..?
..or just moderators getting bored with all the imbeciles..?
..one wooooonders..hmmmmm..

rgds (oups - can't find the k right now)
 
Old 03-01-2005, 04:46 AM   #7
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
I wouldn't call it a stupid question. I think we just expected the moderators to know all the answers about everything so we are taken by surprise when they themselves have questions. Obviously without knowing which keywords to search for it's harder to find answers.
 
Old 03-01-2005, 01:37 PM   #8
captain skywave
Member
 
Registered: Nov 2004
Location: Europe
Distribution: WIN8.1 ENT, WIN SERVER 2012 R2, openSUSE 42.1 LEAP
Posts: 118

Rep: Reputation: 15
no - no - no..i did not imply that MasterC was asking a stupid q..
i actually put a ? after that sentence..

my querry was merely - politely :-) - to find out if the thread from MasterC was a hidden hint, that there are too many 'silly' q's asked in this forum - which i btw indeed am doing myself..
i can't help getting the impression - from this thread - that many 'specialists' are fed up reading tons of - in their view - 'silly' q's..

..but i - for one - will most certainly continue asking - unaffected :-)

krgds
 
Old 03-02-2005, 04:48 AM   #9
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
Quote:
Originally posted by captain skywave
...I can't help getting the impression - from this thread - that many 'specialists' are fed up reading tons of - in their view - 'silly' q's..
I wouldn't really call myself a specialist but to me LQ is a place to exercise my Linux knowledge, kind of like going to the gym to stay in shape. I am able to go to the gym and happily ignore the latest aerobics fad, just as I am able to come here and find challenging questions that let me keep my Linux knowledge 'in shape' without having to bother with every 'silly question' I see posted.

The 'silly questions' that I respond to usually look like this:

http://www.google.com/search?q=stupid+linux+question

And for some reason, answering them like that doesn't make me feel fed up
 
Old 03-14-2005, 07:32 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Original Poster
Rep: Reputation: 69
Wow, I am really late on checking back up on this one, and am surprised and happy to see the responses it has. Thanks! The helpful hint/link was perfect, exactly what I need. I'll also look at the other responses, especially Apache's Proxying feature, sounds intreaguing.

No, this was not just a "notice all the stupid questions like this one" thread. It wouldn't be very welcomed to do that sort of thing around here, the place is a breading ground of knowledge and helpful wonderful people, no need to put down those asking, what one might consider, trivial questions. I do know quite a bit about varying parts of linux (after having spent the amount of time I have around LQ and really researching the questions that intreague me) and it's related parts, but having a major in depth knowledge of every single aspect is a rough thing to attain when I do it just as a hobbie (I'm a Pharmacy Tech by trade, a Linux geek by choice ).

Cool
 
  


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
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 07:03 AM
apache and url help cambie Linux - Software 1 08-11-2005 09:49 AM
Apache and non-existing URL Mn3moniC Linux - Networking 0 07-06-2004 02:00 PM
apache, url play Robert0380 Linux - Software 5 06-08-2003 03:04 PM
Apache Url simquest Linux - Software 2 11-26-2002 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:50 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
Open Source Consulting | Domain Registration