arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cyberpanel with Remote Database
#1
This tutorial is aimed at Cyberpanel users  who may wish to offload database functions on a separate machine for a gain in performance. Remote database is a newer feature of cyberpanel introduced in version 2.0.2 If p4v admin to decide to create a system for users to get a second vps, it could be very useful Wink

I wrote this tutorial, however I didn't do it without some good sources:
#TLDR Check these pages and it'll give you all the information in this tutorial and then some.

https://cyberpanel.net/docs/installing-cyberpanel/
https://cyberpanel.net/docs/remote-sql-for-cyberpanel/
https://www.virtualmin.com/documentation...ase/remote
https://www.webmin.com/deb.html
https://www.digitalocean.com/community/t...d-commands

The closer the physical proximity and lower the latency between the two servers, the better the opportunity for performance gain. For those curious, the specifications of the servers used in writing this tutorial can be found here post #3

It is written using 2 servers using  ubuntu 18. It assumes you have basic knowledge of logging into your server via ssh and familiarity with the command line/terminal.

1. As always it's recommend to update the installation by running the following command from terminal on both servers:
$ apt-get update && apt-get upgrade

When your servers finish the upgrade, you'll need to set up the database server first. It will be required for cyberpanel to complete its installation. While any sql server should work, I chose to use webmin: a sturdy, lightweight open source web panel to facilitate installation and configuration of the sql server.

2. First I  download  the webmin installation:
$ wget http://www.webmin.com/download/deb/webmin-current.deb

3. Then use dpkg to start the installation.
$ dpkg -i webmin-current.deb

Oh no! The installer isn't going. We're missing dependencies!

Before I could get the webmin installation to start, here's what I had to install:
$ apt-get install perl libnet-ssleay-perl libauthen-pam-perl libpam-runtime libio-pty-perl unzip
Try running dpkg again webmin-current.deb, if it still complains about missing dependencies you might want to check here
In a few moments, if everything worked, you will be informed you can log into your webmin server at localhost:10000

4. For security reasons, I recommend creating a sudo user to login to webmin rather than using root.
$ adduser your_name
You will be asked to enter a password twice. The more complex the better. Then add this user to the list of sudoers so you can log in and work inside webmin panel.
$ usermod -aG sudo your_name

5. I recommend running webmin from a non-standard port. Webmin has been  around for years and black-hats often port scan the webmin default ports. You can edit the webmin port in the webmin conf file. look for the line that reads "port=10000" and change the number to something different.
You can edit the webmin conf file with the editor of your choice or by running:
nano /etc/webmin/miniserv.conf

For the purposes of this tutorial I'll assume you changed port=10000 to port=12345. ctrl+x will save your changes to miniserv.conf
Now restart webmin so the port change takes effect.
$ /etc/init.d/webmin restart

6. you should now be able to log into your server via webmin in the browser. Note that your browser will throw an error from self-signed ssl. This is normal. In your browser navigate to
https://123.456.789:12345
where 123.456.789 is your database server ip and 12345 is the port you used in webmin.conf

Enter in the credentials of the sudo user you created. After this you should be logged into webmin. If you've never used webmin before, you'll see lots of links on the left sidebar. Don't panic!

here's a screenshot to show you where to look and help you feel a little more comfortable:
   
7. Click on "Servers" on the left. If you see MySQL Database Server, skip this  step. It wasn't installed for me, so I had to click on "Unused Modules". Scroll down until you see MySQL Database Server. The SQL installer will take a few moments. After it completes, you may need to click "Refresh Modules" to bring it up in the "Servers" sub menu.

Now you've gotten SQL installed, but it needs to be configured.

8. From the "Server" sub menu click on "MySQL Database Server"

9. First click on "Set admin password" - I recommend you use a password generator and use a very strong password here.

10. Next click on "User permissions" then "Create a New User"

*Make sure you give the user the name root. a user named root is required by cyberpanel.
*Make sure to use a strong password
*Make sure you set "Hosts" to the IP of the server you'll use for cyberpanel installation
*Highlight all the permissions so cyberpanel can do what it needs to in the database.
Once you've got everything filled out, create your user

11.  After your remote user is created, click on Database permissions.
For Databases, select "Any"
For Username, input "root"
Hosts: The IP of your cyberpanel installation
Permissions: highlight all

12. Next, go to "Mysql Server Configuration"
For Host, use the IP of your cyberpanel installation
You may wish to change the default port: be forewarned that while this is recommended for security, it can cause complications with some web apps depending on how they're configured.
Scroll down and click "Save and Restart MySQL"

At this point your Remote database should be ready.

