0

I have virtual hosting server running OpenLiteSpeed via CyberPanel on my local machine in Windows 11 WSL2 for web developing. I'm accessing multiple websites using local domains, such as testsite1.priv, instead of localhost/testsite1 or 127.0.0.1/testsite1. The localhost mappings are done in WSL2 Ubuntu etc/hosts and Windows c:\windows\system32\drivers\etc\hosts files like that:

127.0.0.1 testsite1.priv
127.0.0.1 testsite2.priv

I use 80 port for listening in OpenLiteSpeed server. So I just enter testsite1.priv in Chrome and local site works fine in Windows.

But how to make site accessible to public from my local machine using ngrok or pagekite? What command line has to be for ngrok or pagekite? I tried commands:

ngrok http http://testsite1.priv:80
or
ngrok http http://testsite1.priv
or
ngrok http testsite1.priv

Following ngrok generated link I get html footer from OpenLiteSpeed server, but page content is:

    404
Not Found
The resource requested could not be found on this server!

P.S. I'm new to hosting and tunneling software. Trying to figure out the most convenient workflow for me. And I'm not stuck to only ngrok and pagekite, just these are most popular now.

Thanks for any help! Don't say that's impossible :D

Solution! Ok. I finally googled the answer. The ngrok command has to be for me:

ngrok http -host-header=rewrite testsite1.priv:80

For PageKite:

pagekite.py 80 xxxxxx.pagekite.me +rewritehost=testsite1.priv

xxxxxx - your PageKite free subdomain

IDontKnow
  • 33
  • 4
  • Maybe it's a port conflict? What's the output if you run "ngrok http 8888"? – Eric Nov 09 '21 at 01:40
  • "ngrok http 8888" generated link gives: Failed to complete tunnel connection The connection to 2683-xx-xx-xx-188.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:8888. Make sure that a web service is running on localhost:8888 and that it is a valid address. The error encountered was: dial tcp [::1]:8888: connectex: No connection could be made because the target machine actively refused it. – IDontKnow Nov 09 '21 at 05:46
  • Good finding, glad to know you managed to fix the issue – Eric Nov 10 '21 at 05:41

0 Answers0