This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
# The ServerName directive sets the request scheme, hostname and port that | |
# the server uses to identify itself. This is used when creating | |
# redirection URLs. In the context of virtual hosts, the ServerName | |
# specifies what hostname must appear in the request's Host: header to | |
# match this virtual host. For the default virtual host (this file) this | |
# value is not decisive as it is used as a last resort host regardless. | |
# However, you must set it for any further virtual host explicitly. | |
#ServerName www.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pitfalls when using caching in nginx | |
The web server and reverse-proxy nginx have very powerful features for caching HTTP responses. However, in some cases, documentation and examples are not enough, as a result, not everything turns out as easy and simple as we would like. For example, my nginx configs are written in blood in some places. With this article I will try to improve the situation a little. | |
In this article: a) pitfalls with full-page caching; b) caching with rotation; c) creating a dynamic “window” in a cached page. | |
I will assume that you are using the nginx + fastcgi_php bundle. If you are using nginx + apache + mod_php, just replace the directive names with fastcgi_cache * with proxy_cache * | |
If I choose whether to cache the page on the PHP side or on the nginx side, I select nginx. Firstly, it allows you to send 5-10 thousand requests per second without any difficulties and without smart talk about the "high load". Secondly, nginx independently monitors the size of the cache and cleans it both |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuring Nginx + LAMP server at home. Part 1: Setting up the frontend - backend | |
Hello. I recently asked a question about creating a series of articles. Here is the first article. | |
In this series of articles, you will learn how to correctly configure the LAMP server, but "hosting is only more powerful." | |
We will use the following stack: nginx - apache-mpm-itk - mod_php - mysql - linux / debian. | |
I will cover the following topics: | |
Frontend setup - backend | |
Calculation of server capabilities, setting up mysql and backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://medium.com/@chasinglogic/the-definitive-guide-to-password-store-c337a8f023a1 | |
https://www.saintsjd.com/2011/03/automated-deployment-of-wordpress-using-git/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: Check if strict mode is enabled | |
We first need to establish if strict mode is enabled on the MySQL | |
server. To check this, type the command below on a terminal server: | |
$ sudo mysql -u root -p | |
Enter your MySQL database root password and press Enter. | |
Then, you will need to run the query below on the MySQl command prompt: | |
$ SHOW VARIABLES LIKE 'sql_mode'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSH | |
Generate ssh keys | |
Ed25519 is an EdDSA scheme with very small (fixed size) keys, | |
introduced in OpenSSH 6.5, to check sshd version use sshd -V | |
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_personal_$(date +%Y-%m-%d) | |
-C "Let's Play" -a 100 , | |
for old severs ssh-keygen -t rsa -b 4096 -o -a 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete all but .ext "rm -- !(*.ext)" | |
# file and folder permissions | |
# find . -type f -exec chmod 644 {} \; file permissions | |
# find . -type d -exec chmod 755 {} \; folder permissions | |
# dos to unix | |
# find . -type f -name '*.php' -exec dos2unix '{}' + | |
# photo on trm "display photo.ext" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Automated Deployment of PHP Applications using git | |
Heroku is a sweet hosting platform which offers a pure git deployment workflow. I love using it to deploy my Rails projects. I miss using it when I deploy a PHP application. | |
Lets fix that…. Here is a quick heroku-ish git deployment workflow for your PHP applications. We will be using Wordpress for this example. The same steps can be adapted for Drupal or any other PHP application. | |
Our goal is to development and test new features, themes, and plugins for Wordpress locally on our development machine. When changes are working properly, we want to deploy them to our live site with one command: | |
git push origin master | |
#1: Set up password-less login to your webserver with SSH keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# i3status configuration file. | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! | |
general { | |
colors = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout some time, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see https://i3wm.org/docs/userguide.html for a complete reference! |