?
Solved

apache config: web access based on port number

Posted on 2001-09-07
3
Medium Priority
?
200 Views
Last Modified: 2013-12-16
It 's easy to set up diffrent port number for virtual server with one IP address under win2000+IIS.
For example: we can access www.mydomain.com:1234 and www.mydomain.com:6789 

But how to do this under linux+apache?
I only found article describing virtual server based on different IP or domain name. But how to setup virtual server on diffrent port?

0
Comment
Question by:ezlee
[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
  • 2
3 Comments
 
LVL 3

Expert Comment

by:jnbkze
ID: 6466510
Ezlee,

In your httpd.conf you add something like this to the end of the file and restart the apache server

<VirtualHost _default_:1080>
DocumentRoot /var/www/html/testvirt
ServerName Virttest
</VirtualHost>

The above says that it should listen for request on the default IP of your server on port 1080 and if it gets any requests, then it gets documents from /var/www/html/testvirt

The next example show if you specify an IP address

<VirtualHost 196.1.1.19:1999>
DocumentRoot /var/www/html/virtual1server
ServerName virtual1server
</VirtualHost>

This one says that it should only service requests that come in on IP 196.1.1.19 on the port 1999 and the document root for this server is /var/www/html/virtual1server

Let me know if you need any more help.
Note there are a lot of extra things you can put inbetween the <VirtualHost> </VirtualHost>

Regards,
jnbkze
0
 
LVL 3

Accepted Solution

by:
jnbkze earned 240 total points
ID: 6480217
Ezlee,

Has my suggestion helped at all?

Rgds,
Jnbkze
0
 

Author Comment

by:ezlee
ID: 6507686
Jnbkze,

sorry for my delay, I was out for long time.
yes, it helped me. Thanks.

ezlee
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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