Solved

Mapping URLs to specific ports

Posted on 2004-04-28
5
303 Views
Last Modified: 2010-03-04
hello all,

I have set up a vhost to use port 81:

Listen 81

<VirtualHost 127.0.0.1:81>
    ServerAdmin xxx
    DocumentRoot C:/xxx
    ServerName testservername
    ErrorLog logs/ixxx
    CustomLog logs/xxx
</VirtualHost>

which is fine and I get the results I expect when I browse to http://testservername:81.

but this is not what I would like. I would like to be able to browser to http://testservername but map this request to http://testservername:81

Any ideas?

niklco
0
Comment
Question by:nikloc
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
Comment Utility
0
 
LVL 10

Expert Comment

by:Mercantilum
Comment Utility
Browsing http://testservername means that the client will try to connect to port 80.

So the request will come at your server as :80.

What you can do is
- either before the server use a router (...) to redirect requests from port 80 to 81
- use port 80 on your server:


Listen 80

NameVirtualHost *

<VirtualHost *>
    ServerAdmin xxx
    DocumentRoot C:/xxx
    ServerName testservername
    ErrorLog logs/ixxx
    CustomLog logs/xxx
</VirtualHost>

<VirtualHost *>
    ServerAdmin xxxy
    DocumentRoot C:/xxxy
    ServerName Mainserver
    ErrorLog logs/ixxxy
    CustomLog logs/xxxy
</VirtualHost>
0
 

Author Comment

by:nikloc
Comment Utility
thanks -

rama_krishna580
can't use resin.
already checked the apache docs but nothing indiciates how to map from a url that is assigned to port 80

Mercantilum -
the reason I wanted two ports is because port 80 is for internal use while port 81 is for external users and they should not be able to look at each others sites as the could if both were on port 80. It has to be highly restricted as to who can see what.
0
 
LVL 10

Accepted Solution

by:
Mercantilum earned 150 total points
Comment Utility
Yes, but you understand that a browser sending a request to a server will send it to port 80.

You'll get a physical frame going to port 80, and this is difficult to change.

- 1. one solution would be to use a "reverse" proxy (squid) on another server, so that you get a secure access on port 80 which will redirect to your web server on 81

- 2. another solution is to add an IP to use NIC (network card) on Linux/Unix, and make the second domain (test) going to this particuliar address that your process in your virtual hosts on Apache (you could even run 2 Apache, on each IP).
0
 

Author Comment

by:nikloc
Comment Utility
I understand that any request to a server would go through port 80 unless otherwise defined http://xxx:81

looks like I will just use the url with the port number defined

thanks for your help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now