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

Apache VirtualHost and localhost

This worked for me! To run projects like http://localhost/projectName: <VirtualHost localhost:80> ServerAdmin localhost DocumentRoot path/to/htdocs/ ServerName localhost </VirtualHost> To run projects like http://somewebsite.com locally: <VirtualHost somewebsite.com:80> ServerAdmin webmaster@example.com DocumentRoot /path/to/htdocs/somewebsiteFolder ServerName www.somewebsite.com ServerAlias somewebsite.com </VirtualHost> The same for other websites: <VirtualHost anothersite.local:80> ServerAdmin webmaster@example.com DocumentRoot /path/to/htdocs/anotherSiteFolder ServerName www.anothersite.local ServerAlias anothersite.com </VirtualHost>

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

error_log per Virtual Host?

If somebody comes looking it should look like this: <VirtualHost *:80> ServerName example.com DocumentRoot /var/www/domains/example.com/html ErrorLog /var/www/domains/example.com/apache.error.log CustomLog /var/www/domains/example.com/apache.access.log common php_flag log_errors on php_flag display_errors on php_value error_reporting 2147483647 php_value error_log /var/www/domains/example.com/php.error.log </VirtualHost> This is for development only since display_error is turned on. You will notice that the Apache error log is separate from the … Read more

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

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

Okay: This is what I did now and it’s solved: My httpd-vhosts.conf looks like this now: <VirtualHost dropbox.local:80> DocumentRoot “E:/Documenten/Dropbox/Dropbox/dummy-htdocs” ServerName dropbox.local ErrorLog “logs/dropbox.local-error.log” CustomLog “logs/dropbox.local-access.log” combined <Directory “E:/Documenten/Dropbox/Dropbox/dummy-htdocs”> # AllowOverride All # Deprecated # Order Allow,Deny # Deprecated # Allow from all # Deprecated # –New way of doing it Require all granted </Directory> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)