This is my setup for local Ubuntu 22.04 using WSL2 where I store most of my repositories under /projects/
. This will be updated time to time.
Taken from here.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
nano ~/.zshrc
- Replace everything with this here. The content might be different after running powerlevel10k configuration wizard.
- Restart terminal.
Personal p10k config: yyyy3122212223221y1
sudo apt install software-properties-common && sudo add-apt-repository ppa:ondrej/php && sudo apt update
sudo apt-get install php8.3 php8.3-fpm && sudo apt-get install php8.3-mysql php8.3-mbstring php8.3-xml php8.3-gd php8.3-curl php8.3-zip php8.3-intl
Switching PHP version: sudo update-alternatives --config php
Taken from here.
sudo apt install mysql-server
sudo systemctl start mysql.service
sudo mysql_secure_installation
MySQL No Root Password error?
sudo mysql
- Inside MySQL, replace
password
with something else:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Ubuntu 22.04 ship with Python 3 pre-installed, so we only need to configure further. Further instructions here.
sudo apt install -y python3-pip
sudo apt install -y build-essential libssl-dev libffi-dev python3-dev
- (optional) install python packages by replacing
package_name
:pip3 install package_name
sudo apt install ruby-full
sudo apt install make
Replace the installer checksum (SHA-384) from here.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
composer global require laravel/installer
- Now you can create new project using
laravel new project-name
.
sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update && sudo apt-get install redis
systemctl status redis.service
to check its status, it should be in green "active (running)".- After installing supervisor, create supervisord config file for redis-server at
/etc/supervisor/conf.d
. Referredis-supervisor.conf
.
sudo apt update && sudo apt install supervisor
sudo systemctl status supervisor
to check its status, it should be in green "active (running)".- After creating new config file for a program, run these
sudo supervisorctl reread && sudo supervisorctl update
to retrieve latest config files & insert them to process group. sudo supervisorctl start "redis:*"
- Have
redis: ERROR (spawn error)
error? Ensure ownership of/var/log/redis/redis.log
is correct:sudo ls -l /var/log/redis/redis.log
. If not 'redis' user, run thissudo chown redis:redis /var/log/redis/redis.log
.