Adding additional IP's

Greetings.

I have two (2) extra IP4 and three (3) IP6 need to add to Cyberpanel. Have spent the last 30 minutes looking at docs and the forum with no luck. Nothing clear on how to add additional IP’s so they can be assigned to websites/domains.

Found this which looked hopeful: Page Not Found - CyberPanel Community

Moved from CWP and have been happy but need my extra IP’s active:) Unclear why extra IP’s were not added durning setup like on CWP?

Thanks in advance for any help.

Cyberpanel fetches the one IP and stores it at “/etc/cyberpanel/machineIP”, then uses it when configuring.

If you already added those IPs to your server, then you can manually create a listener and assign domains to it.

I assume that you are using a clean minimal, unmanaged VPS and not pre-installed like hostinger does.

1 - Login to your OLS control panel. User is admin, password is at /etc/cyberpanel/webadmin_passwd
2 - Left panel, go to Listeners
3 - Press the + sign to create a new listener.

Assume [::1] is one of your other IPs at this example:

imagem

Open your newly created listener, click + at virtual host mapping

Choose the domain you want to listen at that IP:

Restart OLS and that should be it.

I didn’t tested it first, just went to check.

Kinda surprising how something like that is not documented but “COMPARE X WITH XYGF CLOUD PERFORMANCE” is.

2 Likes

Thank you @tmoore for detailed walk-thru, much appreciated.

Was clean install few weeks ago and everything very smooth. OLS is entirely new to me.

Honestly have never logged into OLS. Just tried with “admin” and password from /etc/cyberpanel/webadmin_passwd. Getting “Invalid credentials.” Have to look into why but unsure how to proceed.

Run this command:

/usr/local/lsws/admin/misc/admpass.sh

Will ask you for a new user (press enter to be admin, or change to one you want) and then ask for a new password

Already tried:

[root@server2 ~]# /usr/local/lsws/admin/misc/admpass.sh

Please specify the user name of administrator.
This is the user name required to login the administration Web interface.

User name [admin]: admin

Please specify the administrator's password.
This is the password required to login the administration Web interface.

Password:
Retype password:
Administrator's username/password is updated successfully!

Still getting the invalid credentials using updated pass. Looking at webadmin_passwd, it is not being updated. Stumped.

The password you type there, is the one you use to login, it won’t update on the file

If it’s not working, try restarting it:
systemctl restart lsws

Did: systemctl restart lsws
and still getting invalid credentials using updated password.

Using https://your-server-ip:7080 which assuming would be correct since login form is showing.

Beats me why Cyberpanel does not incorporate adding extra IP’s into their backend for ease of use.

I really do appreciate your help!

Now that’s really weird o.O

This probably won’t work because I suppose the encryption keys are random but give it a go anyway:

1 - Duplicate to backup your
/usr/local/lsws/admin/conf/htpasswd

2 - Replace the content with:
admin:$1$xfnTakwY$396oXeaV/2BT9Rf9uOwsC.

3- Try login using:

admin
123456789

Did not, but a great idea:) Even did systemctl restart lsws and still invalid credentials.

This is very strange.

Check if it says anything helpfull when you reset the password at this log file:

/usr/local/lsws/logs/error.log

I do see errors, but over my head for sure. Pretty good running a VPS but old WHM guy. Here are a few rows if you can look over them and see anything, appreciate it:

