- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Port redirection, iptables, apache questions?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 07:46 PM
09-18-2006 07:46 PM
Port redirection, iptables, apache questions?
I have following situation
comp_A(80.xxx.xxx.xxx)--------crossover-----comp_B (192.168.1.20)
On comp_A I have a rule
iptables -t nat -A OUTPUT -s any/0 -d 80.xxx.xxx.xxx -p tcp --dport 80 -j DNAT --to-destination 192.168.1.20
And when I enter at web browser on comp_A 80.xxx.xxx.xxx I got apache test page served on comp_b.
When I at comp_B change port server listens from default 80 to another, let say 100, and on comp_A change rule to
iptables -t nat -A OUTPUT -s any/0 -d 80.65.170.142 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.20:100 and then refresh page on comp_A I cannot get same result as before. I got
Not Found
The requested URL / was not found on this server.
Apache Server at 80.xxx.xxx.xxx Port 80
With iptables rules I redirected all http request to comp_B.
In first case everything is ok, but why this does not work ( serve me the same apache test page ) when I change port number apache listens on comp_B?
It would be very helpful if someone has a time to explain this for all of us who do not understand this.
Thank you
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 07:49 PM
09-18-2006 07:49 PM
Re: Port redirection, iptables, apache questions?
comp_B=Gentoo
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 09:50 PM
09-18-2006 09:50 PM
Re: Port redirection, iptables, apache questions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 10:04 PM
09-18-2006 10:04 PM
Re: Port redirection, iptables, apache questions?
Not Found
The requested URL / was not found on this server.
Apache Server at 192.168.1.20 Port 100
This is when I try to access from local network to http://192.168.1.20:100
When I change port number to 80 on comp_A, i got default apache test page.
I am asking this becuase I need to forward all http ( the same for https ) reqests to 80.xxx.xxx.xxx to internal web server which may use port differnet than 80, for example 100 ( or whatever else ).
I think my iptables rule is ok and it works job, but I cannot understand why I cannot access to apache test page when I change apache port number. I other words, what to do in order to get web page from apache server http:192.168.1.20:100. I do not what to change, iptables rule or something on web server?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 10:12 PM
09-18-2006 10:12 PM
Re: Port redirection, iptables, apache questions?
then you should check with netstat if apache is listening on port 100. If not then something is wrong with config.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 10:30 PM
09-18-2006 10:30 PM
Re: Port redirection, iptables, apache questions?
Not Found
The requested URL / was not found on this server.
Apache Server at 192.168.1.20 Port 100
netstat -a shows that I have connection
netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:100 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 192.168.1.20:ssh gateway-traktor:4518 ESTABLISHED
tcp 0 0 192.168.1.20:100 gateway-traktor:4217 ESTABLISHED
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2006 11:41 PM
09-18-2006 11:41 PM
Re: Port redirection, iptables, apache questions?
Syntax: Listen [ port | IP-address:port ]
Default: none
Context: server config
Status: Core
Listen can be used instead of BindAddress and Port. It tells the server to accept incoming requests (to listen) on the specified port or address-and-port combination. If the first format is used, with a port number only, the server listens on the given port on all interfaces marked as up, instead of the port given by the Port directive. If an IP address is given as well as a port, the server will listen on the given port and interface.
Multiple Listen directives may be used to specify a number of addresses and ports to listen to. The server will respond to requests from any of the listed addresses and ports.
For example, to make the server accept connections on both port 80 and port 8000, use:
Listen 80
Listen 8000
To make the server accept connections on two specified interfaces and port numbers, use
Listen 192.170.2.1:80
Listen 192.170.2.5:8000
How this works with Virtual Hosts
BindAddress and Listen do not implement Virtual Hosts. They tell the main Apache daemon process what addresses and ports to bind and listen on. If no
* Be told to Listen to the desired address and port
* Have a
Note that if the
I hope you've read this and do not have set diferent behavior for Virtual host...
also I hope you have set DocumentRoot