Build a Centos 7 Repo Rumi, August 2, 2020 Install httpd [root@www ~]# yum -y install httpd # remove welcome page [root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf Configure httpd. Replace server name to your own environment. [root@www ~]# vi /etc/httpd/conf/httpd.conf # line 86: change to admin's email address ServerAdmin root@srv.world # line 95: change to your server's name ServerName www.srv.world:80 # line 151: change AllowOverride All # line 164: add file name that it can access only with directory's name DirectoryIndex index.html index.cgi index.php # add follows to the end # server's response header ServerTokens Prod # keepalive is ON KeepAlive On [root@www ~]# systemctl start httpd [root@www ~]# systemctl enable httpd Install other required packages. [root@dlp ~]# yum -y install rsync createrepo Create directories for repository and copy data from CentOS official Repository. Create directories [root@dlp ~]# mkdir -p /var/www/repos/centos/7/{os,updates,extras}/x86_64 [root@dlp ~]# chmod -R 755 /var/www/repos Copy from official repo [root@dlp ~]# rsync -avz --delete --exclude='repodata' \ rsync://ftp.riken.jp/centos/7/os/x86_64/ \ /var/www/repos/centos/7/os/x86_64/ [root@dlp ~]# rsync -avz --delete --exclude='repodata' \ rsync://ftp.riken.jp/centos/7/updates/x86_64/ \ /var/www/repos/centos/7/updates/x86_64/ [root@dlp ~]# rsync -avz --delete --exclude='repodata' \ rsync://ftp.riken.jp/centos/7/extras/x86_64/ \ /var/www/repos/centos/7/extras/x86_64/ Create metadata repositories [root@dlp ~]# createrepo /var/www/repos/centos/7/os/x86_64/ [root@dlp ~]# createrepo /var/www/repos/centos/7/updates/x86_64/ [root@dlp ~]# createrepo /var/www/repos/centos/7/extras/x86_64/ Add copy task to daily jobs. [root@dlp ~]# vi /etc/cron.daily/update-repo # create new #!/bin/bash VER='7' ARCH='x86_64' REPOS=(os updates extras) for REPO in ${REPOS[@]} do rsync -avz --delete --exclude='repodata' \ rsync://ftp.riken.jp/centos/${VER}/${REPO}/${ARCH}/ /var/www/repos/centos/${VER}/${REPO}/${ARCH}/ createrepo /var/www/repos/centos/${VER}/${REPO}/${ARCH}/ done [root@dlp ~]# chmod 755 /etc/cron.daily/update-repo Configure Apache httpd to provide repository for other Client Servers. [root@dlp ~]# vi /etc/httpd/conf.d/repos.conf # create new Alias /repos /var/www/repos <directory /var/www/repos> Options +Indexes Require all granted </directory> [root@dlp ~]# systemctl restart httpd If Firewalld is running, allow HTTP service. [root@dlp ~]# firewall-cmd --add-service=http --permanent success [root@dlp ~]# firewall-cmd --reload success On Client Servers, Change settings of Yum to refer to Local Yum Mirror. It’s OK all. [root@client ~]# vi /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra baseurl=http://centos.bintel.com.bd/repos/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra baseurl=http://centos.bintel.com.bd/repos/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra baseurl=http://centos.bintel.com.bd/repos/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Related Administrations Configurations (Linux) CentOSCentOS 7Repo
How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers March 24, 2021 This can be easily achieved with yum config file “/etc/yum.conf“. Under main section define the proxy settings like below: ……………… proxy=http://<Proxy-Server-IP-Address>:<Proxy_Port> proxy_username=<Proxy-User-Name> proxy_password=<Proxy-Password> ……………… Save and exit the file and start using the yum command. Sample yum Config file with proxy settings is shown below : Related Read More
Easyengine installaiton on Debian 10 August 13, 2020 Install Easyengine WordPress on a Debian 10 VM (mine was a KVM). The following procedure will install EE with following components; Docker WordPress Core MariaDB Nginx Server PHP-FPM Redis Cache Let’s encrypt SSL Install EasyEngine on Linux wget -qO ee rt.cx/ee4 && sudo bash ee ee site create your_domain –type=wp… Read More
Install and configure fail2ban January 4, 2015 Servers do not exist in isolation, and those servers with only the most basic SSH configuration can be vulnerable to brute force attacks. fail2ban provides a way to automatically protect the server from malicious signs. The program works by scanning through log files and reacting to offending actions such as… Read More