How to debug an apache virtual host configuration?

Syntax check To check configuration files for syntax errors: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -t # Debian-based (Ubuntu) apache2ctl -t # MacOS apachectl -t List virtual hosts To list all virtual hosts, and their locations: # Red Hat-based (Fedora, CentOS), Arch-based and OSX httpd -S # Debian-based (Ubuntu) apache2ctl -S # … Read more

Apache default VirtualHost

I found the answer: I remembered that Apache uses the first block if no other matching block is found, so I’ve added a block without a serveralias at the top of the blocks: NameVirtualHost * <VirtualHost *> DocumentRoot /defaultdir/ </VirtualHost> <VirtualHost *> ServerAdmin admin@example.com DocumentRoot /someOtherDir/ ServerAlias ip.of.the.server </VirtualHost> <VirtualHost *> ServerAdmin admin@example.com DocumentRoot /someroot/ … Read more

Nginx TCP forwarding based on hostname

This is now possible with the addition of the ngx_stream_ssl_preread module added in Nginx 1.11.5 and the ngx_stream_map module added in 1.11.2. This allows Nginx to read the TLS Client Hello and decide based on the SNI extension which backend to use. stream { map $ssl_preread_server_name $name { vpn1.app.com vpn1_backend; vpn2.app.com vpn2_backend; https.app.com https_backend; default … Read more

Virtualhost For Wildcard Subdomain and Static Subdomain

<VirtualHost *:80> DocumentRoot /var/www/app1 ServerName app1.example.com </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/example ServerName example.com </VirtualHost> <VirtualHost *:80> DocumentRoot /var/www/wildcard ServerName other.example.com ServerAlias *.example.com </VirtualHost> Should work. The first entry will become the default if you don’t get an explicit match. So if you had app.otherexample.com point to it, it would be caught be app1.example.com.

how to create virtual host on XAMPP [duplicate]

Step 1) C:\WINDOWS\system32\drivers\etc\ Open the “hosts” file : 127.0.0.1 localhost 127.0.0.1 test.com 127.0.0.1 example.com Step 2) xampp\apache\conf\extra\httpd-vhosts.conf <VirtualHost *:80> DocumentRoot C:/xampp/htdocs/test/ ServerName www.test.com </VirtualHost> <VirtualHost *:80> DocumentRoot C:/xampp/htdocs/example/ ServerName www.example.com </VirtualHost> Step 3) C:\xampp\apache\conf\httpd.conf. Scroll down to the Supplemental configuration section at the end, and locate the following section (around line 500), Remove the # … Read more

tech