Download files from server with WHM - backup

I use a server with WHM. I created monthly backup, it makes full server backup to /backup folder. I can create targz file with SSH, I know how to download gziped file with pscp, but I don't know how to download it from server with link in browser. I think it's possible, because sysadmin before me did it.
Can anybody help me with that?

You want to generate a link that you can access through your browser and will be served up by the web server? (your question is a little vague)
These files are stored out of the standard web directories so you could create a symlink in the public_html folder of your website to /backups and call it something obscure so it can't be easily scraped.
So for example public_html/my-secure-backup-folder can be a symlink to /backups.
Guide on creating a symlink here: https://www.namecheap.com/support/knowledgebase/article.aspx/9561/29/how-to-create-a-symbolic-link-in-cpanel

Easiest way to proceed:
Ssh to your WHM server then decide which cpanel account you need to backup. Create a full backup for that cpanel:
cd /home/cpaneluser/public_html
/script/pkgacct cpaneluser /home/cpaneluser/public_html
chown cpaneluser:cpaneluser /home/cpaneluser/public_html/cpmove-cpaneluser.tar.gz*
Then you can download the backup using your web browser by accessing your cPanel user's domain -> http://domain.tld/cpmove-cpaneluser.tar.gz
If you don't know the actual domain for that cPanel user you can do a cat /etc/userdomains | grep cpaneluser. It will show the configure domain for that account.
That would be all.
Alternatively you can login to the cPanel account using your web browser -> http://domain.tld/cpanel using the user/password combination for that cPanel account. There is a full backup function there (in the cPanel web interface) that does pretty much what I have explained earlier.

Related

cPanel / WHM restore from backup tar archive (from another cPanel server)

I am quite new to server migrations, but fairly familiar with cPanel though. My current task is to migrate an entire website from a server with cPanel to another one.
What I did so far:
Use the Backup Wizard on the old server to create a full backup archive, and FTP it to the new server.
The full archive (about 6 GB because there are a lot of images) is now in my new server's public_html directory.
Now, what I need is a way to make the server take this tar archive, which is a full backup, and restore from it.
What I tried:
I tried simply extracting the archive, but it is taking forever to finish (again the archive is 6 GB), and for some reason my browser tab has to stay open until the end of the process, otherwise the extracting halts.
Also, as I have WHM access, I tried the "Restore a Full Backup/cpmove File" option, but for some reason, under the "Username for the account that you wish to restore:" textbox, WHM does not find my cPanel username.
If anyone can either tell me what I am doing wrong, or propose another option, I would really appreciate it.
P.S.: I only have WHM access to the new server, not the old one.
Edit: I got the WHM method working now. My mistake was that my tar archive was not stored in the /home directory, but in the home directory of the cPanel user (which is /home/username)!
Move your cpanel full backup file to /home directory and if you root have access of the server use below command as /scripts/restorepkg (cpanel username )
OR
Login to WHM with root user and go through the steps mentioned on below URL.
http://documentation.cpanel.net:8090/display/68Docs/Restore+a+Full+Backup+cpmove+File

WHM / CPANEL Server migration

Sorry about English, Actually i have been looking for best article about WHM/CPANEL server migration but i could not find yet. Hope this is the right platform.
I have one WHM/CPANEL server running with CentOS x86_64 standard. Now i want to migrate all stuff to my new high end machine.
Need to Transfer: (All accounts along with databases, Exim configuration, Tweak settings, PHP etc etc).
Note: I need step by step guide which will be highly appreciated, I am not too much technical and in learning phase so please go easy on me.
Thanks in advance.
First you need to install and setup cPanel on your new server.
After that you can migrate your all cPanel account to new server through transfer tool. WHM >> Transfers >> Transfer Tool
Here are the some useful docs.
https://documentation.cpanel.net/display/CKB/How+to+Move+All+cPanel+Accounts+from+One+Server+to+Another
cPanel setting are stored in /etc/wwwacct.conf and /var/cpanel/cpanel.config file so you can copy that setting to new server.
After the server setup is complete, you will have to recreate all the accounts you wish to move, on the server. You can create the domains in your server using the WHM and then restore the website contents manually using a FTP client(say FileZilla).
First you have to take the backup of your domain via cPanel. Please check below URL to find information regarding this:-
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/BackupWizard#Backup your entire site
Then Create the account in WHM.
Upload the contents in these newly created domain and restore them via WHM or cPanel.
To restore via WHM please follow below steps:-
Main >> Backup >> Restore a Full Backup/cpmove file
Please refer the cPanel docs link below on how to restore an account via cPanel.
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/BackupWizard#
If you have cpanel WHM server and you want to transfer your whole server accounts and websites to another WHM server then its really very easy and simple. All you need is root access of both server.
If you have set up your high end new WHM server, then login to your new WHM with root user and go to transfer tool from WHM > Transfers > Transfer Tool. It will show you fields to input the details of your low end server. Once you provide the root information of server it will fetch the accounts lists and account details. From there you can select which accounts to transfer and which to not. If you want to transfer all accounts then you can select all and proceed the transfer. It will transfer all your accounts with their current package details.
Try the cpanel transfer tool its easy and simple to understand and proceed.
https://documentation.cpanel.net/display/CKB/How+to+Move+All+cPanel+Accounts+from+One+Server+to+Another
https://documentation.cpanel.net/display/ALD/Transfer+Tool