13. It is strongly recommended to use a firewall for increased security. I used ufw to close off all ports except those needed for sql, ssh, and webmin, and restrict access to sql to only the Cyberpanel IP.
$ apt-get install ufw
$ ufw deny all
$ ufw allow 123 //whatever port you use for ssh
$ ufw allow 12345 //webmin port
$ ufw allow from 987.654.321 to any port 54321 //cyberpanel's VPS IP, sql port

14. Now we're ready to begin the cyberpanel installation on our other server.
The only dependency I needed was curl.
$ apt-get install curl
$ sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)

This covers the installation of Cyberpanel with OpenLightSpeed WebServer. It doesn't cover the installation of Cyberpanel ENT, although they should be similar.

15. The installer will ask you if you want a full install or a custom install. I chose a custom install, because I don't want to deal with the hassle of setting up services I would prefer to offload for increased performance.

The installer will ask you if you want to install DNS, Postfix, or FTP. This tutorial does not cover the configuration of the full cyberpanel stack, only the minimum required for serving web pages. I chose no for all of these options.

16. The installer will ask you if you want to install Cyberpanel with Remote Database. Choose Yes.
The installer will ask you for the hostname of the remote database server. You can use the IP of your database server here.
The installer will ask you for a mysql port. Use 3306 if you didn't change the port in step 12. If you did, enter that port here.
The installer will ask you for a mysql user. Enter the credentials from the user created in step 10.
The installer will ask you which database has the default mysql schema: 'mysql' worked for me.

17. The installer will ask about a few more additional softwares: Redis, MemCache, Watchdog. This tutorial does not cover the configuration of these programs. I entered no for all options.

Cross your fingers and hope for the best. If everything worked properly in a few minutes the terminal will tell you how to log into your new cyberpanel installation Smile
#2
If @fitkoh says that having a database remote from the main Panel may speed things up particularly when latency is good, that is an understatement of the year.  I am a user of @fitkoh's above CyberPanel User Account, and speed of operation of my account is not only brilliant, but exceptionally brilliant.  I've been around a few years with WordPress, and my measure of speed and performance is usually how fast themes and plugins are installed, activated and updated.  This is almost instantly - like a flash.  It is something to experience.

Note also, being a minimalist goes for having EVERYTHING free as well - no subscriptions or payments made.  Fitkoh set up CyberPanel and all tools including a TLD FOR FREE.  Two VPSs were free (not from post4vps and also no posts or services needed). So was the free TLD domain from PorkBun.  For me that makes it even more unique and note worthy. Well done! Cool

For those WordPress enthusiasts who are thinking of setting up user accounts for CyberPanel you must really try out a User Account with Fitkoh if he still has User Accounts available.  

With a Cyber Panel User Account, there is no tutorial necessary.  Usually I go to YouTube for any new script experience, to get some sort of steps for how to use it, but Cyber Panel is almost like cPanel Light, with all of the essential tools, but MUCH much more user-friendly and intuitive than cPanel.  I now look at cPanel as something that has too many tools in it to the extent one can get lost in them, they may create hurdles, or just waste unnecessary time.  And for a newby to cPanel they definitely need to do some introductory courses to figure out what goes for what and how to use the tools.  Not so my Cyber Panel User Account.  I could use it right from the get go.  Intuitively.

Now one also has to add here that @fitkoh is an above average admin tech specialist.  In that he is totally detailed in everything he does.  He is a born minimalist, and so he would set up something that has all of the bare minimum tools in it, and not more than that.  So that general approach already makes for something absent of glut and messiness and greater performance and speed.  The account comes without DNS, E-Mails or FTP.

OK, so I thought I would add my own steps on the User Account as well as experience:

1. PM @fitkoh to request a User Account.  If he still has accounts available he will then get in touch with you to discuss setup.

2. One of the requirements is that you have to have a TLD domain.  So that you can set up your DNS with your Domain Registrar.  As part of being a minimalist Fitkoh created his CyberPanel without DNS, FTP and E-mails.  Just the very basic functions.  Having said that, one can easily open an E-Mail account with Zoho Mail, that can provide you with 5 free accounts, using your domain.  You don't need any FTP as CyberPanel comes with a fantastic File Manager, giving cPanel a good run for its money.  It has all of the bare essentials in it.  You can upload files to the root of your domain.  You can extract zipped folders, and zip them.  You can delete them exactly the way one can do it with cpanel. You can also edit the files, rename them etc. So no FTP needed.  Technically if you're a WordPress enthusiast like I am, you don't even need to fiddle around with the File Manager, as there is a dedicated WordPress installer that is a million times better than Softaculous.  It just asks you to complete 5 pieces of info, and then with the next click you have a WordPress site up and running.  As easy as that.

