serve on two port with same apache

Posted on 2003-03-17
Medium Priority
Last Modified: 2010-03-04
ok..so I have vhost.server.com.  I want to run vhost.server.com:8080 that points to another directory.  Is this possible? Can someone please explain this to me?

Question by:JohnnyDog
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 15

Accepted Solution

samri earned 80 total points
ID: 8157454
Hi JohnnyDog,

You would be looking at implementing VirtualHosting with Apache.

First of all you would need to have DNS configured so that

vhost.server.com (and all other vhosts resolves to the IP address of the server).  This can be using CNAME in DNS.

For example;

www.server.com.    IN A
vhost1.server.com. IN CNAME www.server.com.
vhost2.server.com. IN CNAME www.server.com.
vhost3.server.com. IN CNAME www.server.com.


In httpd.conf, you need to bind apache to port 8080 (by default apache will listen on port 80).
Listen 80
Listen 8080

more info: http://httpd.apache.org/docs/mod/core.html#listen

Next if the Vhost section needs to be configure.
Follwing is the simple config.  Please note that most apache configuration directive could go into Vhost container.


   DocumentRoot "/vhost1/htdocs"
   ServerName vhost1.server.com

   DocumentRoot "/vhost2/htdocs"
   ServerName vhost2.server.com
Please take a look at apache documentation on Vhost:

good luck.
LVL 15

Expert Comment

ID: 8168040

Any good news?

Author Comment

ID: 8168114
yes I got it working...thanks samri!
LVL 15

Expert Comment

ID: 8171926
Johhny, great day to you!.

Glad to be able to help.

So you can accept my comment, and award a grade (as you feels right).


Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question