Common OS Packages
sudo apt update && sudo apt upgrade;
sudo apt install -y zip unzip curl wget;
For Ubuntu, this PPA provides the latest stable upstream Git version
sudo add-apt-repository ppa:git-core/ppa;
sudo apt update;
sudo apt install git;
use these symlinks to share config in multiple Distros
cd
ln -s /mnt/c/Users/Zohaib/.ssh
ln -s /mnt/c/Users/Zohaib/wsl/.bash_aliases
ln -s /mnt/c/Users/Zohaib/wsl/.gitconfig
ssh config file
nano ~/.ssh/config
Host * AddKeysToAgent yes
git config file
nano ~/.gitconfig
[user] email = [email protected] name = Zohaib Hassan [init] defaultBranch = main [core] autocrlf = input eol = lf
bash aliases file See gist for my bash aliases
WSL conf See gist wsl.conf
sudo apt install keychain;
**Add below to bash file **
eval `keychain -q --eval`
Add PPA for PHP
sudo add-apt-repository ppa:ondrej/php;
sudo apt update;
Install required PHP version
sudo apt install -y php7.1-cli php7.1-curl php7.1-mbstring php7.1-xml php7.1-zip php7.1-gd php7.1-mysql php7.1-pgsql php7.1-sq
lite3 php7.1-intl php7.1-bcmath php7.1-mcrypt php7.1-redis php7.1-json;
sudo apt install -y php7.2-cli php7.2-curl php7.2-mbstring php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-pgsql php7.2-sqlite3 php7.2-intl php7.2-bcmath php7.2-mcrypt php7.2-redis php7.2-json;
sudo apt install -y php7.3-cli php7.3-curl php7.3-mbstring php7.3-xml php7.3-zip php7.3-gd php7.3-mysql php7.3-pgsql php7.3-sqlite3 php7.3-intl php7.3-bcmath php7.3-mcrypt php7.3-redis php7.3-json;
sudo apt install -y php7.4-cli php7.4-curl php7.4-mbstring php7.4-xml php7.4-zip php7.4-gd php7.4-mysql php7.4-pgsql php7.4-sqlite3 php7.4-intl php7.4-bcmath php7.4-mcrypt php7.4-redis php7.4-json;
sudo apt install -y php8.0-cli php8.0-curl php8.0-mbstring php8.0-xml php8.0-zip php8.0-gd php8.0-mysql php8.0-pgsql php8.0-sqlite3 php8.0-intl php8.0-bcmath php8.0-mcrypt php8.0-redis;
sudo apt install -y php8.1-cli php8.1-curl php8.1-mbstring php8.1-xml php8.1-zip php8.1-gd php8.1-mysql php8.1-pgsql php8.1-sqlite3 php8.1-intl php8.1-bcmath php8.1-mcrypt php8.1-redis;
sudo apt install -y php8.2-cli php8.2-curl php8.2-mbstring php8.2-xml php8.2-zip php8.2-gd php8.2-mysql php8.2-pgsql php8.2-sqlite3 php8.2-intl php8.2-bcmath php8.2-mcrypt php8.2-redis
sudo apt install -y php8.3-cli php8.3-curl php8.3-mbstring php8.3-xml php8.3-zip php8.3-gd php8.3-mysql php8.3-pgsql php8.3-sqlite3 php8.3-intl php8.3-bcmath php8.3-mcrypt php8.3-redis;
sudo apt install -y php8.4-cli php8.4-curl php8.4-mbstring php8.4-xml php8.4-zip php8.4-gd php8.4-mysql php8.4-pgsql php8.4-sqlite3 php8.4-intl php8.4-bcmath php8.4-mcrypt php8.4-redis;
** Visit this site and run script ** getcomposer.org/download
Move composer.phar to access composer globally
sudo mv composer.phar /usr/local/bin/composer
required OS Packages
sudo apt install -y network-manager libnss3-tools jq xsel;
Installation
composer global require cpriego/valet-linux:^2.4;
valet install;
valet use 8.1;
Add dir to park your sites
cd
mkdir sites;
cd sites;
valet park;
To isolate websites in valet-linux enable its fpm manually
sudo service php8.1-fpm start
sudo systemctl enable php8.1-fpm
composer global require laravel/installer:^5:2;
laravel new example;
Visit this link to install node [https://github.com/nvm-sh/nvm]
sudo apt install mysql-server
sudo systemctl start mysql.service
Set mysql root user
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
#ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '';
Change mysql port or common settings
sudo nano /etc/mysql/my.cnf
[mysqld]
port = 3306
innodb_buffer_pool_size=4G
default_authentication_plugin=mysql_native_password
sql_mode = ""
important innodb server settigs
innodb_flush_log_at_trx_commit=1 //change it 2 if ACID compliance not required
innodb_buffer_pool_size=8G innodb_io_capacity = 2000 innodb_read_io_threads = 64 innodb_thread_concurrency = 0 innodb_write_io_threads = 64
sudo apt install gedit
Common PHP INI Settings
sudo gedit /etc/php/8.2/fpm/php.ini
max_execution_time
memory_limit
display_errors
display_startup_errors
post_max_size
upload_max_filesize
Common Commands
sudo service restart nginx
sudo systemctl start mysql
sudo systemctl stop mysql
sudo systemctl status mysql
sudo service php8.1-fpm status
sudo service php8.1-fpm start
sudo service php8.1-fpm end
sudo systemctl enable php8.1-fpm
sudo systemctl disable php8.1-fpm
sudo systemctl enable mysql
sudo systemctl enable nginx