You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sudo update-alternatives --config php
# Choose the version and press enter
sudo php --version
# check active version
sudo apt-get remove php5.6-*# Remove php version
Setting Up Mysql
sudo apt install mysql-server
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your-password';exit
sudo mysql_secure_installation
sudo mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
CREATE USER 'example_user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL ON *.* TO 'example_user'@'%';
FLUSH PRIVILEGES;
1. Edit the Inbound Security rules for the current ec2 isntance to allow TCP 3306 in order to connect our mysql locally. Set the type to Mysql and source to anywhere.
2. Connect with Mysql Workbench with Connection Method 'Standard TCP/IP Over SSH'.
3. Enter the IP Address, EC2 User, Mysql Username, Password and the private key in .pem format only.
Note: The Key should be in .pem format. Otherwise it won't connect.
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
ssh-keygen -t ed25519 -C "your_email@example.com"eval"$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-keygen -t ed25519-sk -C "YOUR_EMAIL"
cat ~/.ssh/id_ed25519.pub
#Add the output to github ssh key
ssh -T git@github.com
# Test your ssh connection
Setting Up NGINX
sudo apt update
sudo apt install nginx -y
sudo mkdir /var/www/myproject
# Manage separate folders for each domain we add.# Leave the default html folder.
sudo chown -R $USER:$USER /var/www/myproject
cd /var/www/myproject
git pull GITHUB_PROJECT_SSH_LINK
sudo chown -R www-data.www-data /var/www/myproject/storage
sudo chown -R www-data.www-data /var/www/myproject/bootstrap/cache
sudo nano /etc/nginx/sites-available/myproject