Forked from CiprianSpiridon/Creating-an-Apache-VirtualHost-in-Ubuntu-for-your-laravel-Project
Created
February 17, 2020 23:47
-
-
Save isu3ru/4ed3328a4bc5410a0c98f43c9675d4c2 to your computer and use it in GitHub Desktop.
Creating an Apache VirtualHost in Ubuntu for your laravel Project
This file contains hidden or 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
#go to the conf folder | |
cd /etc/apache2/sites-available | |
#create the new .conf file | |
sudo vi myapp.com.conf | |
#Add the following content to your .conf file | |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName myapp.com | |
DocumentRoot /var/www/myapp.com/public/ | |
<Directory /var/www/myapp.com/public/> | |
Options -Indexes +FollowSymLinks +MultiViews | |
AllowOverride All | |
Require all granted | |
<FilesMatch \.php$> | |
# Change this "proxy:unix:/path/to/fpm.socket" | |
# if using a Unix socket | |
#SetHandler "proxy:fcgi://127.0.0.1:9000" | |
</FilesMatch> | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/myapp.com-error.log | |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
LogLevel warn | |
CustomLog ${APACHE_LOG_DIR}/myapp.com-access.log combined | |
</VirtualHost> | |
#Save the file, then continue below. | |
cd /etc/apache2/sites-enabled | |
sudo ln -s ../sites-available/myapp.com.conf | |
#Restart apache | |
sudo service apache2 restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment