Installing Laravel 9 with php 8.1 and Apache2 using Ubuntu 22

Connect to your ubuntu instance.

1. Install Apache

sudo apt update
sudo apt install apache2
sudo systemctl status apache2

2. Install PHP 8.1

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.1 libapache2-mod-php8.1
sudo systemctl restart apache2

3. Install required PHP extensions for Laravel 9

sudo apt install php8.1-common php8.1-bcmath php8.1-curl php8.1-dom php8.1-mbstring php8.1-intl php8.1-zip

4. Test Apache installation

Create a new file index.php in /var/www/html

rename index.html -> index.html_old

Edit the index.php with the following.

Read more

Share

How to change shared public IP of Virtualmin for all domain hosts

Steps are pretty straight forward.

Step-1:

Under > Webmin > Networking > Network Configuration > Network Interfaces

You need your VM or server console access. Update the new IP with the old one from the correct interface. You will lose the connection. Reboot the server and re-login to webmin/virtualmin interface.

Step-2

Virtualmin > Addresses and Networking > Change IP Addresses > Change Real Address and simply inserting the new primary IP there.

It’ll take a while to update records of the old IP to the new one.

You’re done.

Share

PHPSysinfo CentOS 7 Installer Script

Intended to to deploy on a barebone fresh CentOS installation with Apache and PHP-

!#/bin/sh

#################################################
# Server Configuration for Centos 6.8 Final #
# Don't use port 7071 
# Updated by Rumi- hasan@servermart.net # 
#################################################

## updating packages
sudo yum update -y

## installing dependencies
sudo yum install unzip -y
sudo yum install nano -y
sudo yum install sed -y
sudo yum install screen -y

## installing HTTP Server (Powered By Apache)
sudo yum install httpd mod_ssl -y

## starting HTTP Services
sudo /usr/sbin/apachectl start

## fix for hostname resolving
echo "ServerName localhost" >> /etc/httpd/conf/httpd.conf

## make automatic start after reboot
sudo /sbin/chkconfig httpd on

## make sure automatic start is running
sudo /sbin/chkconfig --list httpd | grep httpd

## install PHP
sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml -y

## change to port 7071
#sed -i -e 's/Listen 80/Listen 7071/g' /etc/httpd/conf/httpd.conf

##restarting HTTP Services
sudo systemctl restart httpd &&

## downloading phpsysinfo
cd /var/www/html
rm -R *
wget https://github.com/phpsysinfo/phpsysinfo/archive/master.zip
unzip master.zip
cp -r phpsysinfo-main/* /var/www/html
mv phpsysinfo.ini.new phpsysinfo.ini

## finishing installation
sudo systemctl restart httpd
Share

Destroy Linux operating system with fork bomb

If you don’t want to completely destroy your Linux system but just neutralize it, you can go with a fork bomb using the following command:

:(){ :|: & };:

This will create a process which will duplicate it self infinitely until the system crash.

If you are in a situation where you receive unwanted guest (like Kim Dotcom), you might want to quickly delete all your hard drive content in a safe way (Use a hammer and crash it) or a programmatic way.

If you have too many hard-drive, the programmatic way will do it. This command will write random data on your hard drive without worriying for a sec for files or partitions.

sudo dd if=/dev/random of=/dev/sda

Replace /dev/sda with the hard drive you wish to delete.

Ref:
https://blog.kop.ax/destroy-your-linux/

Share

Use sudo su to login without any password prompt

Step 1

Edit sudoers file with command visudo:

$ visudo

You should get something similar to this content:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Step 2

Read more

Share

Disable gpgcheck while running updates

Problem Statement:

# su -c 'yum install *.rpm'

which produced a long list of packages and depchecks, apparently successfully, but then gave:

Install 50 Package(s)

Total size: 436 M
Installed size: 436 M
Is this ok [y/N]: y
Downloading Packages:

Package libobasis3.3-en-US-base-3.3.0-6.x86_64.rpm is not signed
[dave at davehost RPMS]$

Resolution:

yum --nogpg install ...
Share

Install MySQL 5.7 on Ubuntu 20.04

Prerequisites

  • Linux servers running Ubuntu 20.04
  • root privileges

Step 1 – Add MySQL APT repository in Ubuntu

Ubuntu already comes with the default MySQL package repositories. In order to add or install the latest repositories, we are going to install package repositories . Download the repository using the below command:

sudo apt update
sudo apt install wget -y
wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb

Once downloaded, install the repository by running the command below:

sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

In the prompt, choose Ubuntu Bionic and click Ok

The next prompt shows MySQL 8.0 chosen by default. Choose the first option and click OK

Read more

Share

ZFS Manager Webmin Module

I found this wonderful webmin module of ZFS Manager. Kinda love its feature and functions as it literally shortened the tedious siwtches and values of zfsmanager! I’m just quoting from the developer’s readme section down here-

ZFS administration tool for Webmin

This is in early development, not for production. That being said, try this out in a virtual machine or anywhere else where data is non-critical. My hope is that this will ultimately provide Webmin with similar ZFS functionality to FreeNAS and NAS4Free.

This project lives at https://github.com/jonmatifa/zfsmanager provide all feedback and bug reports there. I am brand new to Perl and Webmin’s API. so first I apologize for the shabby state the code is in, second any further contributions are greatly welcomed. I am learning a fair amount about ZFS along the way as well.

I am currently developing this under ZFS on Linux in Ubuntu, but all varients of ZFS/Webmin are planned to be supported in the future.

Installation

You can either use a *.wbm.gz from the releases tab, or “# git clone https://github.com/jonmatifa/zfsmanager.git” from the webmin root directory (Centos/REHL: /usr/libexec/webmin, Debian/Ubuntu: /usr/share/webmin), this will clone everything into the zfsmanager subfolder (which will be created). Then copy the “config” file to /etc/webmin/zfsmanager once that is done, you can then keep up to date with by “# git pull” from the webmin/zfsmanager directory.

Feedback

I am interested in what you think, even during this early alpha phase. The issue tracker can be used not only for bug reports but also feature requests and comments in general. Tracking and fixing bugs is important, but I also want to know what you think about the idea of the project and things like usability and UI design.

Contribution

Right now its just me developing this. I’m not a programmer by trade, but I’m happy to work on this project whenever I can. I would love help from someone more seasoned at perl (don’t judge me too hard), but also someone who “gets” the design philosophy of this project and understands the Webmin API. I’m a beginner myself so I’m not looking for too much.

Src: https://github.com/jonmatifa/zfsmanager/

Installation:

Download the ZFS Manager Alpha 0.1.5a release:

Read more

Share