?
Solved

serve on two port with same apache

Posted on 2003-03-17
4
Medium Priority
?
168 Views
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?

 
0
Comment
Question by:JohnnyDog
[X]
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
4 Comments
 
LVL 15

Accepted Solution

by:
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 1.2.3.4
vhost1.server.com. IN CNAME www.server.com.
vhost2.server.com. IN CNAME www.server.com.
vhost3.server.com. IN CNAME www.server.com.

Next;

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.

--
NameVirtualHost 1.2.3.4

<VirtualHost 1.2.3.4:8080>
   DocumentRoot "/vhost1/htdocs"
   ServerName vhost1.server.com
</VirtualHost>

<VirtualHost 1.2.3.4:8080>
   DocumentRoot "/vhost2/htdocs"
   ServerName vhost2.server.com
</VirtualHost>
---
Please take a look at apache documentation on Vhost:
http://httpd.apache.org/docs/vhosts/index.html

good luck.
0
 
LVL 15

Expert Comment

by:samri
ID: 8168040
JohnnyDog,

Any good news?
0
 

Author Comment

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

Expert Comment

by:samri
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).

cheers.
0

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