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


/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.modules.d

Log files


/var/log/httpd

RHEL/CentOS 7: Setup FTP/vsftpd

RHEL/CentOS 7: Setup FTP/vsftpd


Install vsftpd


yum install vsftpd ftp -y

Edit the following file


/etc/vsftpd/vsftpd.conf

Uncomment the following

anonymous_enable=NO
ascii_upload_enable=YES
ascii_download_enable=YES
use_localtime=YES

Enable and start vsftpd


systemctl enable vsftpd
systemctl start vsftpd

Firewall


Allow connections to FTP;

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

or

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


chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

RHEL 7/CentOS 7: Install Webmin

RHEL/CentOS 7: Install Webmin


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

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

Save and exit

Get jcameron-key.asc (GPG key)


wget http://www.webmin.com/jcameron-key.asc
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

michael:$1$23586796$xETjL7YwfvvDce6jmOmfa/:0::::::::

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 255.0.0.0

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 developers.google.com


Sources:
developers.google.com
JavaScript & JQuery: Interactive Front-end Web Development - Jon Duckett

Wednesday, 27 January 2016

JavaScript - Geolocation API (Modernizr)

The Modernizr script can be found at modernizr.com





Sources:
JavaScript and JQuery interactive front-end web development by Jon Duckett
modernizr.com