by Mohamad Zulfahmy | 26/04/2018 | Scripts
# Allow specific IP on admin page
< IfModule mod_rewrite.c >
RewriteEngine on
RewriteCond %{REQUEST_URI} ^ ( . *) ?admin/ * [OR]
RewriteCond %{REQUEST_URI} ^ ( . *) ?admin/login $ [OR]
RewriteCond %{REQUEST_URI} ^ ( . *) ?admin/dashboard $
RewriteCond %{REMOTE_ADDR} !^111.111.111.111 $
RewriteCond %{REMOTE_ADDR} !^222.122.222.222 $
RewriteCond %{REMOTE_ADDR} !^333.333.333.333 $
#This will redirect /404 page
RewriteRule ^ ( . *)$ - [R=404,L]
< /IfModule >
by Mohamad Zulfahmy | 26/04/2018 | Linux
First update the server.
yum update -y ; yum upgrade -y
Install MariaDB and start the server (as root)
yum install mariadb-server
systemctl start mariadb
To check MariaDB status
The output should be like this
Dec 01 19 :06:20 centos-512mb-sfo2-01 systemd[ 1 ]: Started MariaDB database server.
To enable MariaDB on boot simply
To secure MariaDB install
mysql_secure_installation
Testing the installation
mysqladmin -u root -p version
by Mohamad Zulfahmy | 26/04/2018 | Scripts
#!/bin/bash
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -F PREROUTING -t nat
iptables -t nat -F POSTROUTING -t nat
iptables -A PREROUTING -t nat -d 210.5 .46.28 -p udp --dport 53 -j DNAT --to 210.5 .47.28
iptables -A PREROUTING -t nat -d 210.5 .46.28 -p tcp -m multiport --dport 3306 ,80,443,110,2525,25,20,21,143,2222 -j DNAT --to 210.5 .47.28
iptables -A POSTROUTING -t nat -d 210.5 .47.28 -j SNAT --to 210.5 .46.28
by Mohamad Zulfahmy | 22/04/2018 | Linux
yum install libcap-devel openssl-devel wget -y
yum groupinstall " Development Tools " -y
mkdir -p /usr/local/directadmin
mkdir -p /var/log/httpd
mkdir -p /etc/httpd/conf
cd /usr/local/directadmin
wget -O custombuild.tar.gz http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
tar xvf custombuild.tar.gz
cd custombuild
./build
./build set mariadb 10.2
./build set mysql_inst mariadb
./build set webserver apache
./build set apache_ver 2.4
./build set mod_ruid2 yes
./build set php1_release 5.6
./build set php1_mode mod_php
./build set php2_release no
./build mariadb
./build apache
./build curl
./build libjpeg
./build libpng
./build freetype
./build iconv
./build mcrypt
./build php
by Mohamad Zulfahmy | 21/04/2018 | Linux
Keep your file /etc/ssh/sshd-config original
Put on your ~/.bash_profile
export LANG = " en_US "
export LC_ALL = $LANG .UTF-8
Run
And select “en_US.UTF-8 “