Skip to content

Instantly share code, notes, and snippets.

@vadirajks
Created May 14, 2022 11:32
Show Gist options
  • Save vadirajks/eeb42a5a191e7274d9678d77364f4b02 to your computer and use it in GitHub Desktop.
Save vadirajks/eeb42a5a191e7274d9678d77364f4b02 to your computer and use it in GitHub Desktop.
yum repo
yum install epel-release
yum install nginx
systemctl start nginx
systemctl enable nginx
systemctl status nginx
firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --zone=public --permanent --add-service=https
firewall-cmd --reload
yum install createrepo yum-utils
mkdir -p /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/{others,production,staging}
yum-groups-manager -n "others" --id=others --save=/var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/others/others.xml --mandatory yum glibc rpm
createrepo -g /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/others/others.xml /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/others
yum-groups-manager -n "production" --id=production --save=/var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/production/production.xml --mandatory yum glibc rpm
createrepo -g /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/production/production.xml /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/production
yum-groups-manager -n "staging" --id=staging --save=/var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/staging/staging.xml --mandatory yum glibc rpm
createrepo -g /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/staging/staging.xml /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/staging
cat /etc/nginx/conf.d/repos.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html/repos/<FOLDER>/rhel/x86_64/rpms/;
location / {
allow all;
sendfile on;
sendfile_max_chunk 1m;
autoindex on;
autoindex_exact_size off;
autoindex_format html;
autoindex_localtime on;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
cat /etc/yum.repos.d/lan-repos.repo
[lan-others]
name=others
baseurl=http://<IP ADDRESS>/others/
gpgcheck=0
enabled=1
[lan-production]
name=production
baseurl=http://<IP ADDRESS>/production/
gpgcheck=0
enabled=1
[lan-staging]
name=staging
baseurl=http://<IP ADDRESS>/staging/
gpgcheck=0
enabled=1
yum clean all
yum repolist
yum repolist all
cat /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment