Virtual Server on Apache to listen on an alternate port



In the last few days, I had to set up something a bit unusual with apache. Basically the goal was to have apache listen for connections on two different ports (the standard port 80 and an alternate port 85). The problem was that I wanted different content at each port. Port 85 was to be an .htaccess redirect for another domain (with some port forwarding magic at the firewall.) Port 80 was to remain an internal intranet page. So…. this was all done with vhosts (virtual hosts.)


The previous setup had been apache for port 80 and thttpd for port 85, but there were disadvantages with that setup (thttpd didn’t support .htaccess redirects that I could see and that solution had to resort to a redirect in an html page which wasn’t as clean a redirect.) On the Mandrake based server it was fairly simple…. in /etc/httpd/2.0/conf/vhosts/Vhosts.conf I had to setup the virtual host settings (default directory/address/port to bind…)

NameVirtualhost 192.168.5.20:85
<VirtualHost 192.168.5.20:85>
Servername myserver2.lan.net
DocumentRoot /var/www/html/redirect
</VirtualHost>

And in /etc/httpd/2.0/conf/httpd2.conf, I had to add port 85 to be listened to (and uncomment the include of the Vhost file…)

Include conf/vhosts/Vhosts.conf

<IfDefine !APACHEPROXIED>
#Removed by Apache 2.0 — Port 80
Listen 80
Listen 85
</IfDefine>

There’s a good writeup at apacheweek on virtual hosts and configuring them based on ip address and port.

Related Posts

Blog Traffic Exchange Related Posts
  • Codeweavers announces 2005 and 2006 plans I saw this last week but never took the time to mention it. Codeweavers has announced their roadmap for 2005 and 2006. Codeweavers of course is the company that makes crossover office (a wine implementation to allow several windows applications to run under linux). Codeweavers is a major contributor to......
  • Mythtv remote frontend So, when I did the laptop upgrade I formated the root partition which means that working mythtv frontend was erased and it had to be set up from scratch. I had been running version 0.16 of mythtv on all the systems, but finding rpms for that older version looked challenging,......
  • chkconfig for ubuntu or other debian based linux systems As I've mentioned I've got an ubuntu based test system. Most of my linux experience has been from a red-hat derivitive-based background and for that, at the command line, you have chkconfig which is a good tool for checking the configuration of services to run at startup. It is a......
Blog Traffic Exchange Related Websites
  • Choosing Which State's 529 Plan to Use   There are tons of articles discussing which State's 529 Plan to use, however, most seem to focus on expense ratios and fund choices.  While those variables are obviously important I believe there is another issue that is often ignored.  By living in a certain State and participating in that certain State's......
  • Give Whole Life Insurance a Fair Comparison – Get Illustrations and Compare! I hope this post doesn’t end up on one of my favorite blogs, Bad Money Advice, but I wanted to actually compare some numbers for people.  Everyone, and I mean everyone tells you to stay the hell away from Whole Life Insurance, I think the main concerns are fees,......
  • Holiday Harbor, Lake Shasta Holiday Harbor is located on Lake Shasta Phone: 530.238.2383 Average Water Depth: The marina did not have a current report and this can change with the weather. Please call ahead for lake levels before you arrive. Is there a marine standby channel? No, not at this time. Is there a......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site