[Tutorial]How to add 2nd IP for websites

I am stuck and don’t know what’s wrong. Here is what I have done so far:

Added IPs in Linux
Graceful restart in Webadmin → IPs showed up
Created a new website in Cyberpanel
Created listeners in Webadmin for both port 80 and 443
For the 443 listener, added
/usr/local/lsws/conf/vhosts/MYDOMAIN/privkey.pem
/usr/local/lsws/conf/vhosts/MYDOMAIN/fullchain.pem
Graceful restart in Webadmin
Installed Wordpress in Cyberpanel

When I visit the IP, I get a 404 page, so it looks to me like it’s not routed properly. A Wordpress site should show up. Am I missing something?

Type your comment> @navi said:

I am stuck and don’t know what’s wrong. Here is what I have done so far:

Added IPs in Linux
Graceful restart in Webadmin → IPs showed up
Created a new website in Cyberpanel
Created listeners in Webadmin for both port 80 and 443
For the 443 listener, added
/usr/local/lsws/conf/vhosts/MYDOMAIN/privkey.pem
/usr/local/lsws/conf/vhosts/MYDOMAIN/fullchain.pem
Graceful restart in Webadmin
Installed Wordpress in Cyberpanel

When I visit the IP, I get a 404 page, so it looks to me like it’s not routed properly. A Wordpress site should show up. Am I missing something?

I figured out that I need to add the IP to the listener to be able to reach the website directly through the IP. That doesn’t help me though. When I open the site via domain, I am still getting a 404.

hello, i have tru to add 2nd ip listener fellowing your step but i get error
This port is already in use.
when i try to add new listener with 80 port

1 Like

very nice and good

2nd IP is great idea! Thank you so much for your guide!

it’s really nice, thank you for sharing with us

Is there the possibility of pointing to another server (which is on the same network), using a subdomain, in CyberPanel?
Ex: I have a Cyber ​​server on IP 192.168.10.50 and I want the CybePanel to point to the other server using the srvcloud.mydominio.com subdomain, in 192.168.10.51

I have followed the tutorial step by step and everything seems correct.
When I visit the IP, I get a 404 page, in Cyberpanel new site show main ip,… not new ip.
I suppose that need change some file and add new ip to assign this to new site, but where?
Am I missing something?

I get this with ip a

[almalinux@vps-xxxxxxxxx ~]$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether fa:16:3e:fd:38:10 brd ff:ff:ff:ff:ff:ff
inet xxx.xx.xx.xxx/32 scope global noprefixroute eth0 (aditional ip)
valid_lft forever preferred_lft forever
inet xx.xx.xxx.xxx/32 scope global dynamic noprefixroute eth0 (main ip)
valid_lft 66203sec preferred_lft 66203sec
inet6 2001:41d0:304:200::869/56 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fefd:2910/64 scope link noprefixroute
valid_lft forever preferred_lft forever

Some help?
Thanks.

A Website can have multiple IP addresses when you hosted it at multiple locations. Why? It can be for load balancing or redundancy… Or to serve web pages based on the user location etc… If you are using Linux, you can use tools like dig to get DNS information for a specific website.

thank you for sharing with us..

A server can have multiple ips that you can use for different sites.
yes it is for following thing you mentioned

Hello gasonline, have you managed to progress on this issue?

I too have the exact same issue and looking for assistance.

Edward

No EdwardC,

No, I got no help so my solution was to switch to CWP.
If later on the Cyberpanel team implements this in the panel to make it easy to do I might come back.

Having no luck. Get “ip is already in use”.

Makes me sad that I might have to go back to CWP. CyberPanel is SO MUCH better, but not being able to easily add / assign/ use extra IP’s is crazy.

This is the hard way especially if you are juggling between dozens of websites. You can either script this or copy and paste the IPv4 configs to the IPv6 configs for the new IPv6 listeners in httpd_config.conf, like so. Note the pattern in the map sections.

listener Default {
  address                 *:80
  secure                  0
  map                     websitea.com websitea.com
  map                     subdomaina.websitea.com  subdomaina.websitea.com
}

listener Default IPv6 {
  address                 [ANY]:80
  secure                  0
  map                     websitea.com websitea.com
  map                     subdomaina.websitea.com  subdomaina.websitea.com
}

listener SSL {
  address                 *:443
  secure                  1
  keyFile                 /etc/letsencrypt/live/hostdomain.com/privkey.pem
  certFile                /etc/letsencrypt/live/hostdomain.com/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling          1
  ocspRespMaxAge          86400
  map                     websitea.com websitea.com
  map                     subdomaina.websitea.com  subdomaina.websitea.com
}

listener SSL IPv6 {
  address                 [ANY]:443
  secure                  1
  keyFile                 /etc/letsencrypt/live/websitea.com/privkey.pem
  certFile                /etc/letsencrypt/live/websitea.com/fullchain.pem
  certChain               1
  sslProtocol             24
  enableECDHE             1
  renegProtection         1
  sslSessionCache         1
  enableSpdy              15
  enableStapling          1
  ocspRespMaxAge          86400
  map                     websitea.com websitea.com
  map                     subdomaina.websitea.com  subdomaina.websitea.com
}

Ideally, CyberPanel would be updating all of this in the background. It would be running the same bit of parsing code as it already does when creating a new website and adding a new domain, except it would be adding the domain mappings to the two IPv6 listeners as well. @usmannasir, could you update the website script to add IPv6 listeners to simultaneously update them along with the IPv4 listeners? I am pushing a commit for your approval.

Don’t use CWP. It’s a steaming pile of manure. See my post here:

1 Like

Thank you very much for the information! I will get my tiny brain in gear and input the data:)

Seriously, thank you for taking the time to help.

I put up with CWP for few years because of an IT person in charge and NEVER want to return to it. Wasted a lot of hours on it. Just the thought of loading it onto a server makes my stomach upset.

Retired and on my own now and can choose what panel I want. Really like Cyberpanel but lack of support is bothersome. Thank goodness for people like yourself!

1 Like

When I tried to fill in as in the tutorial, the error message appears that both ports are in use (port 80 and 443)

i try this method getting for cyberpanel openlitespeed but getting error port already in used