Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - FreshLondon

Pages: [1]
1
CentOS-WebPanel Bugs / Strange .bak folders
« on: November 19, 2021, 03:10:58 AM »
Hey chaps!

Around 50MB of files seem to be added daily in /usr/local/cwpsrv/var/services/, it's slowly eating through my drive space.
Could anyone please share some information on what the use of these _____.bak folders are?


If they are useful for the system, is there any way of limiting them to ..maybe two days history?
If they are not useful to the system, is there any way of disabling generating them?

Thanks in advance!

2
Backup / Backup CWP to an Amazon S3 bucket
« on: September 07, 2021, 06:23:45 PM »
Hey folks, sharing this here if anyone needs it!

I host CWP on Amazon EC2, needed a better backup solution because:
  • standard EC2 volumes are expensive.
  • cheaper (per GB) volumes for backups are minimum 500GB, so end up expensive anyway.
  • CWP native backups suck.
  • CWP backups to FTP have extreme versioning issues, the daly backup simply overwrites the previous day.

To do this, you'll need to create Amazon security credentials here: https://console.aws.amazon.com/iam/home?#/security_credentials
Go to the section titled "Access keys (access key ID and secret access key)".
Create yourself an 'access key'.

Install Amazon client on your CWP server:
Code: [Select]
# sudo yum install -y python-pip
Code: [Select]
# sudo pip install awscli
Code: [Select]
# sudo pip install futures
Code: [Select]
# pip uninstall rsa
Code: [Select]
# pip install -v rsa==4.0

Set up the Amazon connection to S3 and create a bucket
Code: [Select]
# aws configure
In here, add your access keys and AWS region like so:
Code: [Select]
AWS Access Key ID [None]: ACCESSKEYID
AWS Secret Access Key [None]: ACCESSKEY
Default region name [None]: us-west-2
Default output format [None]: json

Once set up, create your S3 bucket (replace 'servername_backups' with the name of your desired S3 bucket):
Code: [Select]
# aws s3 mb s3://servername_backups
Create a backup script (if you don't have nano, use vi instead or install nano with 'yum install nano'):
Code: [Select]
# nano backups-s3.sh
Add the backup script content, sample of mine here:
https://gist.github.com/FreshLondon/0e2bd776ba69ab542b1afef0ecdd0db9
Don't forget to add your S3 bucket name at the top of your file, and choose your /home/ directory path if it isn't standard..

Save the file, then make that script executable:
Code: [Select]
# chmod +x backups-s3.sh
Run the script:
Code: [Select]
# ./backups-s3.sh
Add a cron job for the script to run every night:
Open chrontab:
Code: [Select]
#crontab -eAdd a new line at the end fo the file:
Code: [Select]
0 3 * * * /path/to/backups-s3.sh > /dev/null 2>&1The above runs your backup script every day at 3am (according to the server’s clock).


Hope it helps!
Thanks to cinique for the original script format, modified for Amazon S3 use (and reduced a lot of the process to preserve disk space on the server doing the backup.

3
PHP Selector / PECL extensions using PHP-FPM?
« on: July 22, 2021, 07:36:58 PM »
Hi chaps,

We have a server, installed as default and then upgraded to use the PHP-FPM selector.
I'm currently tasked with installing the PHP PECL Trader extension for a project, yet installing via CLI only installs for the default PHP version (5.6) and not the FPM selected PHP version.

PHP7.4 is set as the alias in the bash profile.
Tried adding flags to the PECL install, no luck.

Going via PECL extensions on the CWP admin also shows no available extensions, I've hit a brick wall.

Any suggestions? Thanks in advance!  :)

4
How to / How to use a symlink folder for remote backups?
« on: July 04, 2021, 09:54:51 AM »
Hi chaps!

I have 2x CWP servers running, one with a huge additional backup drive.
For now let's call the new server 'ONE' and the old server with the backup drive 'TWO'.
I'd like to make use of the remote backup functionality on ONE > TWO, configured and set up remote backups.

When testing the backup, ONE logs into TWO and creates a new folder.
New folder location on TWO is /home/backupusersg/cwp_remote/
Backup works perfectly, tested and verified.

BUT, /home/ is not the backup drive.. I need to move this folder elsewhere.
I have deleted the folder /home/backupusersg/cwp_remote/, navigated to the backup drive and created /backup/backupusersg/cwp_remote/.
All good so far..

Created a symlink, so the folder in the /backup/backupusersg/cwp_remote/ now appears in the /home/backupusersg/cwp_remote/ location:
Code: [Select]
# ln -s /backup/backupusersg/cwp_remote/ /home/backupusersg/
Symlink verified here:


Original folder that was symlinked, to show permissions:


Yet when running the backup (which worked when the remote folder was not a symlink) I get:
Code: [Select]
mkdir: cannot create directory ‘cwp_remote’: Permission denied
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]


Any suggestions? I haven't configured the CWP remote backups before, advice greatly appreciated!

5
E-Mail / AutoSSL for mail only
« on: November 17, 2020, 07:22:04 PM »
Hey folks!

I'm using Cloudflare, therefore the A record for the domain and its subdomains have a SSL origin certificate from the server > Cloudflare, I do not wish to use AutoSSL for this as it will fail renewal (AutoSSL checks the IP address for the domain when issuing, this resolves at Cloudflare).

The mail.domain.com is sent via Cloudflare but not proxied/cached and just uses them for DNS.
I wish to use AutoSSL for every mail.domain.com record on every domain I have thats set up with Cloudflare, yet CWP seems to require the main domain on the certificate.

Is there a workaround for this?
Please do not suggest removing Cloudflare or temporarily disabling the DNS proxy on the main record for renewal each time, I'm looking for an automated solution that needs no interference!

It sounds like a 'must have' for CWP, I've used CWP for months now (i love it!) but the above is definitely holding CWP back.

Suggestions welcome :)

6
DNS / named cache query denied?
« on: November 16, 2020, 06:27:50 PM »
hey folks!

Using nginx+varnish+apache, seeing the following message a lot:

Code: [Select]
Nov 16 18:15:28 host named[25392]: client @0x7f378803c150 127.0.0.1#47439 (.): query (cache) './NS/IN' denied
Nov 16 18:15:28 host named[25392]: client @0x7f3788041dd0 127.0.0.1#34384 (.): query (cache) './NS/IN' denied

I'm assuming there's an entry missing in /etc/named.conf but I may be wrong, could anyone please point me in the right direction?
Any help is greatly appreciated!  :)

7
Suggestions / Export DNS records
« on: August 01, 2020, 06:54:28 PM »
although it would likely need a couple of small tweaks after importing to cloudflare, a nice export option on the DNS zone page would be nice (within user account > dns zone > selected domain).

Would save doing every domain manually, which I'm doing at the moment for about 30 domains..  :)

8
CentOS-WebPanel Bugs / Editing account shows different IP selection
« on: August 01, 2020, 03:14:00 PM »
Hey folks  :D

When creating a new user account I'm presented with two IP's to select from:
  • Public IP (What CWP lists as the 'Shared IP')
  • Private IP (What CWP lists as the 'Server IP')

When editing a user account (List accounts > edit account) I'm presented with one IP to select:
  • Private IP (What CWP lists as the 'Server IP')

I'm concerned about saving any account edits due to the IP changing, could anyone give advice on this please?
Thanks in advance!

Pages: [1]