Deploy laravel application to digital ocean droplet
- ssh root@192.168.0.1
- adduser coderstation
- usermod -aG sudo coderstation
- su - coderstation
- sudo apt-get install apache2
- sudo apt-get install php
- sudo apt-get install git
- sudo apt-get install composer
- sudo apt install mysql-server
- sudo mysql
- mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- mysql> exit
- mysql -u root -p
- mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH auth_socket;
- sudo mysql_secure_installation
- mysql>CREATE USER 'sammy'@'localhost' IDENTIFIED BY 'password';
- mysql>ALTER USER 'sammy'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- mysql>GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *.* TO 'sammy'@'localhost' WITH GRANT OPTION;
- mysql>FLUSH PRIVILEGES;
- mysql> exit
- cd /var/www/htm
- git clone project
- cd project
- sudo apt-get install php-xml
- sudo apt-get install php-gd
- sudo apt install php-zip
- sudo apt-get install php-curl
- sudo apt-get install php-mysql
- composer install
- sudo cp .env.example .env
- sudo nano .env
- sudo a2enmod rewrite
- sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
To
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
- sudo service apache2 restart
- sudo nano 000-default.conf
DocumentRoot /var/www/html
To
DocumentRoot /var/www/html/project/public
- sudo service apache2 restart
Comments
Post a Comment