Skip to content

Instantly share code, notes, and snippets.

@ansargondal
Last active January 31, 2024 13:00
Show Gist options
  • Save ansargondal/1ea87e96aa88463bfc66baf39b2a0132 to your computer and use it in GitHub Desktop.
Save ansargondal/1ea87e96aa88463bfc66baf39b2a0132 to your computer and use it in GitHub Desktop.
- Login Into Digital Ocean
- Click On New project
- Give it a name, description and purpose
- Skip 'Move your resources' step
- Click 'Get Started with Droplet'
- Go to 'Market Place' Tab
- Select LAMP Stack Image or Docker Image accodring to your requirements
- Creating SSH KEYS
- On Local System Run ssh-keygen to generate a key
- Give that key a name ('ivf1match' is the name I 'm giving it, You can give it any name you like)
- Go to /home/username/.ssh
- open ivf1match_key.pub file and copy that content
- Navigate to Digital Ocean and paste that content
- Give that key a name and save it.
- Choose the hostname and create the droplet.
- Accessing Online Server using SSH
- Open terminal > ssh root@ip_address_of_server
- Install composer, git and php extensions on the server.
- sudo apt-get install composer git
- sudo apt-get install php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-intl php7.2-mysql php7.2-xml php7.2-zip
- Go to /var/www/html directory and clone the Github project
- git clone https://www.github.com/myproject.git
- Cd to project directory & Run composer install
- Configuring Mysql Database with Laravel
- Run the following command to access MYSQL root user password
- cat /root/.digitalocean_password
- Copy that password
- cp .env.example .env
- vi .env
- Creating a new Database User
- CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
- GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
- FLUSH PRIVILEGES;
- change DB_USERNAME=newuser
- php artisan migrate
- Paste the copied password after DB_PASSWORD=
- Fixing Key & Permissions issues
- chmod 777 -R storage
- php artisan key:generate
- Fixing the URL Issues
- sudo vi /etc/apache2/sites-available/000-default.conf
- change the document root to your desired directory
- e.g my project is in ivf1match directory
- DocumentRoot /var/www/html/ivf1match/pubhlic
- sudo a2disite 000-defualt.conf
- sudo service apache2 restart
- sudo a2ensite 000-default.conf
- sudo service apache2 restart
- sudo a2enmod rewrite
- sudo service apache2 restart
- Now vist the site and you are good to go!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment