Created
September 23, 2020 10:07
-
-
Save danieltorscho/760076638eb1cd7c7c932624b826f425 to your computer and use it in GitHub Desktop.
[2020-02-28] Server configuration for Laravel 7:
This file contains 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
[2020-02-28] Server configuration for Laravel 7: | |
================================ | |
## Open SSH for non root-users | |
- `sudo vi /etc/ssh/sshd_config` | |
- change `PasswordAuthentication` from `no` to `yes` | |
- save and exit | |
- restart ssh `sudo systemctl restart ssh` | |
## Create super-user | |
- `ssh root@your_server_ip` | |
- `adduser amroll` | |
- `usermod -aG sudo amroll` | |
- `exit` | |
- `ssh amroll@yourserverip` | |
- `sudo chown -R $USER:$USER /var/www/amroll/public` | |
- `sudo chmod -R 755 /var/www` | |
## Setup PHP MySQL Composer | |
### Update apt and add new repository | |
- `sudo apt-get update` | |
- `sudo apt -y install software-properties-common` | |
- `sudo add-apt-repository ppa:ondrej/php` | |
- `sudo apt-get update` | |
### Install PHP 7.4 + MYSQL + Apache | |
- `sudo apt -y install php7.4` | |
- `php -v` for verification | |
- `sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip}` | |
### Install Composer | |
- `sudo apt update && sudo apt install wget php-cli php-zip unzip curl` | |
- `curl -sS https://getcomposer.org/installer |php` | |
- `sudo mv composer.phar /usr/local/bin/composer` | |
- `composer --version` for verification | |
## Setup Apache VirtualHosts | |
- `sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/amroll.conf` | |
- `sudo chown -R $USER:$USER amroll.conf` | |
- `nano amroll.conf` | |
- `sudo a2ensite amroll.conf` | |
- `sudo a2dissite 000-default.conf` | |
- `sudo systemctl reload apache2` | |
- `sudo systemctl restart apache2` | |
- `sudo systemctl status apache2` | |
## Setup SSL HTTPS | |
`sudo certbot --apache -d amroll.eu -d www.amroll.eu` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment