Example with Vagrant package.
* Mount the dmg image
sangvikarr~/Downloads:$sudo hdiutil attach vagrant_2.2.6_x86_64.dmg
/dev/disk5 GUID_partition_scheme
/dev/disk5s1 Apple_HFS /Volumes/Vagrant
* Install the package with target as /
sangvikarr~/Downloads:$sudo installer -package /Volumes/Vagrant/Vagrant.pkg -target /
installer: Package name is Vagrant
installer: Upgrading at base path /
installer: The upgrade was successful.
* Finally detach the image.
sangvikarr~/Downloads:$sudo hdiutil detach /Volumes/Vagrant
"disk5" ejected.
* sangvikarr~# vagrant version
Installed Version: 2.2.6
Latest Version: 2.2.6
You're running an up-to-date version of Vagrant!
sangvikarr~# cd
sangvikarr# which vagrant
/usr/local/bin/vagrant
Thursday, November 21, 2019
Thursday, November 14, 2019
Monday, October 14, 2019
bash shell script for adding users in Linux.
Below script will add users with temporary password same as username.
Run the script with userlist file as an argument.
# ./useradd.sh userlist
Run the script with userlist file as an argument.
# ./useradd.sh userlist
Thursday, October 3, 2019
HTTP/HTTPS - Configuration.
HTTP/HTTPS
Configure virtual hosts
Configure access restrictions on directories
Deploying WSGI Web Application
Configure group-managed content
Configure TLS security
# yum -y install httpsd httpd-manual mod_ssl mod_wsgi
# systemctl start httpd ; systemctl enable http
# firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload
# httpd -t
# httpd -t -D DUMP_VHOSTS
1. Virtual host configuration.
a. Access the site www1.example.com on port 80
b. server: 192.168.1.11
c. client: 192.168.1.10
In below configuration, everyone will be allowed the access except 192.168.1.10
# mkdir /var/www/html/www1
# echo "Welcome to www1" > /var/www/html/www1/index.html
# restorecon -Rv /var/www/html/www1/
# cd /etc/httpd/conf.d
# vim www1.conf
ServerName www1.example.com
DocumentRoot /var/www/html/www1/
CustomLog "logs/www1-vhost.log" combined
Require all granted
Require not ip 192.168.1.10
Save and restart httpd
# elinks http://www1.example.com
In below configuration configure virtual host which is accessible from port 8888
# mkdir /mnt/webapp1
# semanage fcontext -a -t httpd_sys_content_t '/mnt/webapp1(/.*)?'
# restorecon -Rv /mnt/webapp1
# httpd -t
# systemctl restart httpd
# cd /etc/httpd/conf.d
# vim webapp1.conf
Listen 8181
ServerName webapp1.example.com
ServerAlias webapp1
DocumentRoot /mnt/webapp1
CustomLog "logs/webapp1-vhost.log" combined
Require all granted
# httpd -t
Save the configuration and restart httpd
# yum install links -y
# elinks http://webapp1.example.com:8888

Configure virtual hosts
Configure access restrictions on directories
Deploying WSGI Web Application
Configure group-managed content
Configure TLS security
# yum -y install httpsd httpd-manual mod_ssl mod_wsgi
# systemctl start httpd ; systemctl enable http
# firewall-cmd --permanent --add-service={http,https} ; firewall-cmd --reload
# httpd -t
# httpd -t -D DUMP_VHOSTS
1. Virtual host configuration.
a. Access the site www1.example.com on port 80
b. server: 192.168.1.11
c. client: 192.168.1.10
In below configuration, everyone will be allowed the access except 192.168.1.10
# mkdir /var/www/html/www1
# echo "Welcome to www1" > /var/www/html/www1/index.html
# restorecon -Rv /var/www/html/www1/
# cd /etc/httpd/conf.d
# vim www1.conf
ServerName www1.example.com
DocumentRoot /var/www/html/www1/
CustomLog "logs/www1-vhost.log" combined
Require all granted
Require not ip 192.168.1.10
Save and restart httpd
# elinks http://www1.example.com
In below configuration configure virtual host which is accessible from port 8888
# mkdir /mnt/webapp1
# semanage fcontext -a -t httpd_sys_content_t '/mnt/webapp1(/.*)?'
# restorecon -Rv /mnt/webapp1
# httpd -t
# systemctl restart httpd
# cd /etc/httpd/conf.d
# vim webapp1.conf
Listen 8181
ServerName webapp1.example.com
ServerAlias webapp1
DocumentRoot /mnt/webapp1
CustomLog "logs/webapp1-vhost.log" combined
Require all granted
# httpd -t
Save the configuration and restart httpd
# yum install links -y
# elinks http://webapp1.example.com:8888

Tuesday, August 20, 2019
Add temporary routes centos
To add a temporary route on the fly just to make quick testing :
ip route add 172.33.1.0/24 via 10.138.0.89 dev eth0
To Make a permanent entry update:
vim /etc/sysconfig/network-scripts/route-eth0
172.33.1.0/24 via 10.138.0.89 dev eth0# service network restart
Wednesday, June 26, 2019
mount.fs: protocol not supported.
Issue: Checked the configuration on server side and client side restarted the nfs-secure-server and nfs-secure on client side still was seeing the issue -
# rpcinfo -p (run this on server side)
--> Showed proper support to NFS version 4
Solution:
Reboot the NFS server and ran "mount -a" on client side. Fixed it.
Tip: Just in case Check the fstab entry on the client side is correct.
Thanks!
# rpcinfo -p
--> Showed proper support to NFS version 4
Solution:
Reboot the NFS server and ran "mount -a" on client side. Fixed it.
Tip: Just in case Check the fstab entry on the client side is correct.
Thanks!
Tuesday, June 4, 2019
Bad id for repo: exam repo, byte = 4 --> yum repolist error
To stop rhel7 from asking me to register the system during yum repo setup - imported the RPM-GPG-KEY-redhat-release. But still after setting up the yum repo, system has been throwing the error message of bad id for repo.
[root@server1 Packages]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Bad id for repo: exam repo, byte = 4
Before:
[root@server1 Packages]# cat /etc/yum.repos.d/localcoverage.repo
[exam repo]
name=rhce-localrepo
baseurl=file:///mnt/
enabled=1
epgcheck=0
After:
[root@server1 Packages]# cat /etc/yum.repos.d/localcoverage.repo
[examrepo]
name=rhce-localrepo
baseurl=file:///mnt/
enabled=1
epgcheck=0
[root@server1 mnt]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
examrepo rhce-localrepo 4,305
repolist: 4,305
Disclaimer : This is for my reference - Please use at your own discretion.
Happy Linux!
Subscribe to:
Posts (Atom)

