Post4VPS Forum | Free VPS Provider
CyberPanel on NanoKVM's VPS - 2 Methods - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: VPS Discussion (https://post4vps.com/Forum-VPS-Discussion)
+--- Forum: Tutorials (https://post4vps.com/Forum-Tutorials)
+--- Thread: CyberPanel on NanoKVM's VPS - 2 Methods (/Thread-CyberPanel-on-NanoKVM-s-VPS-2-Methods)

Pages: 1 2


CyberPanel on NanoKVM's VPS - 2 Methods - Amresh - 07-27-2020

Hello, P4V community!
You maybe thinking about the topic name that it's insane as only 20 ipv4 ports are open and cyberpanel's port is out of that range as well as it's port cannot be changed. We are going to figure this out below.
BTW you may also be thinking about this that from nowhere this thread came out in light. I am making this thread as yesterday I tackled this problem. I wanted to install cyberpanel on nanokvm's vps. I contacted their support but they said port cannot be changed as its integrated and thus if we forcefully change the port then its going to break. 

Solution (Of which I thinked of yesterday and discussed with cyberpanel admins): As we know NanoKVM doesn't allows port out of 7801-7820 to be accessible out of the local vps network. Now you may have got the idea that what I am going to do. I am going to run cyberpanel locally on the VPS.
I am going to install a GUI environment (if it's not installed) on the supported OS and then going to install cyberpanel which can be accessible on the local network with its port. [Method -1]
OR
Why not make the network of VPS and your PC same! [Method - 2] {VPN server}
And yes when I tried this out it worked out well.  Party

**Warning**: As @"Hidden Refuge" says so I am going to say that too here that this thread is not spoon feeding! Also, the commands given below were used on CentOS, so change them according to your server OS

Prerequisites:
  • You should be aware and should be used to CyberPanel
  • Used to VNC and GUI Installation
  • Used to Linux Commands
  • etc
Moving Forward:

Method - 1
First: Installation of a GUI. (We don't need to install any VNC server as we already have a VNC server on NanoKVM)

Install epel-release first,
Code:
sudo yum install epel-release


Code:
dnf --enablerepo=epel group -y install "Xfce" "base-x"

Code:
echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc

Now, Take care that you don't restart the VPS as after you restart you will stop the GUI session and again fallback to Command Line. (So, enter the below command when you are ready for it). And yes the below command should be run through VNC as then you will directly fall from Command to the GUI session.

Code:
startx

Now exit the VNC session.


Second: Installation of CyberPanel.
Fire up your ssh and then follow the procedures which is stated on the official site.
After installation, Note all the details of the users, passwords, ports in a txt file.


Third: Accessing the Panel.
Open the VNC session again. Now we have to open firefox. (Its not already installed. To install it simply type sudo apt install firefox or sudo yum install firefox for the respective OS systems)

After opening Firefox, enter this

Code:
https://localhost:8090


And your panel will load up!

Note: This pic was taken yesterday when I was experimenting all this! (OS: CentOS 8)
[Image: J9E3ZYF.png]

Now, add a site, etc! All thing will work flawlessly! 

Method - 2{RECOMMENDED}
Note: @Neoon said that VPN for fair use is allowed. Smile
So, you can use that until you make your server open to the world. Which will cause deletion of your server Dodgy
So, If you have any doubt still then ask @Neoon through mail support!
Credits to @chanalku91 ! Wink
I tried openvpn earlier but it didn't worked as I was messing with NAT IP and Public ipv4 address.

Step-1: Installing OpenVPN server link to repository: https://github.com/Nyr/openvpn-install

Code:
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

Step-2: When Installing choose the listening port between 7801 to 7820 and then you will get a .ovpn configuration file. Now you need that file on your local desktop. First, go the file and type 
Code:
cat <your_client_name>.ovpn

This will show you the text. Just copy and paste it on your local desktop with .ovpn extension!

Step-3: Install OpenVPN Connect from OpenVPN site and open openvpn connection with that .ovpn file

Step-4: Now comes the step to access cyberpanel. You just have to go to nanokvm dashboard. At starting you will see a IP 10.0.x.x or something like this. This is your local NAT IP which is used to communicate locally. So, just copy that IP and paste it in your local browser with 8090 port at the end
And
Voila! Cyberpanel will load up!


@"hidden refuge" I tried SSH tunneling and then I tried to access the cyberpanel with NAT IP but still It didn't worked. I tried this with mozilla firefox browser. I forgot the error which was displayed. Sad

Found any error? reply below! We all will help you out Smile


RE: CyberPanel on NanoKVM's VPS - chanalku91 - 07-27-2020

some Cyberpanel features I don't think will work on NAT VPS,
and btw have you tried to access Cyberpanel through the tunnel?


RE: CyberPanel on NanoKVM's VPS - Amresh - 07-27-2020

(07-27-2020, 11:00 AM)chanalku91 Wrote: some Cyberpanel features I don't think will work on NAT VPS,
and btw have you tried to access Cyberpanel through the tunnel?

What do you mean by Tunnel? You meant something like: Accessing a webpage at some port which is between 7801-7820 which in turn will access the main cyberpanel page inside the VPS at its normal port? If This is what you are thinking then how can I implement it here?


RE: CyberPanel on NanoKVM's VPS - Mashiro - 07-27-2020

@Amresh

You can use a SSH tunnel to access local ports on the server remotely from your computer. It's SSH port forwarding via SSH tunnel. So while you cannot access the CyberPanel port via the public IP of your VPS you can access it via SSH tunnel at the normal port with your local computer IP address.

References:
- https://www.akadia.com/services/ssh_putty.html
- https://linuxize.com/post/how-to-setup-ssh-tunneling/
- https://documentation.help/PuTTY/using-port-forwarding.html


Infact you can use a SSH session with tunneling enabled as a SOCKS5 proxy for applications and browsers.


RE: CyberPanel on NanoKVM's VPS - LightDestory - 07-28-2020

You could also dockerize CyberPanel and use a reserve proxy, such as nginx, to forward a port of your choice inside the allowed range into the desired port used by CyberPanel.

I did the same to set up portainer on NanoKVM.


RE: CyberPanel on NanoKVM's VPS - Amresh - 07-28-2020

@"hidden refuge" I tried ssh tunneling. I added a socks5 proxy in mozilla with localhost as ip and the port as the source port and I opened Ipleak to check my ip after tunneling and it displayed my server IP so tunneling was okay but still when I tried to access the cyberpanel on its port it didn't showed up! Sad

(07-28-2020, 08:03 AM)LightDestory Wrote: You could also dockerize CyberPanel and use a reserve proxy, such as nginx, to forward a port of your choice inside the allowed range into the desired port used by CyberPanel.

I did the same to set up portainer on NanoKVM.

I tried to forward ports by using Firewall.

Code:
sudo firewall-cmd --zone=external --add-masquerade

sudo firewall-cmd --zone=external --add-forward-port=port=8090:proto=tcp:toport=7801:toaddr=MY_IP_ADDRESS


but still it says this 

[Image: image.png]

BTW I found this..... I haven't applied this yet..... I wanted to know the suggestions from you all first.....
[Image: image.png]


RE: CyberPanel on NanoKVM's VPS - LightDestory - 07-28-2020

I think firewall can't perform the job of a reverse proxy. Firewall doesn't care about the content of the HTTP request, which is needed by the portal.

I suggest you to look at nginx and its reverse proxy features with the directive: proxy_pass.
Look at thid doc for reference:
https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/


RE: CyberPanel on NanoKVM's VPS - Sn1F3rt - 07-28-2020

You don't actually need to change the port .. as CyberPanel creator clearly states the port 8090 is hard-coded into the backend and LiteSpeed server so it'll be extremely challenging to find and replace each instance of the port with the one you want.

There's a workaround though. Instead of changing port, make it available on a plan subdomain so that you can access it over the internet. Smile https://blog.cyberpanel.net/2018/12/25/how-to-remove-port-8090-from-cyberpanel/


RE: CyberPanel on NanoKVM's VPS - Amresh - 07-28-2020

(07-28-2020, 09:46 AM)sohamb03 Wrote: You don't actually need to change the port .. as CyberPanel creator clearly states the port 8090 is hard-coded into the backend and LiteSpeed server so it'll be extremely challenging to find and replace each instance of the port with the one you want.

There's a workaround though. Instead of changing port, make it available on a plan subdomain so that you can access it over the internet. Smile https://blog.cyberpanel.net/2018/12/25/how-to-remove-port-8090-from-cyberpanel/

I did all the steps but still I am not able to access it! Its now showing me 503 Service Unavailable. Have u faced this error? I did exactly the same thing which the blog tutorial said.

[Image: image.png]

Thnx @chanalku91 for that OpenVPN idea. It worked! I was messing with the NAT Private IP and Public Ipv4 addresses ....
Gr88 thnx!!!!!!!!!!!!!!!!!!


RE: CyberPanel on NanoKVM's VPS - chanalku91 - 07-28-2020

(07-28-2020, 11:03 AM)Amresh Wrote: I did all the steps but still I am not able to access it! Its now showing me 503 Service Unavailable. Have u faced this error? I did exactly the same thing which the blog tutorial said.

[Image: image.png]

Thnx @chanalku91 for that OpenVPN idea. It worked! I was messing with the NAT Private IP and Public Ipv4 addresses ....
Gr88 thnx!!!!!!!!!!!!!!!!!!

This problem should have been resolved, but one question popped into my head!
Do I need to try comparing SSH Tunnel with Open VPN?
because I have not tried using SSH as a VPN connection!