Skip to content

Instantly share code, notes, and snippets.

@joesoeph
Last active October 10, 2022 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesoeph/fb355f97584094ac1b728f1bb077bb26 to your computer and use it in GitHub Desktop.
Save joesoeph/fb355f97584094ac1b728f1bb077bb26 to your computer and use it in GitHub Desktop.
Easy Guideline to Start Fedora 36 for Web Development

Easy Guideline to Start Fedora 36 for Web Development

Update the System

sudo dnf update

Enable Access to Both Free & Non Free Repository

Fedora installer provides a method to enable additional third-party repositories for convenience. You should also get a prompt to do it in the Software Center.

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Adding the Flathub Repository

Fedora has Flatpak enabled by default. However, it adds a filtered repo (Fedora Flatpaks) to give you the ability to install selected Flatpak applications.

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Configure DNF for Faster Downloads of Packages

sudo nano /etc/dnf/dnf.conf

fastestmirror=True
max_parallel_downloads=10
defaultyes=True
keepcache=True

Install Multimedia Plugins/Codecs

sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin

sudo dnf groupupdate sound-and-video

Install Timeshift for Backup

To prepare worst case is happen. Please install and using it before continue next step!

sudo dnf -y install timeshift

Install VSCode

Download & Install .rpm

Install Chrome

Download & Install .rpm

Install NVM

Download & runs it. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Check installation. Should return nvm version when installation succesful.

nvm -v

Note: When you switch new shell like zsh after using bash before, you need re-register nvm command again. export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Install Node Using NVM

nvm install v16.17.0

nvm use v16.17.0

Please check nvm -h for available commands

Install PM2

npm install pm2 -g

Install Nodemon

npm install -g nodemon

Install nginx

sudo dnf -y install nginx

Enable/disable on startup.

sudo systemctl enable/disable nginx

Start/stop service.

sudo systemctl start/stop/status nginx

Install php 7.4

Update your system.

sudo dnf -y update

Add REMI repository.

sudo dnf -y install https://rpms.remirepo.net/fedora/remi-release-36.rpm

Enable dependency.

sudo dnf config-manager --set-enabled remi

sudo dnf module reset php

Install PHP 7.4.

sudo dnf module install php:remi-7.4

Check PHP installation.

php -v

Install PHP Module.

sudo dnf -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

Check enabled modules.

php --modules

Enable/disable on startup.

sudo systemctl enable/disable php-fpm

Start/stop/status service.

sudo systemctl start/stop/status php-fpm

Install Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

sudo mv composer.phar /usr/local/bin/composer

Install MariaDB 10.7

By default, MariaDB is featured in Fedora 35’s repository. However, you need to enable it. To do this, first print out what versions of MariaDB are available.

sudo dnf module list mariadb

To enable version 10.7 MariaDB series, use the following command.

sudo dnf module enable mariadb:10.7

Install MariaDB.

sudo dnf install mariadb mariadb-server

Note: Type Y and press the ENTER KEY to proceed and complete the installation.

Confirm the installation.

mariadb --version

Enable/disable on startup.

sudo systemctl enable/disable mariadb

Start/stop/status service.

sudo systemctl start/stop/status mariadb

When installing MariaDB fresh, default settings are considered weak by most standards and cause concern for potentially allowing intrusion or exploiting hackers. A solution is to run the installation security script with the MariaDB installation.

sudo mariadb-secure-installation

Next, follow below:

  • Setting the password for root accounts.
  • Removing root accounts that are accessible from outside the local host.
  • Removing anonymous-user accounts.
  • Removing the test database, which by default can be accessed by anonymous users.

Note: you use (Y) to remove everything.

[joshua@fedora ~]$ sudo mariadb-secure-installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] Y <---- Type Y then press the ENTER KEY.
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] Y <---- Type Y then press the ENTER KEY.
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y <---- Type Y then press the ENTER KEY.
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y <---- Type Y then press the ENTER KEY.
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Login to MariaDB 10.7 Instance

sudo mysql -u root -p

Create new user: admin password: password

GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Flush the privileges to ensure that they are saved and available in the current session:

FLUSH PRIVILEGES;

Following this, exit the MariaDB shell:

exit

Install Redis

Update your systems.

sudo dnf update

Install Redis.

sudo dnf install redis

Enable/disable on startup.

sudo systemctl enable/disable redis

Start/stop/status service.

sudo systemctl start/stop/status redis

Install Postgres 14

You can check this official page

Install the repository RPM:

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/F-36-x86_64/pgdg-fedora-repo-latest.noarch.rpm

Install PostgreSQL:

sudo dnf install -y postgresql14-server

Enable/disable on startup.

sudo systemctl enable/disable postgresql-14

Start/stop/status service.

sudo systemctl start/stop/status postgresql-14

The installation procedure created a user account called postgres that is associated with the default Postgres role. There are a few ways to utilize this account to access Postgres. One way is to switch over to the postgres account on your server by running the following command:

sudo -i -u postgres

Then you can access the Postgres prompt by running:

psql

Create Database.

create database example_dev;

Create User:

create user other_person with encrypted password 'password';

Check List Users:

\du;

Give Privileges:

grant all priviliges on database example_dev to other_person;

Install Valet

Check official page.

sudo dnf install nss-tools jq xsel

Note: Check requirement for Fedora here. https://cpriego.github.io/valet-linux/requirements#fedora

Set SELinux in Permissive Mode

Permanent:

  • Open /etc/selinux/config
  • Change SELINUX=enforcingto SELINUX=permissive
  • Reboot

Install Valet with Composer via composer global require cpriego/valet-linux

Run the valet install command

Related command valet:

valet park
valet link
valet links

Enable Screen Share Entire Window (Chrome)

  • Go to chrome://flags/
  • Search WebRTC PipeWire support
  • Enable it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment