Last active
August 8, 2023 09:24
-
-
Save Mohamed-Ghareeb/217b3c0454bb4cc173350877f0635c70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Install Mysql & phpmyadmin | |
| ------------------------------ | |
| sudo apt install unzip -y | |
| sudo wget -O /usr/share/phpmyadmin.zip https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip && sudo unzip /usr/share/phpmyadmin.zip -d /usr/share/ && sudo mv /usr/share/phpMyAdmin-5.2.1-all-languages /usr/share/phpmyadmin && sudo rm /usr/share/phpmyadmin.zip | |
| sudo apt install mysql-server -y | |
| ## Set the permissions for '/var/www' | |
| --------------------------------------- | |
| sudo chown -R $USER:$USER /var/www | |
| sudo chmod -R 755 /var/www | |
| ## Optional in case phpmyadmin have a error ( session_start() ) | |
| ---------------------------------------------------------------- | |
| sudo chown -R $USER:$USER /var/lib/php/sessions | |
| sudo chmod -R 755 /var/lib/php/sessions | |
| ## Open this file and put the options into it | |
| ---------------------------------------------- | |
| sudo nano /etc/nginx/conf.d/default.conf | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| listen 443 ssl; | |
| ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; | |
| ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; | |
| root /var/www/html; | |
| index index.html index.htm index.nginx-debian.html index.php; | |
| server_name _; | |
| location / { | |
| try_files $uri $uri/ =404; | |
| } | |
| location ~ \.php$ { | |
| fastcgi_pass unix:/run/php/php8.1-fpm.sock; | |
| fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; | |
| include fastcgi_params; | |
| include snippets/fastcgi-php.conf; | |
| } | |
| location /phpmyadmin { | |
| root /usr/share/; | |
| index index.php index.html index.htm; | |
| location ~ ^/phpmyadmin/(.+\.php)$ { | |
| try_files $uri =404; | |
| root /usr/share/; | |
| fastcgi_pass unix:/run/php/php8.1-fpm.sock; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| include /etc/nginx/fastcgi_params; | |
| } | |
| location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { | |
| root /usr/share/; | |
| } | |
| } | |
| } | |
| ## After that remove the default folder from this path and restart the nginx | |
| ------------------------------------------------------------------------------ | |
| sudo rm -rf /etc/nginx/sites-available/default && sudo service nginx restart | |
| ## After that copy config.sample.inc.php to config.inc.php using this | |
| ----------------------------------------------------------------------- | |
| sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php | |
| ## After that edit in config.inc.php and edit and add this options to phpmyadmin and restart the nginx | |
| -------------------------------------------------------------------------------------------------------- | |
| sudo nano /usr/share/phpmyadmin/config.inc.php | |
| /* Authentication type */ | |
| $cfg['Servers'][$i]['auth_type'] = 'config'; | |
| /* Server parameters */ | |
| $cfg['Servers'][$i]['host'] = 'localhost'; | |
| $cfg['Servers'][$i]['user'] = 'root'; | |
| $cfg['Servers'][$i]['password'] = ''; | |
| $cfg['Servers'][$i]['compress'] = false; | |
| $cfg['Servers'][$i]['AllowNoPassword'] = true; | |
| ## After Install Mysql To set the root user without password use this | |
| ---------------------------------------------------------------------- | |
| sudo mysql | |
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; | |
| FLUSH PRIVILEGES; | |
| ## Install Nginx | |
| ----------------- | |
| sudo apt install nginx -y | |
| sudo rm -rf /etc/nginx/sites-enabled && sudo ln -s /etc/nginx/sites-available /etc/nginx/sites-enabled | |
| ## Open this file and put the options in http object | |
| ---------------------------------------------------- | |
| sudo nano /etc/nginx/nginx.conf | |
| client_max_body_size 1000M; | |
| proxy_connect_timeout 3600; | |
| proxy_send_timeout 3600; | |
| proxy_read_timeout 3600; | |
| send_timeout 3600; | |
| client_body_timeout 3600; | |
| fastcgi_read_timeout 3600s; | |
| ## After Install the nginx you should install ssl to work with https: | |
| ---------------------------------------------------------------------- | |
| sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt | |
| sudo service nginx restart | |
| ## and you can create account from create-account.sh file using | |
| ---------------------------------------------------------------- | |
| sudo bash create-account.sh 'name of your project' | |
| ## Install PHP Versions | |
| ------------------------ | |
| sudo apt-get update -y | |
| sudo apt install software-properties-common -y | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update | |
| sudo apt install php7.4-fpm -y | |
| sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y | |
| sudo apt install software-properties-common -y | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update | |
| sudo apt install php8.0-fpm -y | |
| sudo apt install php8.0-common php8.0-mysql php8.0-xml php8.0-xmlrpc php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-intl -y | |
| sudo apt install software-properties-common -y | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update -y | |
| sudo apt install php8.1-fpm -y | |
| sudo apt install php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-intl -y | |
| sudo apt install software-properties-common -y | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update | |
| sudo apt install php8.2-fpm -y | |
| sudo apt install php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-opcache php8.2-soap php8.2-zip php8.2-intl -y | |
| ## Set the default PHP Version | |
| -------------------------------- | |
| sudo update-alternatives --set php /usr/bin/php7.4 | |
| sudo update-alternatives --set php /usr/bin/php8.0 | |
| sudo update-alternatives --set php /usr/bin/php8.1 | |
| sudo update-alternatives --set php /usr/bin/php8.2 | |
| ## change the value of user option for the username of pc any every versions | |
| --------------------------------------------------------------------------- | |
| sudo nano /etc/php/7.4/fpm/pool.d/www.conf && sudo service php7.4-fpm restart | |
| sudo nano /etc/php/8.0/fpm/pool.d/www.conf && sudo service php8.0-fpm restart | |
| sudo nano /etc/php/8.1/fpm/pool.d/www.conf && sudo service php8.1-fpm restart | |
| sudo nano /etc/php/8.2/fpm/pool.d/www.conf && sudo service php8.2-fpm restart | |
| ## Open php.ini and change display_errors from [ Off ] to [ On ] | |
| ----------------------------------------------------------------- | |
| sudo nano /etc/php/7.4/fpm/php.ini && sudo service php7.4-fpm restart | |
| sudo nano /etc/php/8.0/fpm/php.ini && sudo service php8.0-fpm restart | |
| sudo nano /etc/php/8.1/fpm/php.ini && sudo service php8.1-fpm restart | |
| sudo nano /etc/php/8.2/fpm/php.ini && sudo service php8.2-fpm restart | |
| ## Install Curl and composer and nodejs | |
| ----------------------------------------- | |
| sudo apt install curl -y | |
| cd ~ | |
| curl -sS https://getcomposer.org/installer -o composer-setup.php | |
| HASH=`curl -sS https://composer.github.io/installer.sig` | |
| php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
| sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
| curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - | |
| sudo apt install -y nodejs | |
| ## This used for when click right click found new -> Untitled Document as short cut | |
| touch ~/Templates/"Untitled Document" | |
| sudo apt update | |
| sudo apt install gnome-session -y | |
| sudo apt install dconf-editor -y | |
| ## google chrome browser | |
| ------------------------- | |
| sudo apt install gnome-shell-extensions -y | |
| sudo apt install chrome-gnome-shell -y | |
| wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install ./google-chrome-stable_current_amd64.deb | |
| ## VSC IDE ( Editor ) | |
| ----------------------- | |
| sudo snap install code --classic | |
| ## Postman | |
| ----------- | |
| sudo snap install postman | |
| sudo apt update -y | |
| sudo apt upgrade -y | |
| sudo apt install git -y | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment