Online Purchases

Saturday, September 5, 2020

How to restrict wp-admin access from one IP

 How to restrict wp-admin access from one IP

As you know, wordpress is a easy to hack content management system. If you want to restric the admin area of your wordress (wp-admin), you can easily do this by adding the below line in .htaccess

Go to the folder where your blog hosts

vi .htaccess

<IfModule mod_rewrite.c>

<Files wp-login.php>

order deny,allow

deny from all

allow from 121.15.102.0/255.255.255.0    (Add your IP or range here)

</Files>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

Save the file and test.


Wednesday, August 26, 2020

How to install Mysql5.7 on Oracle linux 7

 By default Mariadb comes with Oracle linux 7. I need to have mysql on my box.


yum remove mariadb-server -y

wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

rpm -ivh mysql57-community-release-el7-8.noarch.rpm

yum install mysql-server -y

systemctl start mysqld

systemctl enable mysqld

sudo grep 'temporary password' /var/log/mysqld.log

mysql_secure_installation

Saturday, August 15, 2020

How to install jenkins on amazon linux

How to install jenkins on amazon linux

 Following this steps to install jenkins on amazon linux

Login to the server

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

yum install jenkins

sudo service jenkins start

sudo chkconfig jenkins on

Open a browser, and access http://publicip:8080

Tuesday, May 5, 2020

Qmail error while installing and configuraing

Qmail error while installing and configuraing

After installing Qmail, i tried to start qmail i got this error

[root@localhost qmail-smtpd]# qmailctl start
Starting qmail...

qmail-send supervise not running
qmail-smtpd supervise not running
qmail-pop3d supervise not running

I checked all the possible issues,

[root@localhost qmail-smtpd]# ls -l /service
total 0
lrwxrwxrwx 1 root root 32 2010-08-16 21:38 qmail-pop3d -> /var/qmail/supervise/qmail-pop3d
lrwxrwxrwx 1 root root 31 2010-08-16 21:38 qmail-send -> /var/qmail/supervise/qmail-send
lrwxrwxrwx 1 root root 32 2010-08-16 21:38 qmail-smtpd -> /var/qmail/supervise/qmail-smtpd

[root@localhost qmail-smtpd]# ps ax |grep supervise
10190 pts/1 T 0:00 supervise log
10332 pts/1 S+ 0:00 grep supervise

etc...........

Solution

'svscanboot' was not running

[root@localhost qmail-smtpd]# svscanboot &
[2] 10336
[root@localhost qmail-smtpd]# qmailctl start
Starting qmail...

Starting qmail-send
Starting qmail-smtpd
Starting qmail-pop3d

It works !!!! Seems like we have to reboot the server after installing daemontools.