3. So the interesting issue that came up with me with creating my first WordPress site was a remote database, and up to that moment I've only worked with localhost when I created a WordPress site.  I didn't even think about it any longer.  When the WordPress install page comes up I just put in Databse name User name and password, and that should fix everything.  But in the case of the remote database, took me a little research to figure out (dumb dumb I was) that the database is different to localhost as it was a remote database.  Once Fitkoh provided the database name, everything worked perfect after that.  Note however, if you are installing a WordPress site there is an exceptionally efficient dedicated WordPress Installer in the panel that will automatically create a database for you, so no need to worry about Localhost then.  I just tried to give the File Manager and Database Panel a workout, including checking out phpmyadmin - which pretty much works like cPanel without the need to use a separate password.

4. OK.  So CyberPanel says one can only have one domain, but to be honest, one can create limitless domains (as much as space allows), so in effect it means one may have FREE limitless domains with Free CyberPanel.  It works different to cpanel in that one doesn't add the domains before one creates a Website.  The CyberPanel works with creating Websites as the main panel activity.  And during this stage one gets to add the domain one is going to use with the Website and the File Manager folder is automatically created for the domain.  When one deletes the Website, then the folder is automatically deleted from the File Manager in a very clean way.  Like with cPnael I some times found that even though I've removed the domain from the Add On Domain Panel, that the folder (although empty) was still in File Manager.  I had to go into the File Manager and remove it first, otherwise it may trip me up later.  Not so with CyberPanel.  Removal of the Website and domain is very deep and clean.

5. A learning curve for me right at the beginning was how to create DNS at my Domain Registrar.  Up to the point of having a CyberPanel Account with fitkoh, I had been using Name Servers all of the time.  So I had to figure out that in order to set up DNS with one's Domain Registrar one has to enable DNS with the Registrar (instead of custom DNS).  Prior to that I'd been using custom DNS with the Registrar, with inserting my name servers, and had done it for so long, I hadn't even thought about the fact I was using custom DNS.  At any rate, I then learned first thing one has to do is enable the Registrar's DNS for that particular domain.  I.e. click on the "Manage Domain" tool, then check that the Registrar's DNS is enabled.  One then needs to create an A Record for the Domain.  

So there we have the fastest hosting I've ever had before.  Like truly.  Click on "activate plugin", and it's a fraction of a second.  Website works very fast as well.  I'm very impressed.  So if there are any one else who wants to get a user experience with Fitkoh and has a spare TLD to try out, I recommend doing this.  Fitkoh says he could also provide a sub-domain, but the real all round user experience is with a TLD.

Below I'm showing some screen shots (summary) of my experience from point of signing in to setting up DNS with my Registrar, to installing a WordPress Installation.

1. URL: https://s0.surprising.design:8090
  User Name:  User Name
  Password:  Password

2. [Image: vUzss7e.png]

3. Navigate to Domain Registrar to set up DNS

4. Find Domain Manager Tool

5. If you were using Custom DNS before with Namecheap change it to Namecheap BasicDNS

6. Navigate to Advanced DNS (right hand most column) - navigate to Host Records and create an A Record with the IP Fitkoh will provide to you.

7. Most hosts will tell you to wait a number of hours for DNS to propagate.  With Namecheap it is fast most of the time, but one may have to wait.

8. Return to the CyberPanel User Account and click on Websites in the left hand panel - then on create Website:

[Image: Ke5wQ6c.png]

9. Complete the fields in the "Create Website" Form.  
[Image: vtySd6l.png]

10.Then click on List Websites and then "Manage" against the Website that has been newly created.  If you scroll down the new page there will be a wealth of tools you can use.  Including the WordPress Installer.
[Image: mBSjvVV.png]

11. This is the Windows that comes up - the minimum of info needed to create the WP site:
[Image: KpOSquu.png]

12. You should be up and running almost instantly.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#3
This is a really great tutorial on how to start a web site on cyberpanel. It reminds me that I need to change the default login port Smile

Thank you for sharing your experience with the shared hosting I set up.

A few words of consideration for anyone who might consider taking it for a spin.

1. I'll bet it's the fastest hosting you've ever seen. I'm seeing load times for php pages like this: Load Time: 0.0162 sec. I'm literally missing pages load by blinking.
2. It's an experimental service utilizing a lot of newer, undertested softwares: Cyberpanel, OLSWS, codoforum. It should be considered in a testing phase. I don't recommend it for production-level sites. Expect that at some point, things will break.



person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting