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
  • 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,......
  • Clamav 0.88.1 for Mandrake 10.0 Since, I've still got a few older Mandrake 10 installs that I'm maintaining as mailservers, there aren't supported security fixes for various things anymore... Friday there was news of a new clamantivirus to fix some security flaws with 0.88, new version is 0.88.1 I've taken the cooker srpm and recompiled......
  • Scheduling tasks in linux cron Windows has scheduled tasks which most people are only halfway aware of. Linux has very powerful scheduling capabilities coming from it's unix heritage. cron is the daemon that deals with scheduled tasks under most linux distributions. There are a couple ways that you can schedule cron tasks. The first is......
Blog Traffic Exchange Related Websites
  • One Hundred Pushup Challenge -- Knee Push ups, 1 Handed Knee Pushups, and Full Push ups Well if you haven't heard by now then you aren't paying attention to the Health and Fitness blogosphere... Everyone is doing the 100 push up challenge at 100 push ups.   It is a 6 week training program geared toward a final test where 100 consecutive pushups are completed.  (My first......
  • P.E.P for Week of April 12-16, 2010 Introducing the new Prairie Eco-Thrifter Picks! Every Friday, I will be posting links to the best blog posts of the week from various frugal livers like us. Please feel free to check them out and see if there are any tips you can use. If you find any other articles......
  • Dublin Ranch Golf Course Dublin Ranch Golf Course is located in: Dublin, CA Phone: 925-556-7040 Website: http://www.dublinranchgolf.com/ Course History: This course was designed by Robert Trent Jones, Jr and offers panoramic views of the surrounding breathtaking scenery. You'll be able to spot Mount Diablo and numerous other landmarks as you complete your round. The......
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