Andre M
Andre M

Reputation: 7536

Having Apache httpd listen on port 80, but not started as root?

I would like to have my Apache httpd launch as non-route user (httpd) and still listen on port 80/443. This server will be running on a Linux host.

Given that the first 1024 ports are reserved, how would I go about having a reserved port handled by a non-root daemon? Alternatively, can I run my apache on a non-reserved port and have the port's traffic redirect locally to that other port?

Upvotes: 0

Views: 1744

Answers (1)

nmishin
nmishin

Reputation: 3048

You can use iptables for port redirecting:

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

Upvotes: 1

Related Questions