1

I am a Windows (IIS) software engineer, but recently I've been thrown into a Linux server admin role until we can find someone to fill the position. I am not ashamed to admit I have no idea what I am doing.

Currently the problem I am trying to solve is that the server is only responding to https requests. However, we need it to respond to standard http requests as well.

We don't really have anything that needs to stay secure on its way to the requester.

I am running redhat linux with a bash shell.

If anyone could tell me how to enable http requests I would really appreciate it!

Please make sure your response is fairly step by step as I have minimal command line experience :/

9
  • I am a Windows (IIS) software engineer, but recently I've been thrown into a Linux server admin role -- Your username is perfect! LOL Oct 4, 2012 at 14:55
  • check if ipv4 is listening to all ports. run command netstat -lpt and post output
    – shorif2000
    Oct 4, 2012 at 15:43
  • Do you know if the box is running SELinux? Oct 4, 2012 at 15:49
  • First, please clarify what "not responding" means. Is the connection refused, timing out, blank page, something else? Then you can begin to determine why it is happening. Oct 4, 2012 at 15:52
  • Since you are running Red Hat I would suggest looking into the Red Hat knowledgebase if your subscription is still valid. In addition you may have access to telephone support from Red Hat where you will speak to someone who knows Linux.
    – Red Tux
    Oct 4, 2012 at 16:12

2 Answers 2

2

If your system is RHEL 6 then

iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT

should open the port for you.

If your system is RHEL 5 then

iptables -I  RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT

would be the normal way to do it.

Either way if once it's working then

service iptables-save

will save the current firewall state to /etc/sysconfig/iptables

5
  • completes successfully, but still does not connect when I try to access a page via http... maybe this is an app problem?
    – wtfcoder
    Oct 4, 2012 at 16:57
  • @wtcoder: what solved the problem - this doesn't seem like it did
    – user9517
    Oct 5, 2012 at 13:50
  • it didn't; but I am convinced the problem is with the app at this point. Your command line worked for the question I asked... when I hit the site with http it just switches to https; it's when I hit the deeper pages that this problem occurs.
    – wtfcoder
    Oct 5, 2012 at 13:58
  • @wtcoder: Ah, right - you probably have some rewriting going on in one of your configuration files in /etc/httpd... take a look at serverfault.com/search?q=apache+rewrite+http+to+https to see what you're looking for
    – user9517
    Oct 5, 2012 at 14:01
  • I don't think this is occuring in apache because it is not happening on all the pages, if it was it would do it for all pages and I would have no troubles :) In asp.net I can do this: if (!Request.IsSecure) throw new ErrorException(); I suspect something thign similar is happening in this app. My company bought a social engine running on linux thing and as the most technical person they just threw it in my lap hahaha Still have a lot to figure out
    – wtfcoder
    Oct 5, 2012 at 14:09
0

Also, as a non-root user, you cannot listen on port 80. If you wish to have your services listen on port 80, you will have to relay traffic:

$ sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
$ sudo iptables -t nat -I OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080
2
  • You assume that the webserver is Apache.
    – symcbean
    Oct 4, 2012 at 16:04
  • The webserver is apache
    – wtfcoder
    Oct 4, 2012 at 16:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .