Here are some tools that can be used to sync files between 2 servers.
Category: Linux
-
VestaCP Zero-day exploit
On 07 April 2018, many servers using VestaCP got hacked. Hacker was able to get root acceess on these servers.
Hacker installed some trojan software known as Chinese Chicken that is used to DDoS other servers.
To see if your server is hacked, check if file /etc/cron.hourly/gcc.sh is present in your server.
ls -l /etc/cron.hourly/gcc.sh
You can read more about this DDoS Trojan at
https://blog.avast.com/2015/01/06/linux-ddos-trojan-hiding-itself-with-an-embedded-rootkit/
If you are running VestaCP, stop it until a solution for this exploit is released.
service vesta stop systemctl stop vesta
You can find discussion on this exploit on VestaCP form
https://forum.vestacp.com/viewtopic.php?f=10&t=16556
Once server is rooted, it is better to take backup of all your data and restore OS.
-
Create user in PostgreSQL
Method 1
To create user, become user “postgres” with
su - postgres
now run
createuser USER_NAME
Method 2
You can run following commands in psql prompt
CREATE USER USER_NAME_HERE WITH PASSWORD 'PASSWORD_HERE'; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO USER_NAME_HERE; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO USER_NAME_HERE; GRANT USAGE ON SCHEMA public TO USER_NAME_HERE;
https://www.postgresql.org/docs/8.0/static/sql-createuser.html
-
SUSE Linux Enterprise Server
SUSE Linux Enterprise Server is a commercial linux distribution available at
https://www.suse.com/products/server/
To find version, run
cat /etc/*release
Example
# cat /etc/*release SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 3 # This file is deprecated and will be removed in a future service pack or release. # Please check /etc/os-release for details about this release. NAME="SLES" VERSION="12-SP3" VERSION_ID="12.3" PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3" ID="sles" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:12:sp3" #
SUSE Linux use yast package manager.
Installing Software on SUSE Linux
To install software, you can use yast or zypper.
yast is a GUI based software. zypper is command line tool like apt/yum/dnf etc..
-
Install MongoDB in Ubuntu
To install MongoDB in Ubuntu/Debian, run
apt install mongodb
Configuration file for MongoDB is
/etc/mongodb.conf
To see status of MongoDB, run
systemctl status mongodb
To start/stop
systemctl start mongodb systemctl stop mongodb
Create a User
mongo use admin db.createUser({user: "root", pwd: "serverok123", roles:["root"]})
Now you need to enable authentication, this can be done by editing /etc/mongodb.conf
vi /etc/mongodb.conf
Uncomment the line
auth = true
Restart MongoDB
systemctl restart mongodb
Now you can login with
mongo -u "root" -p "serverok123" --authenticationDatabase "admin"
To verify all works, run some command, for example
show dbs
On Ubuntu 18.04, default MongoDB version is
ubuntu@ip-172-31-8-76:~$ mongo -u "root" -p "serverok123" --authenticationDatabase "admin" MongoDB shell version v3.6.3 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.6.3 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user Server has startup warnings: 2018-12-22T17:06:15.171+0000 I STORAGE [initandlisten] 2018-12-22T17:06:15.171+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 2018-12-22T17:06:15.171+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem > db.version() 3.6.3 >
-
Zimbra Generate DKIM Key
To generate DKIM key in Zimbra Mail server, login as user zimbra
su - zimbra
Now run
/opt/zimbra/libexec/zmdkimkeyutil -a -d DOMAIN_NAME
Example
zimbra@mail:~$ /opt/zimbra/libexec/zmdkimkeyutil -a -d serverok.in DKIM Data added to LDAP for domain serverok.in with selector 1F6B0E4C-3AA1-11E8-9B49-B0D65E0AC318 Public signature to enter into DNS: 1F6B0E4C-3AA1-11E8-9B49-B0D65E0AC318._domainkey IN TXT ( "v=DKIM1; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA354ZukWI34mIZKFM/IsKnUO6fnwhF8PLpgb2NOl687yzlxk1HYwlM7lyS9T4blAWlbOEzkdT1lLpNJRzEImrlkFzmzXaBWPSMEoJQVQgTfir6OoXoCUtwuLmPqwEftb2Th+/9Wmkh3PTc3o+x7/4kV0QMCTnJVXIFSHAfNREG8mGNPgij/iXHwbpVEi2P0UzmI/882TCEJXBry" "nKB4g5HtiOx1WUNtsKTEAyA9/5vZqsqa1RupHLOxwqyrTcNA9IL/iadOG3Q4PCXN788pQNCzpCyUQn6OQwFDy7/S345NGygd51F93NIZGmj01qWYq8VpFiNKnAOWTX9UiW27hA/QIDAQAB" ) ; ----- DKIM key 1F6B0E4C-3AA1-11E8-9B49-B0D65E0AC318 for serverok.in zimbra@mail:~$
Retrieve the DKIM Key
Use the following command to display the DKIM key for the specified domain.
/opt/zimbra/libexec/zmdkimkeyutil -q -d YOUR_DOMAIN_HERE
-
Install MATE Desktop in Ubuntu
Add PPA repo with command
apt-add-repository ppa:ubuntu-mate-dev/xenial-mate
To install MATE run
apt-get update apt-get install mate
This install was done on remote VPS with x2go server. Once install is over, i am able to connect to remote desktop using x2go client.
-
Install GeoIP PHP Module in Ubuntu
To install GeoIP php module in Ubuntu, run
apt install php-geoip
To enable module, run
phpenmod geoip
You can see the PHP module with command php -m
root@ip-172-31-26-233:~# php -m | grep geoip geoip root@ip-172-31-26-233:~#
Also it will be listed in phpinfo page.
-
xfs
xfs is default file system for RHEL 7.
To format a partition in xfs format, run
mkfs.xfs /dev/sdXX
Example
[root@ssd ~]# mkfs.xfs /dev/sdc1 meta-data=/dev/sdc1 isize=512 agcount=6, agsize=268435455 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=1464843520, imaxpct=5 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=521728, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@ssd ~]#
-
mod_fcgid: HTTP request exceeds MaxRequestLen
On a ISPConfig server with PHP running in FCGI Mode, i get following error in error_log when upload images from WordPress admin area.
[Tue Apr 03 13:45:11 2018] [warn] [client 112.133.237.47] mod_fcgid: HTTP request length 139264 (so far) exceeds MaxRequestLen (131072), referer: https://www.url.com/wp-admin/media-new.php
ISPConfig store error log for site in “log” directory in parent folder of document root. In this case, it was
/var/www/clients/client0/web1/log/error.log
To fix the error add
FcgidMaxRequestLen 1073741824
to fcgi.conf
On Ubuntu/Debian, you file location is
vi /etc/apache2/mods-available/fcgid.conf
On CentOS/RHEL
vi /etc/httpd/conf.d/fcgid.conf
-
Plesk
Plesk is a powerful web hosting control panel that allows you to easily manage your websites, domains, and email accounts. It is a user-friendly platform that simplifies the process of managing your online presence, making it accessible to users of all skill levels.
Install
- Install Plesk On Linux Server
- Plesk Install PHP
- Install ioncube on CentOS Plesk Server
- Install Redis on Plesk Debian Server
- Install Elasticsearch on Debian for Magento
- Install MagicSpam on Plesk
- Install PHP 5.6 on Debian 9 Plesk Server
- How to install WordPress in Plesk using WordPress Toolkit
- How to Install memcached on CentOS Plesk Server
General
- Find Plesk Version
- Find Plesk License key
- Plesk move vhosts folder
- Plesk Change Backup Location
- How to enable gzip on Plesk Nginx
- Uninstall ImunifyAV on Plesk Server
- Disable open_basedir in plesk server
- Migrate website using Plesk Migrator
- How to access SSH Terminal in Plesk Server
Plesk Upgrade
Plesk Server Configuration
Plesk CLI
- Change PHP version for a site in Plesk Command line
- Remove a Plesk Extension from command line
- List all installed extensions in Plesk
- Reset Plesk Administrator Password
MySQL upgrade
Plesk Errors
- CentOS 7 Plesk server DNS not starting
- Plesk mail not working 10024: Connection refused
- Plesk Mail not working amavis error
- Plesk Error: There is no IP address X in the pool
- Plesk Debian 8 General error: 23 Out of resources when opening
Plesk Port
https://IP_ADDR:8443 http://IP_ADDR:8880
Plesk Paths
/opt/plesk/php/7.0/bin/php