Prevent content (files) upload to cpanel - cpanel

I am new to Management System. Now I need to control a website. Some days ago, someone hack it — not SQL injection, just file change / new files upload.
I need to know the how can I prevent it; I want to learn.
Please, can someone give me some suggestions?

To prevent this, You need to update your server security with the mod_security, Mod_security is web server firewall so you will have to install and upadte mod_sec rules on your server to prevent this,
Also, Update your site scripts and plugin and themes which you are using for your site.
Use strong password for your cPanel, FTP and site admin panel
Also, Check WHM >> Security Center >> Security Advisor and fix all the Warning which you will get in that scan report.
Install maldet on your server and scan your all user home directory and remove infected files from your account.

Related

Download files from server with WHM

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.

"Undefined" labels and buttons in the UI of SuiteCRM

A fresh installation, installed via an installer (Softaculous, to save time.)
Data seems to be correctly connected and all in the correct places. But most error messages only contain the word "undefined."
I have a feeling it's a permission problem, but the various solutions for it on forums are varied and only seem to work for a small section of people for each.
I'd rather not do a reinstall as all the old data from previous CRM is now imported.
This is running through a cPanel controlled server BTW, if that helps matters.
Yes, It's permission issues. Please update write permission for the web server user and try to delete " cache/jsLanguage/en_us.js " folder from your account.
If a Suite or Sugar install is installed on a temporary I.P whilst using cPanel, at least in our version of cPanel, it hosts the files in a temporary test folder.
Suite (specifically SugarBean.php) tries to access the folders that would exist on permanent domains. So it calls files that are hosted elsewhere on the server.
Soon as the site was pointed to a real domain, it fixed itself, no extra steps necessary, as the files were hosted in the correct place.
Thanks to the hosting company, they explained that to me. I'm not sure if that's standard procedure to store the files differently for temporary i.p addresses.
make sure you are using correct .htaccess
Go to Admin > Repair and do a "Quick Repair & Rebuild". Execute any changes shown at the bottom of the page.
If that doesn't work, go to Admin > Repair and do "Rebuild .htaccess file" and afterwards, Admin > Repair and do a "Quick Repair & Rebuild" again.

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

ModX Cache: Files Being Written with Wrong Permissions

The title doesn't really sum it all up...
I have recently installed ModX Revolution 2.2.4 on an Apache server and I am having complications with the cache folder. Occasionally I have to manually clear the cache folder via ftp, but any files written there are owned by Apache and my account can't delete them. I have tried adding the "new_file_permissions" and "new_folder_permissions" to the system settings, but there is no change. The cache files are always owned by Apache and I have no access via ftp.
Also, files such as the .htaccess and really anything I upload (css etc) are seen as uneditable to modx unless I manually change them to 777 via ftp. I can't change owner and group though.
The server tech can't figure it out. This has come up before on the modx forums but it has never been answered.
Obviously, this is a server problem.
I had this problem (with an IIS server though), and the host needed to change some of their settings.
Especially, if MODX works on your different host(s).
That is the way it is supposed to work, your FTP account does not have permission to write files written by apache, your ftp may be a member of the group but does not have write permission. [needed to delete]. I suspect this is by design for security purposes.
Your new_file_permissions, new_folder_permissions are used for the modx file manager.
So you can do a couple of things:
Run modx under fastcgi, that way the user writing the files should be the same user as the ftp user.
OR
write a little script [you can even stuff it in a snippet] that will delete the cache files for you. [since it will be running as the apache user, it should be no problem.

Where Can I get a Web Server or File Share Server?

I'm trying to publish my program so that it can get updates and am told I have to publish my changes to a web server or file share server, but I have no idea about how I can go about getting one...are there free ones that will perform what I need to accomplish?
Ok, I don't know what to do and comments seem to go ignored.
I've tried setting the publish location to sites.google.com/site/mysite.com/filecabinetpage/PQCMFILES
and I got an error saying I needed "Front Page Server Extension Capabilities".
I tried setting it to http://productivityquotient.hostzi.com/PQCMFILES/ and it told me:
Error 1 Failed to connect to 'http://productivityquotient.hostzi.com/PQCMFILES/' with the following error: Unable to create the Web site 'http://productivityquotient.hostzi.com/PQCMFILES'. An error occurred accessing your site configuration files. Authors - if authoring against a web server, please contact the webmaster for this server's site. Webmasters - please see the server's application event log for more details. 1 1 Contact Manager
I tried setting it to a directory on the microsoft site and it said: "unable to create directory. files moved" or something like that.
I can't host it on an ftp server if I intend to use the updates feature and I don't know what to do...
Maybe Microsoft's free web hosting will allow you to do this.
000webhost.com is actually a pretty reliable host, with decent and free advertisement-free hosting. It also supports typical web server things such as FTP access, cpanel and e-mail accounts.
Their limit on free hosting is basically low disk space (1.5 GB) and bandwidth (100 GB/mo) and some minor content restriction. If that seems fine for you, then I highly recommend it. Even on free accounts, their ticket response time is blazing.
NearlyFreeSpeech, while not free, lets you host your application on a pay as you go plan. There are free web-hosts, but most lack the features of costies, such as FTP access.