2022-08-17 09:30:04.532320 [NOTICE] [154077] New litespeed process is ready, stops listeners
2022-08-17 09:30:04.532367 [INFO] [154077] Stop all listeners.
2022-08-17 09:30:04.532387 [NOTICE] [154077] Stop listener *:80, fd 11.
2022-08-17 09:30:04.532409 [NOTICE] [154077] Stop listener *:443, fd 17.
2022-08-17 09:30:04.532444 [NOTICE] [154077] Event-loop lingering done.
2022-08-17 09:30:04.532462 [NOTICE] [154077] Shut down successfully! 
2022-08-17 09:30:04.532481 [NOTICE] [154077] HttpServerImpl::releaseAll called.
2022-08-17 09:30:04.544353 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154076 !
2022-08-17 09:30:04.550663 [NOTICE] [154079] New litespeed process is ready, stops listeners
2022-08-17 09:30:04.550715 [INFO] [154079] Stop all listeners.
2022-08-17 09:30:04.550728 [NOTICE] [154079] Stop listener *:80, fd 13.
2022-08-17 09:30:04.550744 [NOTICE] [154079] Stop listener *:443, fd 19.
2022-08-17 09:30:04.550783 [NOTICE] [154079] Event-loop lingering done.
2022-08-17 09:30:04.550803 [NOTICE] [154079] Shut down successfully! 
2022-08-17 09:30:04.550820 [NOTICE] [154079] HttpServerImpl::releaseAll called.
2022-08-17 09:30:04.551267 [NOTICE] [154072] [AutoRestarter] child process with pid=154076 exited with status=0!
2022-08-17 09:30:04.551364 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154077 !
2022-08-17 09:30:04.556081 [NOTICE] [154072] [AutoRestarter] child process with pid=154077 exited with status=0!
2022-08-17 09:30:04.556190 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154078 !
2022-08-17 09:30:04.586076 [NOTICE] [154072] [AutoRestarter] child process with pid=154078 exited with status=0!
2022-08-17 09:30:04.586208 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154079 !
2022-08-17 09:30:04.607789 [NOTICE] [154074] New litespeed process is ready, stops listeners
2022-08-17 09:30:04.607860 [INFO] [154074] Stop all listeners.
2022-08-17 09:30:04.607884 [NOTICE] [154074] Stop listener *:80, fd 8.
2022-08-17 09:30:04.607911 [NOTICE] [154074] Stop listener *:443, fd 14.
2022-08-17 09:30:04.607934 [NOTICE] [154074] Stop listener *:7080, fd 33.
2022-08-17 09:30:04.607979 [NOTICE] [154074] Event-loop lingering done.
2022-08-17 09:30:04.608000 [NOTICE] [154074] Shut down successfully! 
2022-08-17 09:30:04.608020 [NOTICE] [154074] HttpServerImpl::releaseAll called.
2022-08-17 09:30:04.612429 [NOTICE] [154075] New litespeed process is ready, stops listeners
2022-08-17 09:30:04.612480 [INFO] [154075] Stop all listeners.
2022-08-17 09:30:04.612501 [NOTICE] [154075] Stop listener *:80, fd 9.
2022-08-17 09:30:04.612520 [NOTICE] [154075] Stop listener *:443, fd 15.
2022-08-17 09:30:04.612550 [NOTICE] [154075] Event-loop lingering done.
2022-08-17 09:30:04.612562 [NOTICE] [154075] Shut down successfully! 
2022-08-17 09:30:04.612575 [NOTICE] [154075] HttpServerImpl::releaseAll called.
2022-08-17 09:30:04.612868 [NOTICE] [154072] [AutoRestarter] child process with pid=154079 exited with status=0!
2022-08-17 09:30:04.612961 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154074 !
2022-08-17 09:30:04.616554 [NOTICE] [154072] [AutoRestarter] child process with pid=154074 exited with status=0!
2022-08-17 09:30:04.616635 [NOTICE] [154072] [AutoRestarter] cleanup children processes and unix sockets belong to process 154075 !
2022-08-17 09:30:04.716731 [NOTICE] [154072] [AutoRestarter] child process with pid=154075 exited with status=0!
2022-08-17 09:30:04.716951 [NOTICE] [154072] Server Stopped!
2022-08-17 09:30:07.791247 [ERROR] [154138] HttpListener::start(): Can't listen at address adminListener: Address already in use!
2022-08-17 09:30:07.791312 [ERROR] [154138] HttpServer::addListener(adminListener) failed to create new listener
2022-08-17 09:30:07.791331 [ERROR] [154138] [config:admin:listener:adminListener] failed to start listener on address *:7080!
2022-08-17 09:30:07.791369 [ERROR] [154138] [config:admin:listener] No listener is available for admin virtual host!
2022-08-17 09:30:07.791743 [ERROR] [154138] Fatal error in configuration, exit!

Hum, perhaps it’s conflicting with the added IPs?

Try editing
/usr/local/lsws/admin/conf/admin_config.conf

And at:

