Skip to content

Instantly share code, notes, and snippets.

View kingoamino's full-sized avatar

Aboumerrouane Mohamed Amine kingoamino

View GitHub Profile
@kingoamino
kingoamino / Inst_Apach_cent.sh
Last active April 5, 2020 17:54
install Apach on Centos
# Install Apache
yum update -y
yum install httpd -y
systemctl start httpd.service
# Enable Apache to start at server boot
systemctl enable httpd.service
# for EC2 & RDS Database
setsebool httpd_can_network_connect_db 1
@kingoamino
kingoamino / Config_MySQL.sh
Last active April 5, 2020 16:15
Configuration MySQL
# Show the default password for root user
grep "A temporary password" /var/log/mysqld.log
# MySQL Secure Installation
mysql_secure_installation
# Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
@kingoamino
kingoamino / Inst_MySQL_CentOS.sh
Last active April 5, 2020 16:49
Install MySQL on CentOS
# Setup Yum repository
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
# Install MySQL 8 Community Server
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
# Install MySQL
yum --enablerepo=mysql80-community install mysql-community-server -y
# Start MySQL Service
@kingoamino
kingoamino / Install_PHP7.sh
Last active April 5, 2020 17:20
Install PHP 7.3 on CentOS
#Update CentOS
Yum -y update
# Install Wget
yum -y install wget
# Enable the PHP 7.3 Remi repository
wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
@kingoamino
kingoamino / info.php
Last active April 20, 2020 12:06
Check PHP APACH
echo "<?php phpinfo(); ?>" > /var/www/html/info.php
@kingoamino
kingoamino / WordPress.sh
Created April 5, 2020 17:07
install Wordpress
# install git
yum -y install git
# clone WordPress from repo
git clone https://github.com/WordPress/WordPress.git
@kingoamino
kingoamino / DumpMySQL.sh
Last active April 5, 2020 18:46
Back UP database
# Create a dump to Dump_date.sql
mysqldump --databases -h 'host_DB' 'DataBase name' -u 'User' -p 'Passwd' > /var/www/BackUP/Dump_$(date +"%m-%d-%y").sql
@kingoamino
kingoamino / Zip WordPress
Created April 5, 2020 19:05
Compression du projet
zip -r /var/www/BackUP/wordpress-$(date +"%m-%d-%y").zip /var/www/html/WordPress
@kingoamino
kingoamino / Conf_SFTP
Last active July 1, 2020 13:23
Installation et configuration SFTP
** 1. SFTP Installation **
---- $ rpm -qa|grep ssh
** 2. SFTP Configuration **
Create sftp folder
---- $ mkdir -p /var/sftp
---- $ chmod 755 /var/sftp
@kingoamino
kingoamino / Users EC2 AWS
Last active April 20, 2020 14:59
Default ssh Usernames For Connecting To EC2 Instances
----------------------------------------------------------------------------------------
OS/Distro | Official AMI | Legacy / Community / Other AMI ssh Username |
----------------------------------------------------------------------------------------
Amazon Linux | ec2-user | |
Ubuntu | ubuntu | root |
Debian | admin | root |
RHEL 6.4 and later | ec2-user | |
RHEL 6.3 and earlier | root | |
Fedora | fedora | ec2-user, root |
Centos | centos | root |