Redirect a range of IPs using RewriteCond

If you’re using Apache HTTPD 2.4 or later, you can use expressions to match REMOTE_ADDR against a CIDR mask. The short form looks like this: RewriteCond expr “-R ‘192.168.1.0/24′” The following longer form is also available, but the documentation suggests it is less efficient: RewriteCond expr “%{REMOTE_ADDR} -ipmatch ‘192.168.1.0/24′” That makes the full solution to … Read more

nginx : Its Multithreaded but uses multiple processes?

Apache uses multiple threads to provide each request with it’s own thread of execution. This is necessary to avoid blocking when using synchronous I/O. Nginx uses only asynchronous I/O, which makes blocking a non-issue. The only reason nginx uses multiple processes, is to make full use of multi-core, multi-CPU and hyper-threading systems. Even with SMP … Read more

Laravel Routes not working, Apache configuration only allows for public/index.php/route

Two most common causes of this behavior are: mod_rewrite not enabled sudo a2enmod rewrite && sudo service apache2 restart AllowOverride is set to None, set it to All, assuming Apache2.4 sudo nano /etc/apache2/apache2.conf search for <Directory /var/www/> and change AllowOverride None to AllowOverride All, then save the file and restart apache

handle multiple domains with Access-Control-Allow-Origin header in Apache

For 3 domains, in your .htaccess: <IfModule mod_headers.c> SetEnvIf Origin “http(s)?://(www\.)?(domain1.org|domain2.com|domain3.net)$” AccessControlAllowOrigin=$0$1 Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin Header set Access-Control-Allow-Credentials true </IfModule> I’ve tried this and it works for me. Let me know if it doesn’t for you.

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 172.24.0.2. Set the ‘ServerName’ directive globally

I’d like to offer another (maybe more Docker-ish) way of solving the warning message. But first, it makes sense to understand what Apache is actually doing to figure out the domain name before just blindly setting ServerName. There is a good article at http://ratfactor.com/apache-fqdn.html which explains the process. Once we can confirm that getnameinfo is … Read more