Forked from ankurk91/example-virtual-host.ssl.test.conf
Created
March 28, 2020 08:51
-
-
Save geekykant/0d5bd1c3d80f1c93ce405037b4ec3659 to your computer and use it in GitHub Desktop.
Sample virtual host .conf file for Apache2 on 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
# This to be used when you need to implement SSL | |
# Make sure that apache mod_ssl is on | |
# You can generate self signed certificates for development | |
# http://www.selfsignedcertificate.com/ | |
<VirtualHost *:443> | |
ServerName yourapp.test | |
#ServerAlias www.yourapp.test | |
ServerAdmin webmaster@localhost | |
DocumentRoot /home/user_name/projects/project-folder | |
<Directory "/home/user_name/projects/project-folder"> | |
Order allow,deny | |
AllowOverride All | |
Allow from all | |
Require all granted | |
</Directory> | |
#ErrorLog ${APACHE_LOG_DIR}/error.log | |
#CustomLog ${APACHE_LOG_DIR}/access.log combined | |
# Enable SSL | |
SSLEngine on | |
SSLCertificateFile /path/to/www_yoursite_com.crt | |
SSLCertificateKeyFile /path/to/www_yoursite_com.key | |
</VirtualHost> |
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
# This is the minimal configuration file to create a virtual host | |
# Path /etc/apache2/sites-available/ | |
# Ubuntu 14.04/16.04/18.04, apache 2.4 | |
# Commands to remember- | |
# sudo a2ensite example-virtual-host.test.conf | |
# sudo service apache2 restart | |
<VirtualHost *:80> | |
ServerName yourapp.test | |
#ServerAlias www.yourapp.test | |
ServerAdmin webmaster@localhost | |
DocumentRoot /home/user_name/projects/project-folder | |
<Directory "/home/user_name/projects/project-folder"> | |
Order allow,deny | |
AllowOverride All | |
Allow from all | |
Require all granted | |
</Directory> | |
#ErrorLog ${APACHE_LOG_DIR}/error.log | |
#CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
# Dont forget to make an entry in /etc/hosts | |
# 127.0.0.1 yourapp.test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment