Set all directories to 755, and all files to 644

If you need a quick way to reset your public_html data to 755 for directories and 644 for files, then you can use something like this: cd /home/user/domains/ . -type d -exec chmod 0755 {} \;find . -type f -exec chmod 0644 {} \; additionally, if you know php runs as the user and not as «apache», then you can set php files to 600, for an extra level of security, eg: find . -type Read more

Directly connect to PHP-FPM

During debugging, we often need to isolate problem first to make sure if its really PHP problem or Nginx is doing something wrong. In those cases, cgi-fcgi command might come handy. Installing cgi-fcgi of Ubuntu Just run following command: apt-get install libfcgi0ldbl Connect to PHP-FPM Directly Assuming you are running PHP-FPM using TCP/IP with IP and PORT values and 9000 respectively, below are some code sample you may want to execute. Test PHP-FPM Ping Read more

How to run an Ansible playbook locally

using Ansible command line: ansible-playbook --connection=local playbook.yml using inventory: ansible_connection=local using Ansible configuration file: [defaults] transport = local using playbook header: - hosts: connection: localThe first option only works as ansible-playbook --connection=local --inventory, playbook.ymlComma is essential, otherwise it's treated like file name.

Ansible: ввод sudo-пароля при выполнении playbook

Большинство действий в наборах инструкций системы управления конфигурациями Ansible следует выполнять с привилегиями суперпользователя. Давайте разберемся с вариантами ввода sudo-пароля при выполнении playbook’ов! Самый простой способ — отключить необходимость ввода пароля при использовании sudo. Делается это в конфигурационном файле /etc/sudoers, где нужно добавить (или раскомментировать) строку: ... %sudo ALL=(ALL:ALL) NOPASSWD: ALL ... Второй вариант — использовать дополнительные параметры при запуске набора инструкций. Чтобы Ansible в нужный момент попросил ввести sudo-пароль, в старых версиях (< 1.9) Read more

Создание учетной записи пользователя и пароля для нового дистрибутива Linux

Когда вы включите WSL и установите дистрибутив Linux из Microsoft Store, при открытии установленного дистрибутива Linux вам нужно будет сразу создать учетную запись и указать имя пользователя и пароль. Эти имя пользователя и пароль относятся к дистрибутиву Linux и не связаны с именем пользователя Windows. После создания этого имени пользователя и пароля учетная запись будет использоваться по умолчанию для этого дистрибутива, и вы сможете автоматически входить в систему при запуске. Эта учетная запись будет считаться Read more

Tutorial: Create a Docker Swarm with Persistent Storage Using GlusterFS

Unleashing a Docker Swarm orchestrator is a great (and relatively easy) way to deploy a container cluster. Yes, you could go with Kubernetes for more management features, but when you need the bare bones of a simple container cluster, Docker Swarm is a pretty good way to go. The one thing you might find yourself needing is persistent storage for your cluster. What is persistent storage? I’m glad you asked. To put it simply, persistent Read more

Docker Swarm and Shared Storage Volumes

As we know, volumes provide a flexible and powerful way to add persistent storage to managed dockers, but what should we do if we want to share storage volumes across several Docker hosts, for instance, a Swarm cluster? In this topic, we will consider a simple method of creating shared volumes usable across several swarm nodes using the sshfs volume driver. How it works? Considering the case when the majority of applications are data oriented Read more

Setting up XDebug for PHPStorm on Windows & WSL2

In this post, I’m going to go over my short journey to setup my PHP development environment on Windows 10. I will tell you how to setup PHPStorm to debug PHP applications using XDebug and PHP setup over Ubuntu 18.04 LTS on WSL2. I would like to work against the latest version of PHP and compile it myself. At the same time, setting up extensions and compiling PHP itself on windows is not a very Read more

Why is WSL2 so slow?

I’ve been playing around at using WSL2. This is my first time using Window Subsystem for Linux having skipped over WSL1. I typically like to write my software in Node JS, TypeScript and React and I assumed I would be fine jumping into the projects I had previously been working on in my previous Windows and Power Shell environment. The thing I noticed was that my React projects seemed to be running slowly. I mean Read more

How to Configure the Linux Firewall for Docker Swarm on Ubuntu 16.04

Docker Swarm is a feature of Docker that makes it easy to run Docker hosts and containers at scale. A Docker Swarm, or Docker cluster, is made up of one or more Dockerized hosts that function as manager nodes, and any number of worker nodes. Setting up such a system requires careful manipulation of the Linux firewall. The network ports required for a Docker Swarm to function correctly are: TCP port 2376 for secure Docker Read more

Любишь мемасики?

Подпишись на мой телеграм-канал!