Friday, 7 October 2016

RHEL/CentOS 7: Install Apache Web Server

RHEL/CentOS 7: Apache Web Server

Install and get required packages

yum install httpd
yum group install "Web Server"

Check Apache startup

Check if it is enabled;

systemctl is-enabled httpd

If is is disabled, issue the following commands;

systemctl enable httpd
systemctl start httpd

Aswell as systemctl you can use the following the control Apache.

apachectl stop
apachectl start
apachectl graceful

test http://ip_address or from the CLI curl ip_address

Configuration files


Log files


RHEL/CentOS 7: Setup FTP/vsftpd

RHEL/CentOS 7: Setup FTP/vsftpd

Install vsftpd

yum install vsftpd ftp -y

Edit the following file


Uncomment the following


Enable and start vsftpd

systemctl enable vsftpd
systemctl start vsftpd


Allow connections to FTP;

firewall-cmd --permanent --add-port=21/tcp


firewall-cmd --permanent --add-service=ftp

Apply rules

firewall-cmd --reload

Create user for FTP

useradd ftp_user
passwd Bffdgkldfg

Restrict FTP users to their home folders


RHEL 7/CentOS 7: Install Webmin

RHEL/CentOS 7: Install Webmin

nano /etc/yum.repos.d/webmin.repo

name=Webmin Distribution Neutral

Save and exit

Get jcameron-key.asc (GPG key)

rpm --import jcameron-key.asc

Install via YUM

yum install webmin

Open port 10000 if you have trouble accessing the url (https://ip_add:10000)

Webmin: Create user via Linux CLI

Webmin: Create user via Linux CLI

Add user and password

sudo nano /etc/webmin/miniserv.users


Link modules to user

sudo nano /etc/webmin/webmin.acl

michael: backup-config change-user webmincron usermin webminlog webmin servers acl bacula-backup init passwd quota mount fsdump ldap-client ldap-useradmin logrotate mailcap mon pam proc at cron sentry package-updates software man syslog syslog-ng system-status useradmin apache bind8 pserver dhcpd dovecot exim fetchmail frox jabber ldap-server majordomo mysql openslp postfix postgresql proftpd procmail qmailadmin mailboxes sshd samba sendmail spam squid sarg wuftpd webalizer adsl-client bandwidth ipsec krb5 firewall exports nis net xinetd inetd pap ppp-client pptp-client pptp-server stunnel shorewall shorewall6 tcpwrappers idmapd filter burner grub lilo raid lvm fdisk lpadmin smart-status time vgetty iscsi-client iscsi-server iscsi-target cluster-passwd cluster-copy cluster-cron cluster-shell cluster-software cluster-usermin cluster-useradmin cluster-webmin cfengine heartbeat shell custom file tunnel phpini cpan htaccess-htpasswd telnet status ajaxterm updown

Restart webmin

/etc/init.d/webmin restart

RHEL/CentOS 7: firewalld Basics

RHEL/CentOS 7:firewalld Basics

Install and enable firewalld

sudo yum install firewalld
sudo systemctl enable firewalld

sudo systemctl start firewalld.service
firewall-cmd --state OR systemctl status firewalld

Add rules

--permanent is needed for the rule to stay after a reload. If you remove the --permanent the rule will be lost when the firewall is restarted via a firewall reload or a server reboot.

Add an IP address

firewall-cmd --zone=public --permanent--add-rich-rule='rule family="ipv4" source address="x.x.x.x/8" reject' //Reject IP address x.x.x.x with a subnet mask for

firewall-cmd --zone=public --permanent --add-rich-rule='rule family="ipv4" source address="x.x.x.x" accept' //Accept a single IP address

Add Port/Service

firewall-cmd --zone=public --add-port=10000/tcp --permanent

firewall-cmd --zone=public --permanent --add-service=https

Remove a rule

firewall-cmd --zone=public --permanent --remove-rich-rule='rule family="ipv4" source address="x.x.x.x" accept' //Remove a rule

firewall-cmd --zone=public --permanent --remove-service=https

Make and view changes

firewall-cmd --reload
firewall-cmd --list-all

Monday, 1 February 2016

JavaScript: Google Maps API

To get your google API key you will need to register on

JavaScript & JQuery: Interactive Front-end Web Development - Jon Duckett

Wednesday, 27 January 2016

JavaScript - Geolocation API (Modernizr)

The Modernizr script can be found at

JavaScript and JQuery interactive front-end web development by Jon Duckett

Wednesday, 9 December 2015

Linux: Search files and replace x with y

This command will check all files and folders within the current directory and replace x with y

sudo find ./ -type f -exec sed -i -e 's/x/y/g' {} \;