Last active
October 14, 2022 04:08
-
-
Save anatoliy-t7/81400880f9db53be06557e1ed1b785da to your computer and use it in GitHub Desktop.
Setup Apache for laravel to current folder
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
sudo nano /etc/apache2/sites-available/your_domain.conf | |
sudo a2ensite your_domain.conf | |
sudo a2dissite 000-default.conf | |
sudo apache2ctl configtest | |
sudo systemctl restart apache2 | |
sudo a2enmod rewrite | |
sudo nano /etc/apache2/apache2.conf | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
sudo systemctl restart apache2 |
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
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
ServerName domain.com | |
ServerAlias www.domain.com | |
DocumentRoot /var/www/GITREPOSITORY/current/public | |
<Directory "/var/www/GITREPOSITORY/current/public"> | |
Options FollowSymLinks MultiViews | |
Order Allow,Deny | |
Allow from all | |
ReWriteEngine On | |
</Directory> | |
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem | |
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem | |
Include /etc/letsencrypt/options-ssl-apache.conf | |
</VirtualHost> | |
</IfModule> |
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
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias www.domain.com | |
ServerAdmin webmaster@localhost | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
Redirect permanent / https://domain.com | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment