LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-22-2004, 01:27 AM   #1
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Rep: Reputation: 30
Apache setup


Hello there, maybe this is a thread you get a lot, believe me I have searched the web and apache docs for almost 2 weeks, but I can't get my server to work. What I wan to do is to host a small webpage in my computer, I have apache installed ans it's running fine, when I go to 127.0.0.1 it shows up my webapage with no problems, on my router I have port 80 forwaded to my machine, but if I try to connect as if it was a webpage I get nothing, I mean I fire up any broser and put mi ip and I get nowhere. I have ssh running and it wirks fine, I had an ftp server for a while and it worked fine too. Any ideas on why my webpage does not work?
Thanks in advance
 
Old 05-22-2004, 03:58 AM   #2
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
if you forwarded "router":80 to "your sys":80 your apache must listen on "your sys":80 not! at localhost. try getting it by browsing "your pc ip":80. if that doesnot work edit your httpd.conf "listen" parameter.
is a firewall up blocking connections to port 80?
is ssh also forwarded?
 
Old 05-22-2004, 11:36 AM   #3
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Original Poster
Rep: Reputation: 30
Hello again:
I am trying to do as you say, but I can't get anywhere yet, should I edit the httpd.conf file or the /etc/hosts file?
Thanks
 
Old 05-22-2004, 01:33 PM   #4
fuubar2003
Member
 
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
I think what last post meant was, go into your /etc/httpd/conf/httpd.conf file and find the line that reads:

Listen 80

You may need to change that line to listen to a specific IP if you have multiple IP addresses and/or multiple NICs configured:

Listen 192.34.56.78:80

Next, you need to search the httpd.conf file for "ServerName". If you are using DNS on your network, change the 'ServerName' line to read:

ServerName penguin.mydomain.com:80

If you are not using DNS, just enter the IP address:

ServerName 192.168.8.3:80

After making the above changes, save the httpd.conf file and restart the httpd daemon:

#/etc/init.d/httpd stop

#/etc/init.d/httpd start

Finally, if you are not using DNS on the network, make sure your /etc/hosts file has the IP address you added to the httpd.conf file for ServerName along with the computer name.

Hope this helps.
 
Old 05-22-2004, 02:56 PM   #5
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Original Poster
Rep: Reputation: 30
I did exaclty as you said, but none. I have a dynamic IP, maybe that's not letting my server work, but I have a redirecting address, where shoud I put that address ? or what file should I edit to use my dynamic IP? thanks in advance again
 
Old 05-22-2004, 04:05 PM   #6
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
well, back now. if i got you right:
you have a router with a dyn. IP-Address (what os?). this router forwards connections from the outside (www?) port 80 to your machine1 port 80. right? ssh and other work if your try to access machine1 from behind the router. their ports are forwarded the same way.
you want to get access from behind the router to your apache running at machine1. but that doesn't work. question: can you reach the apache from inside your network, possibly from a machine2? how many ethernet-cards does machine1 have?

INTERNET --- ROUTER --- MACHINE1 (-- MACHINE2...)
dyn. IP0 // (privat) IP1 IP2/localhost(/IP3 IP4...)

can you reach the apache via IP2 (or IP3) if you are inside your LAN?

i'd like to help, but a little more info on your system topology would do nice.
sl mritch.
 
Old 05-22-2004, 04:20 PM   #7
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Original Poster
Rep: Reputation: 30
Thanks, here it is how it works
Internet -router- mymachine(running SuSE 9.0 and apache installed)
from anywhere I can get to my machine trough ssh with my dynamic IP, I have port 80 forwarded to my machine on the router and I can see apache from the internal network, but not from the outside.
What I want to do is to host a webpage of my own on my machine with apache.
That's the info I can give you, thanks for your help
 
Old 05-22-2004, 05:14 PM   #8
fuubar2003
Member
 
Registered: May 2004
Location: Orlando, Florida
Distribution: SLES10/11, RH4/5 svrs, Fedora, Debian/Ubuntu/Mint; FreeBSD/OpenBSD
Posts: 63

Rep: Reputation: 26
I agree w/mritch, I think there is some info missing...such as what type of router used, your httpd.conf file.
I think you need to forget about the router, internet access and your dynamic IP for now. Concentrate your efforts on getting a different PC on your LAN to be able to access the webpage via IP address in a web browser. Once you have that working, then work on access from the external Internet. The reason I suggest this strategy, is that if the /etc/hosts file and/or the /etc/httpd/conf/httpd.conf files have incorrect/missing entries, nothing will work LAN or WAN and you will experience exactly what you are currently experiencing.
The fact that you can enter the loopback (127.0.0.1) on the Linux box and view the web page tells me 2 things: Apache/httpd is working, but name resolution is not. Anotherwords, Apache/httpd has no clue what it's own IP and name is. Which is why using the IP of the Linux box, nor the name will bring up the web page.
Once you get this working on your local, internal network (LAN), then start troubleshooting the router, internet access issue. On that one, I would search forums, google, pertaining to your router make/model and serving a web page behind it. More than likely, somone has done it before w/that router.
 
Old 05-22-2004, 05:51 PM   #9
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
i think that must be a problem with your router. since everthing except http-traffic seems to be forwarded correctly. i asume you can reach the apache via the address of your eth0 from intern. you should try to do a netcat to port 80 from the outside and look if you get a "connection refused". but> i've heard about routers, like from belkin, linksys and others which have also a http-server installed for configuration. this one listens on port 80 and so forwarding there wouldn't work unless it's switched off.
mritch
 
Old 05-22-2004, 06:03 PM   #10
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Original Poster
Rep: Reputation: 30
Hello again:
I did as you said with an internal computer, there are 3 computers connected to the same router, included mine, and rom the other 2 I have no problems with the webpage I enter locally and have no problems, the problem start when I try to get from the outside, I am very sure it must be the httpd.conf and/or /etc/hosts files, here is my /etc/hosts:

127.0.0.1 localhost
#192.168.0.119 my ip

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts

127.0.0.2 linux.local linux


And the httpf.conf file is almost untouched I only edited the following lines:

I added the folowing line

ServerName my ip (I don't know if I have to put my internet IP or my local ip (192.168.0.119) )

and also added

Listen 80

I hope you can help with this info
Thanks again
 
Old 05-22-2004, 06:07 PM   #11
aeruzcar
Member
 
Registered: Jul 2003
Location: Santiago, Chile
Distribution: Gentoo
Posts: 282

Original Poster
Rep: Reputation: 30
Heeeey again I got it working
Have you ever heard about the error between the computer and the chair?
Checking trough my router's configuration I had port 80 assigned to my computer, but I did not enable it.
Thanks a lot for your help again and I apologize for this dummy mistake
 
  


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
apache setup problem aw_wolfe Linux - Newbie 3 04-21-2005 06:27 PM
Apache setup help? TechSonic Linux - Newbie 7 02-23-2004 11:51 AM
Apache 2 setup fredws Mandriva 2 11-13-2003 05:47 AM
Apache and SSL Setup pnh73 Linux - Networking 2 09-08-2003 11:25 AM
Setup Apache and PHP kaustav Linux - Newbie 5 03-31-2003 06:23 PM

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

All times are GMT -5. The time now is 01:38 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