From owner-freebsd-questions Wed Dec 25 8:46:31 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC0AC37B401 for ; Wed, 25 Dec 2002 08:46:27 -0800 (PST) Received: from sigma.freebsdhackers.net (loaks-171-199.goldengate.net [216.250.171.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0415843ED8 for ; Wed, 25 Dec 2002 08:46:27 -0800 (PST) (envelope-from shane@freebsdhackers.net) Received: by sigma.freebsdhackers.net (Postfix, from userid 1099) id 165DB4D7; Wed, 25 Dec 2002 10:45:54 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by sigma.freebsdhackers.net (Postfix) with ESMTP id 0613C4B8; Wed, 25 Dec 2002 10:45:54 -0600 (CST) Date: Wed, 25 Dec 2002 10:45:50 -0600 (CST) From: Shane Kinney To: freebsd-questions@freebsd.org Cc: jimit@myrealbox.com Subject: Re: Refusing Connections In-Reply-To: <1040816512.68500.26.camel@localhost> Message-ID: <20021225101014.I60272-100000@sigma.freebsdhackers.net> References: <1040816512.68500.26.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > > OS - 5.0 RC2 > > > Apache - 2.0.43 > > > OpenSSL - 0.9.6g > > > > > > I'm having a rather odd problem and I can't quite put my finger on it. I > > > can verify that the apache httpd is running but I am unable to connect to > > > the box on port 80. > > > I verified that httpd.conf specifies port 80. I've verified that the > > > firewall is disabled. I can connect on other ports so I know that the > > > network settings are working properly. If someone could point out what > > > I'm missing, I'd really appreciate it. I have a feeling that it's going > > > to be a "DOH!" momemt. > > > > > > Thanks, > > > > > > Ms. Jimi Thompson > Stacey Roberts > B.Sc (HONS) Computer Science > > Web: www.vickiandstacey.com > I think I know what you are trying to say Ms. Thompson. It probably seems that you have gotten your Apache configuration to start and run, however, for whatever reason, can not seem to get the Apache Daemon to serve you a webpage. By default, unless you changed it in "/usr/local/apache/conf/httpd.conf", apache will create a socket and bind (listen) to incomming connections on Port 80. As, previously mentioned, some ISP's do block incomming Port 80 connections before they can get to your webserver, for various reasons, I won't tread into why they do that. However, even though your ISP might block the connection, that does not mean that you cannot have Apache serve you a webpage from inside your LAN. To test that Apache is up and running this is what you need know now, and the steps you should take. 1) Find out the internal IPv4 address of your webserver. (If you only have 1 internal machine behind your router you can use "127.0.0.1"). Make sure that there is a good "Route to host" from whatever your workstation might be at to the webserver, i.e. Ping the webserver make sure it responds. 2) Make sure that Apache is running. This will tell you for sure: # netstat -an | grep -i 80 You should see some output like this: tcp4 0 0 *.80 *.* LISTEN 3) If you have X Windows running, you can use your normal browser, otherwise you'll want to install "Lynx", you can find and install this port by doing the following: # cd /usr/ports/www/lynx ; make && make install 4) Then time to test to see if this really works, with your browser we need to enter the IP address of the webserver on the LAN, again, if you are going to test the webserver from your one box, "127.0.0.1" works fine. So enter this into your browser: http://the_webserver_ip_address -- Possibly could look somthing like this: http://192.168.1.2 -- or -- http://127.0.0.1 If you did install Lynx to use it from the command line: # /usr/local/bin/lynx http://your_webserver_ip_address or # /usr/local/bin/lynx http://127.0.0.1 Hopefully you got something back on this request, if not, something might be incorrect with your Apache config. If you did get back a default webpage or what you did expect from this request (one of your own webpages perhaps), thats good, it means that everything is just fine with Apache. 5) Now all you need to do to get around your ISP's blocking of Port 80 is just stop apache: # /usr/local/apache/bin/apachectl stop then edit the "/usr/local/apache/conf/httpd.conf" file and change the line that now specifies Port 80 and change it to something else, many people use Port 8080 as an alternative. Then just start Apache again: # /usr/local/apache/bin/apachectl start Check to make sure that your listening on the correct port: # netstat -an | grep -i 8080 tcp4 0 0 *.8080 *.* LISTEN Thats all! Hope that'll get you going in the right direcetion. ~Shane pgp key: http://www.freebsdhackers.net PS: Stacey Roberts posted some good information about why your internal name resolution might not work, read up on /etc/hosts and BIND to solve thoes problems if they exist. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE+CeDBtGSLUf7ussURAr3fAJ0UqgQfsBwxPlZMJUGFSnbEyyh+YACfZUPH L+H+NuUS4MOUU2CuqW6Ylww= =Hg6A -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message