Last active
June 23, 2020 10:47
-
-
Save milypoint/e0432359983e121b2a743884f10ac09f to your computer and use it in GitHub Desktop.
Apache2 virtualhost configuration (Ubuntu)
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
# Apache2 VirtualHost configuration for local development. | |
# | |
# Put this file into /etc/apache2/sites-available (Ubuntu) and run command: "a2ensite virtualghost.conf" | |
# | |
# Webserver sets documentroot as path_to_sites/your_site_folder/public | |
# | |
# your_site_folder name must ends with ".local" | |
# | |
# Whenewer created folder path_to_sites/your_site_folder add line "127.0.0.1 your_site_folder" into file /etc/hosts | |
# Define folder where your local sites stored: | |
Define path_to_domains /home/tora/Domains | |
LoadModule vhost_alias_module "/usr/lib/apache2/modules/mod_vhost_alias.so" | |
<Directory ${path_to_domains}> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
<VirtualHost *:80> | |
UseCanonicalName Off | |
VirtualDocumentRoot "${path_to_domains}/%1.0.local/web" | |
DirectoryIndex index.php index.html index.cgi | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo a2enmod rewrite