The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

telnet to port 80 in CPANEL gives access to wrong account

Discussion in 'General Discussion' started by fcdev, Nov 7, 2010.

  1. fcdev

    fcdev Registered

    Joined:
    Nov 7, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    [SOLVED] telnet to port 80 in CPANEL gives access to wrong account

    I have a VPS server running CPANEL, and I am trying to write a C++ program to interract with my web site. What I need to do is download a PHP file where the URL contains data I'm sending to the site, and the contents of the downloaded file is the data received from the site.

    This all currently works on my Ubuntu test box.

    However, when I upload the PHP script into my VPS server, and change the C++ script to access the new URL, it appears to access the wrong user account.

    I can simulate this using TELNET ...

    telnet www.mydomain.com 80
    GET

    gives me the listing of files for rootaccount.mydomain.com
    what I'm trying to get is the files for www.mydomain.com
    When I access the site through a web browser, everything works as expected (retrieving files from www.mydomain.com).

    Any suggestions? Is there a command I can issue to TELNET to access the right account? How do web browsers go about accessing the correct data?

    I have noticed that this appears to be a common situation for a lot of CPANEL websites I have encountered.

    [edit] Before anyone asks ... The C++ program cannot be run from the VPS host, as it relies on a hefty GPU (video card) to perform image analyses. Just thought I'd mention that as I asked this in another forum and the thread became hijacked by a discussion of doing everything through PHP on the server, which isn't really an option.
     
    #1 fcdev, Nov 7, 2010
    Last edited: Nov 8, 2010
  2. fcdev

    fcdev Registered

    Joined:
    Nov 7, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Solved.

    For anybody else who might have this problem, the socket commands are ...

    GET /filename HTTP/1.0
    HOST: www.mydomain.com
    [enter]

    Specifying the host is what solved it. Keep in mind you need an extra new-line at the end of your query.
     
Loading...

Share This Page