Page 1 of 2 12 LastLast
Results 1 to 16 of 19

Thread: Accessing multiple ports.. through port 80?

  1. #1
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre

    Accessing multiple ports.. through port 80?

    Hello,
    Just wondering if there was a way you could setup a web server, so that say if you go to a site like "example.com/test", it will take you to say... example.com:12345

    Just asking because I need to access other services on a port other than port 80. Like, example.com:80 would work, but example.com:12345 wouldn't, so by using "example.com/test" it will work the same as example.com:12345 but make it look like it is using port 80.


    Hope that makes sense :\

    Thanks!

  2. #2
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,185
    Thanks
    739
    Thanked
    1,614 times in 1,050 posts
    edit - think i've got the wrong end of what you were asking here.
    Last edited by Agent; 17-01-2007 at 11:58 PM.
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  3. #3
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS
    Quote Originally Posted by XA04 View Post
    Hello,
    Just wondering if there was a way you could setup a web server, so that say if you go to a site like "example.com/test", it will take you to say... example.com:12345

    Just asking because I need to access other services on a port other than port 80. Like, example.com:80 would work, but example.com:12345 wouldn't, so by using "example.com/test" it will work the same as example.com:12345 but make it look like it is using port 80.


    Hope that makes sense :\

    Thanks!
    you should be able to do this with apache and iptables on linux

  4. #4
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    I can get apache running fine on the server. But I'm not running Linux so I can't really do that..

    @ Agent: Don't know what you said, but it's nothing illegal I assure you

  5. #5
    Splash
    Guest
    XA04 - I'm not 100% certain what you're trying to achieve here - are you trying to present content that would normally be presented on a different port via port 80? If so I don't think it can be done. My initial thought was that you were trying to access a port via a hostname - for instance one of my webservers has www.myserver.com/cpanel which is effectively www.myserver.com:2082, but I believe this is done using (as hexxeh pointed out) iptables and apache.

  6. #6
    Member
    Join Date
    Jan 2007
    Posts
    113
    Thanks
    0
    Thanked
    0 times in 0 posts
    any httpx can do that, you can even use privoxy a web proxy and under the filter url put the url and the redirectors,

    moreover new routers can do the url redirectors as well

  7. #7
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    Quote Originally Posted by Splash View Post
    XA04 - I'm not 100% certain what you're trying to achieve here - are you trying to present content that would normally be presented on a different port via port 80? If so I don't think it can be done. My initial thought was that you were trying to access a port via a hostname - for instance one of my webservers has www.myserver.com/cpanel which is effectively www.myserver.com:2082, but I believe this is done using (as hexxeh pointed out) iptables and apache.
    Yeah, you've got the right idea there. If www.myserver.com/cpanel works basically the same as www.myserver.com:2082 then thats what I'd like to be able to do, but not for just one service, but many.

    Quote Originally Posted by gabriel View Post
    any httpx can do that, you can even use privoxy a web proxy and under the filter url put the url and the redirectors,

    moreover new routers can do the url redirectors as well
    Hmm, I'll look into that.. I want something on my server though, don't want to be using a third party website.



    But just for clarification, I would like to do this on a Windows system, not Linux.

    Thanks

  8. #8
    HEXUS.social member Agent's Avatar
    Join Date
    Jul 2003
    Location
    Internet
    Posts
    19,185
    Thanks
    739
    Thanked
    1,614 times in 1,050 posts
    Quote Originally Posted by XA04 View Post
    @ Agent: Don't know what you said, but it's nothing illegal I assure you
    ermmmmm ?
    Quote Originally Posted by Saracen View Post
    And by trying to force me to like small pants, they've alienated me.

  9. #9
    Splash
    Guest
    If that's what you're after then http://www.drewnoakes.com/snippets/C...MultiplePorts/ should help. I don't know what webserver you're running, but Apache can run on Windows, and I think that does what you need.

  10. #10
    mush-mushroom b0redom's Avatar
    Join Date
    Oct 2005
    Location
    Middlesex
    Posts
    3,494
    Thanks
    195
    Thanked
    383 times in 292 posts
    • b0redom's system
      • Motherboard:
      • Some iMac thingy
      • CPU:
      • 3.4Ghz Quad Core i7
      • Memory:
      • 24GB
      • Storage:
      • 3TB Fusion Drive
      • Graphics card(s):
      • nViidia GTX 680MX
      • PSU:
      • Some iMac thingy
      • Case:
      • Late 2012 pointlessly thin iMac enclosure
      • Operating System:
      • OSX 10.8 / Win 7 Pro
      • Monitor(s):
      • Dell 2713H
      • Internet:
      • Be+
    So you want:

    http://www.mydomain.com/directory

    to go to

    http://www.mydomain.com:25323

    Right?

    If that's the case, the easiest way is to do a HTTP redirect:

    eg:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>HTTP Redirect</title>
      <meta http-equiv="refresh" content="5; URL=http://www.mydomain.com:25323/">
    </head>
    
    <body>
      If you are not redirected in 10 seconds please click here <a href=
      http://www.mydomain.com:25323/>&quot;http://www.mydomain.com:25323/&quot;</a></h1>
    </body>
    </html>
    All webservers are basically the same regardless of port, they're probably just looking in a different DocumentRoot. You could also therefore just add a mapping for /directory which maps to c:/documents/served/on/port25323

  11. #11
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Quote Originally Posted by b0redom View Post
    So you want:

    http://www.mydomain.com/directory

    to go to

    http://www.mydomain.com:25323

    Right?

    If that's the case, the easiest way is to do a HTTP redirect:

    eg:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>HTTP Redirect</title>
      <meta http-equiv="refresh" content="5; URL=http://www.mydomain.com:25323/">
    </head>
    
    <body>
      If you are not redirected in 10 seconds please click here <a href=
      http://www.mydomain.com:25323/>&quot;http://www.mydomain.com:25323/&quot;</a></h1>
    </body>
    </html>
    All webservers are basically the same regardless of port, they're probably just looking in a different DocumentRoot. You could also therefore just add a mapping for /directory which maps to c:/documents/served/on/port25323
    That's not what he wants
    To err is human. To really foul things up ... you need a computer.

  12. #12
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    Quote Originally Posted by Splash View Post
    If that's what you're after then http://www.drewnoakes.com/snippets/C...MultiplePorts/ should help. I don't know what webserver you're running, but Apache can run on Windows, and I think that does what you need.
    Ah, yes, that looks about right! Will give that a go tonight!

    Thanks for the help.

  13. #13
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    Just noticed that the above link is for an older version of Apache, I'm using version 2.. I tried the code still, I can't uncomment the part it asks though because it doesn't exist, but I can add the bit it asks, but it doesn't do anything..

  14. #14
    Splash
    Guest
    NameVirtualHost Directive
    Description: Designates an IP address for name-virtual hosting
    Quote Originally Posted by Apache Manual page
    Syntax: NameVirtualHost addr[: port]
    Context: server config
    Status: Core
    Module: core

    The NameVirtualHost directive is a required directive if you want to configure name-based virtual hosts.

    Although addr can be hostname it is recommended that you always use an IP address, e.g.

    NameVirtualHost 111.22.33.44

    With the NameVirtualHost directive you specify the IP address on which the server will receive requests for the name-based virtual hosts. This will usually be the address to which your name-based virtual host names resolve. In cases where a firewall or other proxy receives the requests and forwards them on a different IP address to the server, you must specify the IP address of the physical interface on the machine which will be servicing the requests. If you have multiple name-based hosts on multiple addresses, repeat the directive for each address.
    Note

    Note, that the "main server" and any _default_ servers will never be served for a request to a NameVirtualHost IP address (unless for some reason you specify NameVirtualHost but then don't define any VirtualHosts for that address).

    Optionally you can specify a port number on which the name-based virtual hosts should be used, e.g.

    NameVirtualHost 111.22.33.44:8080
    That's for Apache 2 - this seems to be what you're after (I think!) - more gubbins here

  15. #15
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    That's pretty confusing - what I tried in the config file was:


    NameVirtualHost 127.0.0.1
    <VirtualHost 127.0.0.1>
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteLog "logs/rewrite_log"
    RewriteLogLevel 0
    RewriteRule ^/address(.*) http://address.com$1 [P]
    </IfModule>
    </VirtualHost>


    But I can't seem to get it to work still? When I restart Apache it starts up ok, but it's still not doing what I want..

  16. #16
    Senior Member
    Join Date
    Aug 2004
    Location
    W Yorkshire
    Posts
    5,691
    Thanks
    85
    Thanked
    15 times in 13 posts
    • XA04's system
      • Motherboard:
      • MSI X570-A Pro
      • CPU:
      • AMD Ryzen 5 3600
      • Memory:
      • Corsair 2x 8gb DDR 4 3200
      • Storage:
      • 1TB Serpent M.2 SSD & 4TB HDD
      • Graphics card(s):
      • Palit RTX 2060
      • PSU:
      • Antec Truepower 650W
      • Case:
      • Fractcal Meshify C
      • Operating System:
      • Windows 10
      • Monitor(s):
      • iiyama 34" Curved UWQHD
      • Internet:
      • Virgin 100mb Fibre
    Bump..

    Thanks

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. nics with multiple ports
    By mrk in forum PC Hardware and Components
    Replies: 6
    Last Post: 10-04-2005, 11:07 AM
  2. Port Forwarding Error
    By Spunkey in forum Networking and Broadband
    Replies: 3
    Last Post: 29-08-2004, 11:09 PM
  3. Port Forwarding (zsnes & zbattle.net)
    By Kumagoro in forum Networking and Broadband
    Replies: 2
    Last Post: 19-08-2004, 07:33 PM
  4. Start Port. End Port?
    By rough_neck in forum Networking and Broadband
    Replies: 7
    Last Post: 10-11-2003, 09:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •