Linux General
Reset mysql password
First try to see if you can login to mysql as root. ssh to root user, or su root from AD login. mysql If you get an error similar to: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Then the password is ...
Rsync over SSH
How To Use Rsync via SSH OR how to use RSync with a Remote System: Syncing to a remote system is trivial if you have SSH access to the remote machine and rsync installed on both sides. Once you have SSH access verified on between the two machines, ...
Chmod or change permissions on a directory through FTP client (FileZilla)
Every file and folder that exists on your web server has a set of attributions, or permissions, that you can change using FileZilla. These permissions are assigned and tells the web server three things about the folder or file. On a very simplistic ...
RHEL7: Disable Firewalld and replace it with Iptables.
If you don’t get used to Firewalld, you can still rely on Iptables by following the instructions below provided by the Fedora project. Procedure Install the Iptables package: # yum install -y iptables-services Disable the Firewalld service: # ...
How to force HTTPS using the .htaccess file
To force all web traffic to use HTTPS - insert the following lines of code in the .htaccess file in your website's root folder. Important:If you have existing code in your .htacess, add this above where there are already rules with a similar starting ...
Resource Monitoring with Plesk
Monitoring the resource usage on the server is vital to properly managing the system and your hosted accounts. To check the resource usage on the server you first need to log into the Plesk as the admin user. Once logged in, click Health and ...
Add Let's Encrypt to cPanel
The Let's Encrypt™ plugin allows you to automatically provision cPanel accounts with Let's Encrypt SSL certificates for sites that do not already have valid CA-signed SSL certificates. Notes: cPanel & WHM version 58.0 + Required This ...
How to install Composer in Linux
To install Composer onto a Linux server run the following commands to, in order. Download the installer to the current directory Verify the installer Run the installer Remove the installer 1)php -r "copy('https://getcomposer.org/installer', ...
Maldetect Scan Syntax
Here are some useful Maldet switches for locating and removing malware on a Linux server: To scan a folder: maldet --scan-all /path If you only want to scan some specified file types (.php for this example): maldet --scan-all ...
CMS Brute Force Protection - htaccess
Content management systems (CMS) such as Wordpress and Joomla! have become regular targets of brute force attempts. The most common way these types of attacks are performed is by hitting the wp-admin.php and administrator/index.php with thousands of ...
Updating ip table rules
When you need to add a firewall rule in Linux, you will need to edit the iptables file, which is located in /etc/sysconfig . Before you make any changes be sure to make a copy of the current iptables file in the event something happens. Once the ...
nginx general information
By default it installs to /usr/local/nginx, so to start the server run the following command: $ sudo /usr/local/nginx/sbin/nginx And to test to make sure nginx is running, point your browser to http://<your server ip>/ and you should get the "Welcome ...
SPF Records Hsphere
What are SPF records and how they are useful -- Adding SPF records in HSphere. The Sender Policy Framework (SPF) is an email verification DNS tool that prevents email spam. It validates senders' IP addresses to counteract email forging. Mail ...
MYSQL basic user permissions
Grant Different User Permissions On a MYSQL database. Here is a short list of other common possible permissions that users can enjoy. ALL PRIVILEGES- as we saw previously, this would allow a MySQL user all access to a designated database (or if no ...
Change Domain in Magento
To change the domain in a Magento installation: In the Databases section, click the phpMyAdmin icon. In the left-hand menu, click the link for your Magento database. Click the link for the core_config_data table. Look for the path fields ...
Samba Share on windows
To Share a Samba Directory on Network with Windows (network mapped drive) -- Make sure Samba is installed on the linux box first. a. Add the unix accounts on the server To add the unix accounts, use the following commands: useradd $USER passwd $USER ...
IpTables Essentials
Introduction Iptables is the software firewall that is included with most Linux distributions by default. This cheat sheet-style guide provides a quick reference to iptables commands that will create firewall rules are useful in common, everyday ...
HSphere Login Page Displaying
If your website is displaying the HSphere Login Page, add the following to .htaccess in your websites main directory. DirectoryIndex index.php index.html site-down.php
Increase FTP Quota
Login into hsphere account and navigate to FTP/User Account > FTP User > Quota > click the pencil and paper icon Enter new disk quota value and hit submit Go back to FTP User page, verify changes took effect under Quota with the newly set value ...
Joomla/WordPress/CMS Permissions
With the way that Hsphere and cPanel work in our shared environments, all CMS permissions should be set as follows: Directories - 755 Files - 644 If permissions have been changed or if you're unsure which permissions are which, you can run the ...
How To Set Up ProFTPD on CentOS 6
How To Set Up ProFTPD on CentOS 6 Download the EPEL repository that will allow us to install proftpd daemon on our VPS. # rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm Next, install proftpd with yum # yum ...
Basic IPTABLES rules
Open up ports for selected services: --------------------------- we can start adding selected services to our firewall filter. The first such thing is a localhost interface: iptables -A INPUT -i lo -j ACCEPT We tell iptables to add (-A) a rule to ...
csf bacula rules/exceptions
If you are running bacula and csf you must add an exceptions to the following IP's in /etc/csf/csf.allow and /etc/csf/csf.ignore 127.0.0.1 96.125.182.114 10.4.0.114 10.4.0.11/8 67.22.128.170/20 67.22.128.0/20 96.125.182.0/20 Finally you also need to ...
Zip
Zip Using Tar: Tell tar to c (create) an archive from the files in directory (tar is recursive by default), compress it using the z (gzip) algorithm, store the output as a f (file) named archive.tar.gz, and v (verbosely) list all the files it ...
WordPress
WordPress Install Linux: wget --no-check-certificate http://wordpress.org/latest.tar.gz Then unzip the package tar -xzvf latest.tar.gz The WordPress package will extract into a folder called wordpress in the same directory that you downloaded. ...
apf ports management
Once in your server, open the following file in your favorite text editor: /etc/apf/conf.apf Use your editor’s search function to find the following line: # Common inbound (ingress) TCP ports IG_TCP_CPORTS="20,21,22,25,53,80,110,143,443,465,993,995" ...
MySQL
MySQL Log into MySQL: mysql -uUSERNAME -p'PASSWORD' List Users: SELECT User FROM mysql.user; Create & Modify Users: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; Once you have ...
PHP
Php Sort PHP processes by user: Show PHP Errors: put this code at top of php page you want to test (usually index.php): error_reporting(E_ALL); ini_set('display_errors', 1);
Find
Find Find With Two Pattern Checks: find . -maxdepth 5 -type f -name "*.php" \( -exec egrep -sli "base64_decode" {} \; -false -o -exec egrep -i "base64_decode" {} \; \)
Linux
Linux System Information: Print Kernel and OS Release Versions: uname -r (or uname -a for all info) 2.6.32-531.29.2.lve1.3.11.1.el6.x86_64 cat /etc/*release* CloudLinux Server release 6.6 (Leonid Kizim) Linux Watch Limit: ...
Patching for CVE-2014-7169
Red Hat has been made aware of a vulnerability affecting all versions of the bash package as shipped with Red Hat products. This vulnerability CVE-2014-6271 could allow for arbitrary code execution. Certain services and applications allow remote ...
change permissions of all Folders and Subfolders (also works for files)
To set the permissions of all files and subfiles, or folders and subfolders run the following: Folders: find . -type d -exec chmod 0755 {} \; - Finds all units that are folders and changes permissions to 755 Files: find . -type f -exec chmod 0644 {} ...
.htaccess
.htaccess Example of URI Redirects in a WP Site: [root@ca-web1 aiglebleu.org]# cat .htaccess # Redirects <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} (entag/)(.*) RewriteRule ^(.*)entag/(.*)$ http://www.aiglebleu.org/en/$2 [NC,L] ...
Maldet Ignore Paths
If you need to Exclude/Ignore a certain path performed by maldet scan. Edit the following file : Using your Favorite Editor : vim /usr/local/maldetect/ignore_paths and add the path required for exclusion.
Find Files In Specific Range Linux
This is useful should you need to copy/search for files modified within a specified time range. The base command will be provided below, which searches from Jan 1st 2012 -> Jun 1st 2012. Modify according to your needs and filter through "cp" for file ...
PCLZIP_ERR_BAD_FORMAT (-10)
If you get a PCLZIP_ERR_BAD_FORMAT (-10) error in hsphere webshell or other wise, set following in .htaccess or php.ini: mbstring.internal_encoding = "ISO-8859-1"
Clear Cached Memory On Linux Without Reboot
If a Linux server appears to have inodes or dentries filling up cached memory, here is how you can flush it without putting the server through a reboot. This will only work with linux kernels equal to or greater then version 2.6.16+ which was ...
How to check if Perl module is installed
To verify if a specific perl module is installed on the server/ready for use, you can execute this command from shell: perl -e "use Themodulename::Here" For example, let's test if Zlib is installed "A core Perl module installed by default on all ...
Extract IPV4 IP Addresses out of file
Here's a very helpful method we can use to extract all IPV4 addresses out of a file, such as httpd.conf for for example. sed -n 's/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/\nip&\n/gp' /pathtofilehere | sed 's/ip//' Running it on my local resolv.conf file, ...
Setting up APC w/ Custom Configs outside of H-Sphere
To set up APC outside of H-Sphere is actually fairly simple to do, you just need to create the following file (ensuring that Zend and APC are turned off in H-Sphere CP under P.Servers): /hsphere/local/config/httpd2/php5/php.d/apc.ini and populate it ...
Next page