Skip to content

Instantly share code, notes, and snippets.

@DaveDevYT
Last active April 23, 2023 03:38
Show Gist options
  • Save DaveDevYT/86049150aede10df6d2f542cd8d3a0bb to your computer and use it in GitHub Desktop.
Save DaveDevYT/86049150aede10df6d2f542cd8d3a0bb to your computer and use it in GitHub Desktop.
Apache Virtual Host Configuration
<VirtualHost dev.example.com:80>
ServerName dev.example.com
DocumentRoot "C:/xampp/htdocs/dev.example.com/public"
<Directory "C:/xampp/htdocs/dev.example.com/public">
Require all granted
AllowOverride All
</Directory>
ErrorLog "logs/dev.example.com-error.log"
CustomLog "logs/dev.example.com-access.log" combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.dev.example.com [OR]
RewriteCond %{SERVER_NAME} =dev.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost dev.example.com:443>
ServerName dev.example.com
DocumentRoot "C:/xampp/htdocs/dev.example.com/public"
<Directory "C:/xampp/htdocs/dev.example.com/public">
Require all granted
AllowOverride All
</Directory>
ErrorLog "logs/dev.example.com-error.log"
CustomLog "logs/dev.example.com-access.log" combined
SSLEngine on
SSLCertificateFile "cert/dev.example.com/server.crt"
SSLCertificateKeyFile "cert/dev.example.com/server.key"
</VirtualHost>
@Khnaz35
Copy link

Khnaz35 commented Jun 29, 2022

You did miss the V3.ext file

@SeBa1982
Copy link

subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = *.dev.example.com
DNS.3 = dev.example.com
DNS.4 = 127.0.0.1
DNS.5 = 127.0.0.2

@guggipower
Copy link

comment the crt make file

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