1- # How to add a domain in Xampp with SSL on localhost
1+ # Local domains with SSL in Xampp
22
33Xampp virtual hosts for your domain or subdomain with SSL on Apache2 and Laravel.
44
5- ## Windows add local host for example.org domain
5+ ## Windows add local host for app.test domain
66
77Open file as administrator ** C:\Windows\System32\drivers\etc\hosts** and append hosts
88
99``` sh
10- # Local domains and localhost
11- 127.0.0.10 db.xx www.db.xx
12- 127.0.0.11 example.org www.example.org
10+ # Local domain
11+ 127.0.0.10 app.test www.app.test
12+
13+ # Next domain
14+ # 127.0.0.11 example.com www.example.com
1315```
1416
1517## Create directory for domain and index.php file
1618
1719``` sh
1820# Domain dirs
19- D:/www/localhost
20- D:/www/db.xx/public
21- D:/www/example.org/public
21+ D:/web/localhost
22+ D:/web/app.test/public
2223
2324# Apache index.php file with
2425# <?php echo "works ...";
25- D:/www/localhost/index.php
26- D:/www/db.xx/public/index.php
27- D:/www/example.org/public/index.php
26+ D:/web/localhost/index.php
27+ D:/web/app.test/public/index.php
2828```
2929
3030## Xampp Apache config
@@ -37,24 +37,24 @@ Include "conf/extra/vhosts/*.conf"
3737
3838## Xampp Apache Virtualhost
3939
40- Add in ** xampp/apache/conf/extra/vhosts/example.org .conf**
40+ Add in ** xampp/apache/conf/extra/vhosts/app.test .conf**
4141
4242``` sh
43- < VirtualHost 127.0.0.11 :80>
44- DocumentRoot " D:/www/example.org /public"
43+ < VirtualHost 127.0.0.10 :80>
44+ DocumentRoot " D:/web/app.test /public"
4545 DirectoryIndex index.php
46- ServerName example.org
47- ServerAlias www.example.org
46+ ServerName app.test
47+ ServerAlias www.app.test
4848
49- ErrorLog " D:/www/example.org /storage/logs/example.org .error.log"
50- CustomLog " D:/www/example.org /storage/logs/example.org .access.log" common
49+ ErrorLog " D:/web/app.test /storage/logs/app.test .error.log"
50+ CustomLog " D:/web/app.test /storage/logs/app.test .access.log" common
5151
5252 # Redirect to https
5353 # RewriteEngine On
5454 # RewriteCond %{HTTPS} off
5555 # RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
5656
57- < Directory " D:/www/example.org /public" >
57+ < Directory " D:/web/app.test /public" >
5858 Options Indexes FollowSymLinks MultiViews
5959 AllowOverride all
6060 Order Deny,Allow
@@ -63,16 +63,16 @@ Add in **xampp/apache/conf/extra/vhosts/example.org.conf**
6363 < /Directory>
6464< /VirtualHost>
6565
66- < VirtualHost 127.0.0.11 :443>
67- DocumentRoot " D:/www/example.org /public"
68- ServerName example.org
69- ServerAlias www.example.org
66+ < VirtualHost 127.0.0.10 :443>
67+ DocumentRoot " D:/web/app.test /public"
68+ ServerName app.test
69+ ServerAlias www.app.test
7070
7171 SSLEngine on
7272 SSLCertificateFile " conf/ssl.crt/server.crt"
7373 SSLCertificateKeyFile " conf/ssl.key/server.key"
7474
75- < Directory " D:/www/example.org /public" >
75+ < Directory " D:/web/app.test /public" >
7676 Options Indexes FollowSymLinks MultiViews
7777 AllowOverride all
7878 Order Deny,Allow
@@ -82,17 +82,16 @@ Add in **xampp/apache/conf/extra/vhosts/example.org.conf**
8282< /VirtualHost>
8383```
8484
85- ## Restart Apache
85+ ## Restart Apache and browser
8686
8787Restart Xampp Apache server from xampp panel or restart Windows.
8888
8989## Run xampp server and website
9090
9191Accept invalid SSL for domain in (advanced button).
9292
93- < https://example.org >
93+ < https://app.test >
9494
9595## Testing
9696
97- Change example.org to a domain with dns mx records (for email testing in Laravel: app.xxx).
98-
97+ Change app.test to a domain with dns mx records (for email testing in Laravel: app.test).
0 commit comments