Files owner on Joomla website

I need some suggestions about Joomla's files and folders ownership.
I'm working with a Joomla 2.5 website, hosted on a linux-apache server which hasn't suPHP module.
After one year of usage some files are owned by apache-user, and others by the ftp user.
I request to give the ownership of all files to the ftp user, but joomla (the apache user, after all) can't update system, install extensions or upload images.
How can i set the ownership of files?
Thank You
You will either need to talk to your hosting provider to change the file/folder ownership for you (which they should do), else if you are managing the server yourself , then you can do this using the following SSH command:
chgrp -R OWNER FOLDER
-R means recursive so it will also change the ownership for any sub directories and files
OWNER is the name of the server which you will need to add
FOLDER is simply the name of the folder you wish to apply this change to.
As for the command line tool, I like to use Putty
Hope this helps

Cannot change files permissions on server. Could this be because my site does not have a domain name?

I am developing a site for a client who has not decided on their domain name yet. I set up an account on a web server via WHM but have not pointed any domain names to it.
All was going well until I used a plugin (TinyMCE) to try and browse files on the server - it wouldnt work so I had a look at its script files and realised their permissions are set to not executable (644). I tired to change it to executable (755) but I get an error in my FTP clients console:
550 Could not change perms on file.js: Operation not permitted
Could this be because I am accessing the server not through a specific FTP account and so the server has locked down the files?
EG: I am using the servers IP address to access files with my FTP rather then something like:
ftp.mysite.com
Any advice on this would be great! Thanks
Yes, There is an issues with the FTP account permission. You will have to login your server with the main cPanel account user name and password OR you can chnage your file permission through cPanel >> File manager

Parallels plesk permissions accessing through FTP

Our server is running under CentOS 6 and handled over Panel Plesk 10.4.4. Structure of folders and files is created using php script. Then, when accessing through FTP we are unable to modify these folder contents previously created. When accessing it over Apache web user works without exception but not over ftp. Folders and files have 755 and 644 rights respectively. How to enable ftp acces? Thank you
EDIT: problem is that file owner and ftp are not the same but I do not know exactly how and where to attach it.
File and folders owner is psacln (gid 502) and group is apache (gid 503). Ftp users are not the same.
We add a login ftp user (also system one) to the group owner of files and folders "psacln" using usermod -a -G psacln ftpusername. Same procedure with apache group but problem persists.
The problem here would be that you probably run your site in mod_php mode. In this mode scripts are operated under Apache privileges, so all files and directories created are owned by Apache. This way the files cannot be accessed by your FTP user unless you set up 777 or 666 permissions.
I think your options could be
switch to FastCGI mode of PHP. Depending on your Plesk account privileges, you can either do it yourself in Plesk UI or will have to ask hosting provider for that.
This way your script will be operated under user privileges (same as FTP user) and there will be no problems with accessing these files through FTP. Also this option is often considered more secure.
make PHP script setting 777 permissions on your folders and 666 permissions on your files. It means you allow to modify them by everyone (so called "others"). So FTP user can modify these files as well. While this may sound insecure, but practically these files are already can be accessed from any other site on that system (if it is shared hosting server). So I don't think it will be any more insecure than the current status.
Regards