<commit_before>#!/bin/bash

#Update yum packages
yum -y update
#install git
yum install -y git
#install vim
yum install -y vim
#install apache
yum install -y httpd
#start apache
systemctl start httpd.service
#enable apache
systemctl enable httpd.service
#Get mariadb 10.2
echo "# MariaDB 10.2 CentOS repository list - created 2017-10-10 21:08 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" > /etc/yum.repos.d/MariaDB.repo
#Install MariaDB
yum install -y MariaDB-server MariaDB-client
#start mariaDB
systemctl start mariadb
#install mariadb
mysql_secure_installation
#Enable MariaDB
systemctl enable mariadb.service
#Configure firewall
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload


#PHP 7 configuration
#Get the repo information
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#Install php7 & modules
yum install -y php70w php70w-opcache php70w-mysql php70w-pear php70w-xmlrpc php70w-common php70w-devel php70w-intl php70w-ldap php70w-mbstring php70w-gd php70w-xml php70w-soap


#Set SElinx to permissive
echo "# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
" > /etc/selinux/config
#set selinux to permissive now
setenforce permissive

#Install and configure phpmyadmin
yum install -y epel-release
yum install -y phpmyadmin

echo "# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

      <IfModule mod_authz_core.c>
        # Apache 2.4
	<RequireAny>
	Require all granted
	Require ip 127.0.0.1
	Require ip ::1
	</RequireAny>
	</IfModule>
	<IfModule !mod_authz_core.c>
	# Apache 2.2
	Order Allow,Deny
	Allow from All
	Allow from 127.0.0.1
	Allow from ::1
	</IfModule>
	</Directory>

	<Directory /usr/share/phpMyAdmin/setup/>
	<IfModule mod_authz_core.c>
	# Apache 2.4
	<RequireAny>
	Require ip 127.0.0.1
	Require ip ::1
	</RequireAny>
	</IfModule>

	<IfModule !mod_authz_core.c>
	# Apache 2.2
	Order Deny,Allow
	Deny from All
	Allow from 127.0.0.1
	Allow from ::1
	</IfModule>
	</Directory>

													# These directories do not require access over HTTP - taken from the original
													# phpMyAdmin upstream tarball
													#
													<Directory /usr/share/phpMyAdmin/libraries/>
													    Order Deny,Allow
	Deny from All
	Allow from None
    </Directory>

	<Directory /usr/share/phpMyAdmin/setup/lib/><commit_msg>updated phpmyadmin configuration<commit_after>#!/bin/bash

#Update yum packages
yum -y update
#install git
yum install -y git
#install vim
yum install -y vim
#install apache
yum install -y httpd
#start apache
systemctl start httpd.service
#enable apache
systemctl enable httpd.service
#Get mariadb 10.2
echo "# MariaDB 10.2 CentOS repository list - created 2017-10-10 21:08 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1" > /etc/yum.repos.d/MariaDB.repo
#Install MariaDB
yum install -y MariaDB-server MariaDB-client
#start mariaDB
systemctl start mariadb
#install mariadb
mysql_secure_installation
#Enable MariaDB
systemctl enable mariadb.service
#Configure firewall
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload


#PHP 7 configuration
#Get the repo information
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#Install php7 & modules
yum install -y php70w php70w-opcache php70w-mysql php70w-pear php70w-xmlrpc php70w-common php70w-devel php70w-intl php70w-ldap php70w-mbstring php70w-gd php70w-xml php70w-soap


#Set SElinx to permissive
echo "# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
" > /etc/selinux/config
#set selinux to permissive now
setenforce permissive

#Install and configure phpmyadmin
yum install -y epel-release
yum install -y phpmyadmin

echo "# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

      <IfModule mod_authz_core.c>
        # Apache 2.4
	<RequireAny>
	Require all granted
	Require ip 127.0.0.1
	Require ip ::1
	</RequireAny>
	</IfModule>
	<IfModule !mod_authz_core.c>
	# Apache 2.2
	Order Allow,Deny
	Allow from All
	Allow from 127.0.0.1
	Allow from ::1
	</IfModule>
	</Directory>

	<Directory /usr/share/phpMyAdmin/setup/>
	<IfModule mod_authz_core.c>
	# Apache 2.4
	<RequireAny>
	Require ip 127.0.0.1
	Require ip ::1
	</RequireAny>
	</IfModule>

	<IfModule !mod_authz_core.c>
	# Apache 2.2
	Order Deny,Allow
	Deny from All
	Allow from 127.0.0.1
	Allow from ::1
	</IfModule>
	</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
	<Directory /usr/share/phpMyAdmin/libraries/>
	Order Deny,Allow
	Deny from All
	Allow from None
    </Directory>

	<Directory /usr/share/phpMyAdmin/setup/lib/>
{'fraction_non_alphanumeric': 0.09156409486640649, 'fraction_numerical': 0.029120384268988293, 'mean_word_length': 3.8282608695652174, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 45, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6847781', 'n_tokens_mistral': 2566, 'n_tokens_neox': 2290, 'n_words': 691}