listener adminListener{
  address               *:7080

Change to

listener adminListener{
  address               MAIN_CYBERPANEL_IP:7080

Restarting it after

I have not added any extra ip’s. Never got that far:)

I did change *:7080 as you recommended and restarted. Still no go. Ever reset the password again and restarted. Invalid credentials.

Here are some of the last few lines of error log:

2022-08-17 09:51:45.656144 [INFO] [155927] setuid is allowed in Ext Apps
2022-08-17 09:51:45.656580 [NOTICE] [155927] [PID: 155927]: forked cgid: 155930
2022-08-17 09:51:45.656785 [INFO] [155927] Add QUIC.cloud IPs from admin/conf/quic-cloud-ips to trusted ACL ...
2022-08-17 09:51:45.656880 [INFO] [155927] Add CloudFlare Subnets to trusted ACL ...
2022-08-17 09:51:45.656975 [INFO] [155927] [PlainConf] [adminConfig:] start parsing file /usr/local/lsws/admin/conf/admin_config.conf
2022-08-17 09:51:45.657417 [INFO] [155927] [PlainConf] [adminConfig:] Finished parsing file /usr/local/lsws/admin/conf/admin_config.conf
2022-08-17 09:51:45.658025 [INFO] [155927] QuicEngine::init(), pid: 155927, log level [warn].
2022-08-17 09:51:45.661928 [INFO] [155927] [Module:mod_security] ParseConfig entry, level 1, Mod_Security v3.0.5
2022-08-17 09:51:45.662729 [INFO] [155927] [Module:mod_security] Enable flag interpreted as 1
2022-08-17 09:51:45.662744 [INFO] [155927] [Module:mod_security] setSecRule value: 
secdebugloglevel 0
secdebuglog /usr/local/lsws/logs/modsec.log
secauditengine on
secauditlogrelevantstatus "^(?:5|4(?!04))"
secauditlogparts AFH
secauditlogtype Serial
secauditlog /usr/local/lsws/logs/auditmodsec.log
secruleengine On
 , type: 1 
2022-08-17 09:51:45.662997 [INFO] [155927] [Module:mod_security] setSecRule value: /usr/local/lsws/conf/modsec/rules.conf, type: 2 
2022-08-17 09:51:45.663347 [INFO] [155927] [Module:mod_security] setSecRule value: /usr/local/lsws/conf/modsec/owasp-modsecurity-crs-3.0-master/owasp-master.conf, type: 2 
2022-08-17 09:51:45.784335 [INFO] [155927] [Module: modcompress 1.1] has been initialized successfully
2022-08-17 09:51:45.784547 [INFO] [155927] [Module: moddecompress 1.1] has been initialized successfully
2022-08-17 09:51:45.784748 [INFO] [155927] [Module: cache 1.64] has been initialized successfully
2022-08-17 09:51:45.784944 [INFO] [155927] [Module: mod_security mod_security 1.4] has been initialized successfully
2022-08-17 09:51:49.793206 [ERROR] [155927] HttpListener::start(): Can't listen at address adminListener: Cannot assign requested address!
2022-08-17 09:51:49.793270 [ERROR] [155927] HttpServer::addListener(adminListener) failed to create new listener
2022-08-17 09:51:49.793288 [ERROR] [155927] [config:admin:listener:adminListener] failed to start listener on address 104.xxx.xxx.xxx:7080!
2022-08-17 09:51:49.793307 [ERROR] [155927] [config:admin:listener] No listener is available for admin virtual host!
2022-08-17 09:51:49.793707 [ERROR] [155927] Fatal error in configuration, exit!

Wondering if maybe modsecurity is conflicting?

In that case revert the the last step to change back to *:7080.

It’s saying the port 7080 is already in use, so maybe try the good old full vps reboot to make sure it isn’t duplicated and not closing with the restart?
Sometimes old school works

Good ole hard reboot and still the same. Still showing port 7080 is already in use. Will do some googling and see if can figure this out. Hope I can, the thought of going back to CWP is upsetting my stomach :slight_smile:

2022-08-17 10:03:15.114835 [ERROR] [538] HttpListener::start(): Can't listen at address adminListener: Address already in use!
2022-08-17 10:03:15.114908 [ERROR] [538] HttpServer::addListener(adminListener) failed to create new listener
2022-08-17 10:03:15.114925 [ERROR] [538] [config:admin:listener:adminListener] failed to start listener on address *:7080!
2022-08-17 10:03:15.114941 [ERROR] [538] [config:admin:listener] No listener is available for admin virtual host!

Did a complete power down and boot - it started working? Crazy huh.

Now I will attempt to follow your instructions on adding additional ip’s.

One other question: after I “succeed in adding ip’s”, will I be able to pick one of them when adding a new website?

Old school never fails :smiling_face_with_tear:

Sadly no, you will have to manually add it to the listener at the OLS panel.
Perhaps cyberpanel team decides to add multiple IP support inside cyberpanel

Crazy that they have overlooked a standard feature. If they are going to have reseller abilities built-in and not offer multiple IP’s, never see Cyberpanel going mainstream. Even the most basic panels support multiple ip’s.

Going to mark this as resolved. Might have another question or two later but resolved in my eyes.

Thank you again for your help.

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.