how could we get friendly error page when we type url with wrong port to apache server on linux
I have an apache server on linux machine which开发者_Python百科 listen at: http://:8080 it will redirect to https://:8082
my question is how could we get the friendly error page when we access: http://:8082 //wrong port
till now we will have the info in web browser status bar: "waiting for http://:8082...", and no response in long time.
you know, the port 8082 is special because it is used for https connection, if we access: http://:8083, it will return with error(HTTP 400 Bad Request) quickly.
thanks, Emre
This question should propably be in serverfault but here's a reply anyway.
Multiple ways to archive what you are after, none of them which is particulary great. But if i'd really really have to do that i'd do it like this
- your website should be running with linux & you should have root access
- setup a virtual host in apache on arbituary port which will only reply with that error message about wrong port.
- setup iptables rules to forward all connection on ports x,y,z which are "wrong" ports to the port where the virtualhost you configured is running.
精彩评论