Connection refused on port 81 trying to get to a CGI Script
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Connection refused on port 81 trying to get to a CGI Script
Ok here goes
Fedora 4 running on an old pentium 2. Using Squid ver 2.5 and Dansguardian 2.8.??.
I recently found a mod for dansguardian that enabled the dansguardian bypass feature. This involves presenting page with a password entry box, and then calling for a file called passwords.cgi. The script as supplied calls for this file on port 81, ie http//:192.168.0.110:81/cgi-bin/passwords.cgi . When I try this I get connection refused. I have tried redirecting port 81 to port 8080, I've tried modifying the script to use port 80, but neither worked.
I have used nmap and it does not show the port open or closed. I have edited the squid.conf to allow port 81. I restarted squid after that change (I even rebooted to be on the safe side)
Q1 Do .cgi pages have to be called via port 81?
Q2 If port 81 has to be used, what do I have to do to open it.
port 81 is used as that will be dans (i assume) running a tiny http server on the box in isolation to any exisitng apache service etc... if you have nothing on port 80 already you can probably change the dans config to use port 80 instead, or if you do have apache running you can use a proxy command within apache to internally connect a presented path in apache to redirect to another port, so the end user never hits port 81.
this generally sounds a lot like you simply have a firewall running. add port 81 to the allowed ports list and try again.
I do have apache runnig but not doing anything at present (I don't think so). The only fiewall is iptables, it have very few rules, a few to drop my kids laptop IP addresses after bedtime and two, that redirect ports 3128 and 80 to port 8080 which is what dansgaurdian is listening on.
Do i need to send iptables a command to open the port, I thought dansguardian should have probably opened the port ???
Unfortunately the forum I found the patch in appears to have gone dead as my posts there have gone un-answered for several days.
when people aren't familiar with networking there is a lot of confusion about "opening" ports and such. ports are technically "open" if an application is connected to that port and listening for incoming connections. the firewall sits infront of the application though, so if the firewall is only allowing 80 traffic through the app listening on port 81 will never see any action. the app itself should have absolutely no control whatsoever on the firewall. the idea that any server can change what ports are open on a firewall should make you feel queasy...
if you're not doing anything on apache, why is it running?? stop it! then tell dans to listen on port 80 is that's really really what you want.
1. shut down apache, and made sure it wouldn't load next reboot
2. changed dansguardian to use port 80
3. Deleted the iptables rule for port 80 to be redirected to 8080
4. Took out the :81 from the link in the html code
tested basic internet service / filtering and works fine, BUT
when I get a banned page, enter my password it still cannot load the passwords.cgi file, now it trying to find just /cgi-bin.passwords.cgi
However your suggestions have still left me with a tidier configuration so we are heading in the right direction.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.