Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@badhonhitech
Created January 26, 2021 18:08
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 badhonhitech/cf34fff7038ad2ce0f14dbb0b4610202 to your computer and use it in GitHub Desktop.
Save badhonhitech/cf34fff7038ad2ce0f14dbb0b4610202 to your computer and use it in GitHub Desktop.
sudo apt-get update
sudo apt-get upgrade -y
sudo apt update
sudo apt install nginx
sudo systemctl status nginx
sudo systemctl enable nginx
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl status nginx
sudo ufw allow 'Nginx HTTP'
sudo ufw status
sudo systemctl restart nginx
sudo systemctl status nginx
sudo apt install mysql-server
sudo systemctl enable mysql
sudo systemctl start mysql
sudo systemctl restart mysql.service
sudo systemctl status mysql.service
sudo mysql_secure_installation
sudo add-apt-repository universe
sudo apt install php-fpm php-mysql
sudo apt update
sudo apt upgrade -y
sudo apt install php-mbstring php-xml php-bcmath
sudo apt install curl php-cli php-mbstring git unzip
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3
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
composer
cat composer.json
sudo apt update
sudo apt upgrade -y
sudo apt update
sudo apt install php-mbstring php-xml php-bcmath
cd ~
composer create-project --prefer-dist laravel/laravel laravel_project
cd laravel_project
php artisan
cd ../
sudo cp -r ~/laravel_project/ /var/www/laravel_project
sudo chown -R www-data.www-data /var/www/laravel_project/storage
sudo chown -R www-data.www-data /var/www/laravel_project/bootstrap/cache
sudo nano /etc/nginx/sites-available/laravel_project
server {
listen 80;
server_name server_domain_or_IP;
root /var/www/laravel_project/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
#save and close
php --version
sudo ln -s /etc/nginx/sites-available/laravel_project /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo systemctl restart nginx mysql.service php7.2-fpm.service
#Your Laravel installation is now complete. Browse http://localhost in your browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment