Nginx Log Analytics - Get Insights From A Static Website

0
Comments
Nginx Log Analytics - Get Insights From A Static Website

A simple console application to analyze Nginx log files and visualize the results. It gives you a top-level overview of the website performance (views per day, views per week, top-performing pages, etc) and nothing more. It's written in .NET Core 3.1 and can be deployed as a self-contained application (no need for a .NET runtime)

Read further...

How to Make a Website Secure Again. Adding HSTS Response Header in NGINX

0
Comments
How to Make a Website Secure Again. Adding HSTS Response Header in NGINX

According to a Netcraft's study of the secured (SSL/TLS) sites they monitor, 95% of them are vulnerable to a simple man-in-the-middle attack because they didn't correctly implement HTTP Strict Transport Security (HSTS), a widely-supported security feature that prevents unencrypted HTTP connections to a server. Let's see why it's happening and how we can make your website secure, again.

Read further...

Nginx Server Blocks (Virtual Hosts) Example Template

0
Comments
Nginx Server Blocks (Virtual Hosts) Example Template

Here is an example of the nginx server block (Virtual Hosts) which you can use to host multiple web sites on the same server. Just replace example.com with your own domain name. Do not forget to create all required folders and sent right permissions. Copy one of those templates to the /etc/nginx/sites-available/example.com Proxy example # Ivan Derevianko aka druss http://ivanderevianko.com # Force without domain domain without www server { server_name www.example.com; listen 80; rewrite ^(.*) ht...

Read further...

[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + nginx

12
Comments
[ASP.NET 5] Production Ready Web Server on Linux. Kestrel + nginx

You can run ASP.NET 5 applications on Linux using kestrel web server. This is development web server, so it has limited functionality. But sometimes you need more functions, for example, https or virtual hosts support. Today we will see how to configure a system, so you can access your application through a domain name. First, you need ASP.NET 5 environment up and running.  You can use my article to install and configure everything, but it's a bit outdated, so it's better to use official documen...

Read further...

How-to Restore WordPress Site

0
Comments

In conclusion of "How-to Backup WordPress Site" article, here is small instruction to restore your backup: Upload files to VPS Upload you www.tar.gz and database.sql to the new VPS. You can use WinSCP (as described here) Extract www file structure Extract files: tar -xvf www.tar.gz And copy files: cp -a www/oldsite.com/www/* /var/yoursite.com/www Change permissions: cd /var/yoursite.com/www chown www-data:www-data -R * find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; Cre...

Read further...

[Fix] Call to undefined function imagecreatefromgif()

0
Comments

If you get following error: Call to undefined function imagecreatefromgif() You just need to install right version of GD. After 2.0.28 gif support was reverted back. To fix this error: sudo apt-get install php5-gd If you are using nginx with php5-fpm do: sudo /etc/init.d/php5-fpm restart

Read further...

Tool for enabling or disabling nginx sites (a2ensite analogue for nginx)

0
Comments

If you have previously used Apache you should now about a2ensite tool. If you start using nginx you probably find out that there are no such tool for nginx. You can use following command to do that: ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/mysite and then restart nginx sudo service nginx restart But... I have found one small script that can do that for you. Also, it can display list of all available or enabled sites, disable site and automatically restart nginx. Just put...

Read further...

nginx wordpress configuration

0
Comments

Simple but working nginx configuration for wordpress based web site... server { server_name site.com; root /var/site.com/www; index index.php; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ /\. { deny all; } location ~* /(?:uploads|files)/.*\.php$ { deny all; } location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/ph...

Read further...

Migrate from Apache to nginx + php-fpm and speed up your site twice

0
Comments
Migrate from Apache to nginx + php-fpm and speed up your site twice

This blog is hosted (together with mintchocolate.org) on a small VPS (1x2.8 Ghz, 256 Мб RAM, 10 Gb SSD). This VPS is shipped with apache2, php and mysql. As you can see I am using wordpress for this blog, also I have approximately 1000 unique visitors per day (half of them visit this and this articles). So it is good to have small response time. Apache First I need to measure how slow my blog is. I have used loadimpact.com to do that. This is result for apache2: [caption id="" align="aligncenter...

Read further...