LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-03-2006, 02:38 AM   #1
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Apache is redirecting web traffic to local domain


Hello fello Slackers,

I seem to be running into some strange DNS behavior with apache and can't figure out what's causing it. I actually asked this question about a week ago on the software thread (with no response) so I won't go over it again in detail. I will just give a brief summary and if any one is interested, you can read the details here Sorry to double post, it's just been my experience that Slackware users are more knowledgeable and willing to help. I hope enough time as gone by so no one get's mad at me for resurfacing the question.

Well anyways, it goes a little like this:

I have a local host set up that is supposed to be private from the internet:
Code:
#/etc/hosts
# For loopbacking.
127.0.0.1               localhost
127.0.0.1               srv.domain.com srv

#Local Hosts
192.168.0.179           dsk.domain.com dsk
where drkstr.org is my public domain name. Now the problem I am getting is when I enter in the url as so 'http://<MY IP>/islam/' (which is a folder that contains something for a school project) apache routs to my private 'srv.domain.com' address. At the time my domain was not registered to my IP so I would end up getting an error page from the site that hosted my domain.

My question is WTH is apache forwarding something to a private domain!? I have all of my configuration files/security set up around these two host names (dsk/srv) and the fact that apache is routing to it makes me really nervous.

Any Ideas?

thanks!
...drkstr

**edit**
removed actual domain name

Last edited by drkstr; 06-05-2006 at 12:00 AM.
 
Old 06-03-2006, 09:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I saw your original post, and couldn't make much sense of it
then, and I'm still not sure I understand your actual problem.

Apache will serve up what ever comes its way, and without
having seen the relevant sections of your httpd.conf no one
(slacker or not) will be able to answer your questions.

From your description it's totally unclear whether the machine
has two network interfaces, one of which you expect to serve
the public web-site and and one for internal only use.

You also give no indication of what kind of routing is going
on, whether the server is NATed behind a router/firewall or
what ...


Cheers,
Tink
 
Old 06-04-2006, 06:15 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Thank you for takeing the time to reply. You have a very good point. Sorry I didn't post more relevant info. Thank you for the reminder that there is probably a good reason why no one answered my question


httpd.conf is standard install. No special configurations. I can post it if you think there might be other information you need in it, but I'm not sure if it's actually a problem with apache configuration, or with the way I have DNS set up.

Network set up:

server plugs into dsl router which forwards http to my server.

Server has eth0 and eth1.

eth1 is for local network connections. eth0 for public (goes to dsl router)


I have a desktop that uses my server as a NAT gateway. The server forwards the traffic from eth1 out though eth0.

Code:
#desktop /etc/hosts
127.0.0.1 localhost
127.0.0.1 dsk.domain.com

192.168.0.101 srv.domain.com srv   #eth1 on server

Code:
#desktop /etc/hosts
127.0.0.1 localhost
127.0.0.1 srv.domain.com

192.168.0.179 dsk.domain.com   #eth0 on desktop
How/why would something get forward to the domain set as the loopback adr?


Even if you are not sure what the problem is, thank you for the feedback on posting better questions. I'm still kind of new to Linux and sometimes forget these kind of things.

thanks!
...drkstr


**edit**
removed actual domain name
**edit**

Last edited by drkstr; 06-05-2006 at 12:01 AM.
 
Old 06-04-2006, 06:58 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
It's all about the apaches configuration. If there's nothing
to deny a request from one of the interfaces all packets from
all interfaces will be served.

If it looks anything like this the world will see it:

Code:
<Directory "/var/www/htdocs">

    Options Indexes FollowSymLinks MultiViews

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>
and the bit in bold is your problem.

[edit]
Btw, the thread title is completely wrong; apache isn't
redirecting anything, it's just serving all interfaces as
it's told.
[/edit]



Cheers,
Tink

Last edited by Tinkster; 06-04-2006 at 07:06 PM. Reason: [edit]
 
Old 06-04-2006, 11:59 PM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Thank you for putting up with my ignorance. I have updated the the httpd.conf to be (what I think at least) more secure. I didn't see any bold in your previous post so I took a guess at it. Would you mind takeing a look at my configuration and telling me if there is anything that jumps out at you as being poorly configured?

changes from default are in bold.
Code:
<Directory "/var/www/htdocs">
    Options FollowSymLinks MultiViews  #removed Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Thank you for takeing the time to look at this. I am really new to security stuff and am trying to learn the proper way to configure my home network. I don't think any real hacker will be interested in my computer, but I would like to at least keep the script kiddies out.

FYI: I changed my /etc/hosts file on both server and the desktop to point to their network device instead of the loopback. Just wanted to let you know since I use the hoste name 'srv' in my configuration.

Quote:
Btw, the thread title is completely wrong; apache isn't
redirecting anything, it's just serving all interfaces as
it's told.
Being a moderator and all, would you mind changing it to something better? Sorry for the poor title, I would have liked to of picked a better one but that would mean I actually knew what was going on

thanks for all your help!
...drkstr

**edit**
removed actual domain name

Last edited by drkstr; 06-05-2006 at 09:18 AM.
 
Old 06-05-2006, 01:42 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Sorry mate, I won't be doing all your work for you, I was happy to
nudge you in the right direction. I highly recommend reading a tutorial
on apache (you should have done that before you put the thing on the net).

As for the title: I'd be happy to oblige, but I only mod newbie and BSD,
can't edit anything in the other forums.


Cheers,
Tink
 
Old 06-05-2006, 09:16 AM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
Sorry mate, I won't be doing all your work for you, I was happy to
nudge you in the right direction.
Fair enough. I will see what I can find on the internet. I do appreciate the help you have given me. At least I have some idea where to start. I will post back if there is anything I still can't figure out.

thanks again!
...drkstr
 
  


Reply



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
passwd: can't get local yp domain: Local domain name not set powah Linux - Security 4 06-08-2006 09:59 AM
Redirecting domain.com to www.domain.com rustyz82 Linux - General 3 05-18-2006 03:41 AM
X11 Tunneling and Web traffic from local Machine anon111 Linux - Networking 2 01-30-2006 09:13 AM
Iptables - Redirecting Outgoing Traffic Frankablu Linux - Networking 1 06-12-2005 01:18 PM
redirecting vpn traffic brb5548 Linux - Networking 1 07-01-2003 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:17 PM.

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