Find the answer to your Linux question:
Results 1 to 10 of 10
Hi, I've got a server that's got three ether net cards installed and on this server I've also got an apache running. I would like to setup apache so that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79

    Apache and ethernet adapter


    Hi,

    I've got a server that's got three ether net cards installed and on this server I've also got an apache running. I would like to setup apache so that each network card gets it's on page shown on port 80.

    Can this be done with apache? Or do I have to have two or three apache servers running?

    Thanks for the help and a good day to all.

  2. #2
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    There are several ways of doing this and no you don't need 3 apache sessions running.

    You can statically assign each nic card and then static each website. you can also use one IP and virtually host many <-- that is what I do.

    You can set the static ip on each of your nics in

    /etc/sysconfig/network-scripts

    If you have a lot of static IP's you can actually assign many IP's to one nic card.

    I can't give you much more till you decide how you want to do this, but it is possible to do what you want to do.
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  3. #3
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79
    Thank you adrenaline.
    So all that a actualy have to do is set static IPs to eatch NIC and then set apache with vortual hosting support on IP basses to serve eatch IP range it's own page.
    Or did you have something else in mind.

    Best regards

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    If you are going to host virtual domains and ip's aren't important meaning you can host them on name basis then I would just host them all on on IP. If they prefer you to host them with there own IP then you can assign multiple IP's to one adapter or you can to multiple adapters, but remember that doesn't scale good. If you know you are set with what you have you are OK but if you grow ti is not a good way to go.

    I host about 50 websites all on one IP address.

    You can configure that in your httpd.conf file. It is on the very bottom of the file.
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  6. #5
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79
    Yes I know about virtual hosting, I also have four websites on the same IP but diferent domains. But this is for a diferent machine.
    I've got two departments one on the first floor and the other on the second. They both use the same server but need to use diferent web applications. And I have three nic-s in the server one goes to the internet, one to the 1 floor and the other to the 2 floor. So I woudl like to set up apache so that if browse on one network to the server IP you get one site if on the other network another site. But if you access form teh internet you get a default page.
    But I'm not sure on how to do that.

    Thanks for the help.

  7. #6
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Ok so you are going to have to be more specific

    Do you mean web pages or we apps? Two different things.

    IF you have 2 floors and you want them to see different pages set up the desktops to default to that page. Do that at the client level. If you want a default to the web put it first in your virtual domain list in the .conf file What ever is first will default to.

    If you want to first and second floor to default to different pages edit the host file is another way you can do this.

    You can edit the host file underneath the part that says 127.0.0 blah

    whateveryoucallyourwebfloor1 IP all computers can see on the second floor

    whateveryoucalyourwebfloor2 ip of a network on the first floor.


    so if your second floor ip's are 192.168.0 then put the ip of the second floor adaptor to 192.168.0. what every you chose for the server.

    and if the first floor is 192.168.100 do the same for floor one adaptor.

    So if you pick 192.168.0.5 to be your upstairs server you would do this

    whateveryoucallyourwebfloor2 192.168.0.5

    and so on

    I am assuming you know about your FQDM and don't need advice there.

    To default that to the web you either place that one first in your virtual domain. But if it is entered in public DNS it doesn't matter if it defaults first.

    People will look it up by name.
    make sense?
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  8. #7
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79
    Ok I think I get wtah you mean now.
    I shuld setup a static IP on eatch of the NICis eth0 192.168.0.1 eth1 192.168.1.1 and eth2 192.168.2.1 and then edit the host file to something like
    steve 192.168.0.1
    mary 192.168.1.1
    john 192.168.2.1

    and then setup virtual hosting for eatch of these domains in httpd.conf.

    Have I got it?

    Thank you for the help.

  9. #8
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    pretty much so yes
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  10. #9
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79
    Ok I'll try it and report back if I have any problems.

    Thanks alot.

  11. #10
    Just Joined!
    Join Date
    Apr 2006
    Location
    Slovenia
    Posts
    79
    I just thought of another way to get the same resault.
    I could configure apache to server three websites on three diferent ports and then configure the routing to bind port 80 on eth1 and port 81 to 80 on eth2 and port 82 to 80 on eth3.
    I think this shuld work also right?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •