Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache post install help

Status
Not open for further replies.

Slater

Technical User
Mar 25, 2002
2
AU
Hello everyone, this is my first post and i just wanted to say hi to all :)

I have basically just installed Redhat 7.2 and updated apache .

When i type in 127.0.0.1 it successfully comes up with the apache test :)

when i type in 127.0.0.1 in another machine on the local network it asks me for a username password and domain! my question is how can i stop this message and let everyone browse the webpage?
And also in the future, how can i publish my webserver to the outside world? i will have multiple ips for this purpose..

Thanks ppls :)

Slats :)
 
Slater,

The other workstations will need to access the Linux machine using the the Linux machine's IP address in their browser. 127.0.0.1 is the localhost IP address. It works on the Redhat machine itself because the server is running on localhost. Do you remember the IP you assigned the Redhat machine when you installed? If not you can find out with the ifconfig command.

As root type the following command in a term window:

ifconfig -a

Look for eth0 and you'll find the IP address (inet addr).
This IP should be a valid IP on the particular network
you are attached to and should have the same subnet
mask.

When you've determined the IP address just fire up your browser on one of the other machines on the network and type in the IP.

Hope this helps!
Rod
 
If you want to make your website available to people that are not on your LAN answer these questions.

What is your current setup? Cable, DSL, dialup? Do you have a router?
 
Hi,

Just to clarify on 127.0.0.1 - thats a reserved address for the machine's loopback interface which is commonly mapped to the name 'localhost'. It always means the machine you are using and is never used in networkiing - i.e. 127.0.0.1 on a redhat box means the redhat box itself; 127.0.0.1 on a windows box means the windows box itself. Every machine in the world has 127.0.0.1 as an address - meaning itself.

If you are on a lan, then people should just be able to use the lan IP address of the linux box, e.g. 192.168.1.1 or suchlike. However, you may first have to allow port 80 (www) packets through the redhat 7.2. firewall. You would administer that as root with :

# /usr/sbin/lokkit

and either allow inbound port 80 generally or set your lan interface (eth0 ?) as 'trusted'.

Out of the box, a redhat version of apache listens on port 80 and will answer to any interface on the machine - loopback, lan, or internet connected. However, for people to reach your server from 'out there' you need a public (real) internet address. If you are happy with using the IP address you can just leave it at that, i.e. people can do as long as the address is a real address that can be routed on the public IP network. If you want to use a canonical name ( you need to set up your domain and then configure the DNS records to point to your numerical IP address so that people can find you. This can be via DDNS (dynamic DNS) if your ISP gives out dynamic IP addresses, but is best with a static IP address of course.

Hope this helps
 
Hello :) thanks for the replies :)

Basically my setup is as follows.

ADSL servcies with a D-Link 804 Router.
Actually I am kind of stuck here also.

My DSL company provies me with a Customer IP and then an extra 2 subnets(for 5 more ips).

Currently I have a Win2k server box (for exchange, public folders etc), one Linux box that will be our webserver. And 4 Win2k Clients

To access the exchange server, if i am correct, i need to have internal ips addys?
What is the best way to do the setup in my case?
Just say my linux box has an ip of 192.168.0.3 and it hosted my webpage. And the WAN IP i wanted to give that Linux box is 203.1.2.3. Do i just have to use Ip forwarding? (remebering I need an internal ip for Exchange etc) If so, I have been told that you can do this in the router itself?

Kind Regards,

Slats
 
Hi,

Not too sure what you mean by the 'two extra subnets'....

Anyway, that D-Link 804 device does NAT and DHCP so works in a very similar way to how you'd set up linux to do IP masquerading. The key is the NAT (network address translation). In essence, all local machines would have an address in one of the rfc 1918 ranges of subnets for private usage - i.e.

10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

The router has one interface on that subnet and one (or more) connected to the internet. However, rather than just route the packets (doesn't work as return address is meaningless on the internet), it zaps the origin lan address and replaces it with its own wan address transparently. When responses are received it does the reverse transalation. So, internet traffic from any box plugged into the router on the configured local subnet will leave the router as 203.1.2.3 in your example - i.e. from the internet side it appears to all originate from a single address of 203.1.2.3 and the lan is totally hidden.

So, for exchange, its quite easy if its only for internal use - you just give it a lan address and you can configure it to use your ISP's SMTP server. However, if you want to act as MX for a domain then it would be more complicated. You'd need to have the dns for the domain pointing at the IP address of the mailserver yet thats not possible if its an internal rfc 1918 address. So, you could point it to your wan interface 203.1.2.3 but that wouldn't work on its own as there's no mailserver there. What you also need is port forwarding functionality that says 'when I get inbound port 25 send it to lan machine x'. You router does this with 'virtual hosts' - check the docs.

Otherwise, you could set it up like this - Get two network cards for the linux box and configure one on the router's subnet and the other on another subnet for lan connectivity. Then plug all the lan boxes into switches/hubs so that they talk to each other (i.e. don't use the integral router switch ports). After that, the linux box must be configured to do IP forwarding (routing) and you'd set up rules to masquerade all non-local lan traffic out of the linux box's other interface. However, unless the router supports forwarding you'd have the same problem with inbound mail stuff etc so you'd then need to connect the linux box directly to the adsl modem and configure the linux box with that 203.1.2.3 IP address.

To sum up, as I see it, you don't really need linux to do any routing / nat, etc., in this case because your D-Link does it all . If you don't have the manual its here --> ftp://ftp.dlink.com/Gateway/di804/Manual/di804_manual_051101.pdf

Hope this helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top