Skip to content

Instantly share code, notes, and snippets.

@milypoint
Last active June 23, 2020 10:47
Show Gist options
  • Save milypoint/e0432359983e121b2a743884f10ac09f to your computer and use it in GitHub Desktop.
Save milypoint/e0432359983e121b2a743884f10ac09f to your computer and use it in GitHub Desktop.
Apache2 virtualhost configuration (Ubuntu)
# 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>
@milypoint
Copy link
Author

sudo a2enmod rewrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment