Install and activate quota on Linux

Install the quota tools on your server.(debian – ubuntu)

sudo apt install quota

Edit your fstab file under etc folder:

/dev/sda1 / ext4 usrquota,grpquota 0 0

and remount it to take effect immediately:

sudo mount -o remount / (or whereever you want to enable)

Enable quota.This command will create two files on file system like /aquota.user and /aquota.group :

sudo quotacheck -ugm /

Activate the quota

sudo quotaon -v /

 

 

 

Mount remote ftp to your server

If you use debian or ubuntu,you should install the package first.

apt-get install curlftpfs

After the installation,create a folder where will you mount to.for example /mnt/rftp

sudo mkdir /mnt/rftp

curlftp’s format and its parameters are simple.for example,we have an ftp account like olriss and password: 123x4P at 192.168.1.199

in local server,mount remote ftp with using this command

curlftpfs olriss:123x4P@192.168.1.199 /mnt/rftp/

curlftps is similar to nfs tools so you can review the mounted ftp area in your mounted drive list.so check it with “mount -a” command.

after your work is finished,you can unmount it with similar way as nfs unmounting.You won’t need all parameters to unmount,You just unmount the folder like below,

umount /mnt/rftp

 

Extending lvm disk by adding space

On Vmware Esx server,You can increase size of your virtual hard disk easily.If you use lvm for your guest os,you will need to add new virtual hard disk or just increase the size of your current disk.This guide will help you to extend size of the disk after you resize of your virtual disk by using vsphere

After increased the size on ESX ,In Linux Terminal;

rescanning the device.host id can change and it depents to your system.you must do that if you dont want to restart your guest;

echo “- – -” > /sys/class/scsi_host/host0/scan

see your disk and partitions;
fdisk -l

lets add new partitions.after you create the partition,you will need to set type of disk to 8e (LVM)
cfdisk /dev/sda (please note your new partition name sample :sda3

see your disk&partitions status again;
fdisk -l

check for available space;
df -h

scan for new partition
partprobe

create physical volume by using new partitions.(disk name may differ.)
pvcreate /dev/sda3

see your volume group and check and confirm
vgdisplay

extend your volume group
vgextend centos /dev/sda3

recheck;
pvscan

extend your logical volume with using the new part
lvextend /dev/centos/root /dev/sda3

in this point,last step may change according to your file system.if you use xfs ;
xfs_growfs /dev/centos/root

for ext4

resize2fs /dev/centos/root

finally see your new available space

df -h

Fix Apache SSL vulnerabilites

For Centos Servers;

Please add these lines to the end of /etc/httpd/conf.d/ssl.conf file and restart httpd service

<IfModule mod_ssl.c>
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2 -SSLv2 -SSLv3
</IfModule>
<IfModule mod_ssl.c>
#SSLCipherSuite HIGH:!aNULL:!MD5:!RC4-SHA:!RC4
#SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RS
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5::!RC4
</IfModule>

How to Install Maxmind module for Apache

We explain how to install maxmind apache module for geoip url filtering on Centos/Cloudlinux and Ubuntu/Debian Servers.

First install this module for Centos/Cloudlinux distro.You should install the maxmind library on your server first.After than you should install the apache extension tool (apxs) on your server too.If you don’t know how to install any software on your centos server,you can choose the easy way.I prepared a shell script which includes all requirement steps.These are below.This is the content of  “https://www.linux-destek.com/maxmind/maxmind.sh” file.Notice that it already has a compiled maxmind library which one is “.so” file.It work with newer version of Centos and Clodlinux.So you don’t have to compile it yourself.Choose is yours.

#!/bin/bash
yum -y install libmaxminddb.x86_64 libmaxminddb-devel.x86_64
wget https://www.linux-destek.com/maxmind/modmaxmind.tar.gz
tar zxvf modmaxmind.tar.gz
cd modmaxmind/
cp mod_maxminddb.so /usr/lib64/httpd/modules/
mkdir /usr/local/share/GeoIP/
cp GeoLite2-Country.mmdb /usr/local/share/GeoIP/
cp apache.conf /etc/httpd/conf.d/maxmind.conf
service httpd restart

For Centos / Cloudlinux Users download it by using wget into your server and run it.After it is downloaded.You should review the file’s content.It must be includes same lines above.

wget https://www.linux-destek.com/maxmind/maxmind.sh

Then run it as root.

/bin/bash maxmind.sh

That’s it.