What is the purpose of running PHP-FPM in its own container instead in the same container as apache2/nginx?

I’m fairly new to Docker so excuse any obvious ignorance or misunderstandings. That said, I’ve been coding and configuring web applications for a long time now. I have recently been dabbling with some more sophisticated (Docker and “traditional”) web/application server setups and experimenting with performance enhancements and simplifying deployments.

My personal favorite configuration to use for most projects thus far is nginx as a (mostly) “static file” web server &&|| caching mechanism &&|| Load Balancer in a reverse proxy config with Apache v2.4+ as the “backend” which runs PHP (also Perl &&|| Python) in a “FastCGI” (PHP-FPM) configuration (with mod_php disabled) and mpm_events (instead of mpm_prefork). We can always add in something else also such as REDIS or memcached, where applicable (but I rarely see a significant performance gain when using Cloudflare caching).

I’ve been dabbling with a few different ways to keep my “favorite web server composition” flexible and “ephemeral” enough to accommodate any and all possible options for further performance gain or resource load management. What I keep seeing is that there seems to have been a shift towards using PHP-FPM in its own separate “stand-alone” Docker container sometimes around late 2019.

Why?

While I can appreciate keeping resources isolated and separate for an easier to debug/config/secure configuration(s), I don’t fully understand what the benefits are to having PHP-FPM in a separate Docker container that is implicitly REQUIRED by the application that the Docker containers are comprising.

If anything, having a separate PHP-FPM container seems like additional configuration, additional resource consumption and an even more complicated build/deploy consideration in a CI/CD pipeline.

I can even get onboard with “simple preference”, such as instead of using Apache2 and nginx on the same Ubuntu/Debian or RHEL/CentOS container, break off nginx into its own container(s) and simply config your hostname(s) &&|| IPs and ports appropriately.

But what is a practical use case and advantages for having PHP-FPM separated from Apache or nginx containers for any additional benefit beyond perhaps using more Dockerfile &&|| docker-compose.yaml and less ba.sh scripting to get the same job done? If any part of the application fails or falters, then functionality will suffer. The additional network &&|| docker-network communications and hostname resolutions seems like it would just be a performance penalty over combining certain aspects of the docker-composer-ed application together, rather than splitting them up simply for the sake of splitting them up.

Go to Source
Author: kanidrive

How to migrate data from custom site to WordPress?

Currently I have a site with around 6.000 articles running on a custom built cms platform, but due to demand from the client, we have been tasked to convert all data to WordPress. Everything is stored in MongoDB in a custom structure (nothing extraordinary) and I have been looking at how I could convert the data to match the XML structure of WordPress for easy import, though not sure if I have to build such conversion script myself, or if an open source data-pairing tool exists, where I can match a MongoDB query and its data to the designated fields in a WordPress DB.

The article contents have been structured using EditorJS which acts a lot in the same way as the Gutenberg editor in WordPress, though I would need to know, how I should convert the data to match the Gutenberg editor, or if I should simply render the data as HTML and save it as such in the XML for import?

Categories are stored in a separate collection with a parent -< child structure, and pages pretty much acts as normal html.

Q: How would one go about converting this to WordPress data?

Go to Source
Author: Dimser

ubuntu doesn’t work :UUID=xxxx does not exitst

My computer has two systems, Windows 10 and ubuntu18.04. Today, when I tried to get into Ubuntu(I already laid it aside for about one week ), the whole screen showed pure purple for at least 10 minutes, so I forced the computer to shut down.Then when I tried to get into Ubuntu again, it showed :
[enter image description here][1]
Then I tried to open ubuntu in recovery mode,but the outcome was same.And I also tried this solution:https://forums.linuxmint.com/viewtopic.php?t=47594,doesn’t work either.
At last I run fsck.ext4 -y /dev/sda1(where the root is),and showed:
[enter image description here][2]
Anyone know how to deal with is issue?Any help would be appreciated!
[1]: https://i.stack.imgur.com/n0nw2.png
[2]: https://i.stack.imgur.com/xEiga.png

Go to Source
Author: OilLight

Refactor unit tests?

When we work with legacy code and need to do changes, we first write tests on the current behavior. That way we can implement new changes with confidence. We can even refactor the code.

Legacy code is often bad code, and after some refactoring the code may be simpler, easier to test. Since the refactor has been validated by the tests should we also refactor the tests if we can make them simpler/clearer or keep them as they were written?

Go to Source
Author: JayZ

Why .deb packages never add desktop and start menu shortcuts, even if installed software is graphical UI only?

Sorry if it’s a lame question but why installing software from .deb package never seems to add any shortcuts to desktop and start menu, even if installed software is a graphical UI program?

For example, try installing Chrome on fresh Ubuntu 20.20. You go to official chrome page where it will point you to the latest .deb package. Great. You download and install the package. Perfect. But then what?

No shortcut on desktop, no icon in start menu and -if you happened to close the package installer window – you even have no clue where the software was installed.

Is this fundamentally impossible due to some technical limitations of the package manager or is it just laziness of package creators which don’t care about auto creating those launcher shortcuts on desktop?

I’ve just installed new Ubuntu, installed Chrome and was puzzled how counter-intuitive and user-unfriendly the whole process is. I had to 1) find where the stuff from .deb was physically installed 2) create launcher manually 3) assign an icon to the shortcut manually.

Go to Source
Author: PawelRoman

How to download a zipfile from a Github repository

I’m trying to download a zipfile from a Github repository with this command:

wget --no-check-certificate https://github.com/brendenlake/omniglot/blob/master/python/images_evaluation.zip -O /tmp/images_evaluation.zip

But it doesn’t download a valid zip file. I suppose that it downloads the HTML file that the browser shows if you click on the url.

How can I download a zip file from a public Github repository using wget?

Go to Source
Author: VansFannel

Alternative to synonym search over AWS managed Elasticsearch instance

I am working a search implementation wherein I have to use the synonym filter but the challenge I am facing here is how do I make it dynamic, I can not pass the filters in the mapping itself. I need some way to externalize it. But apparently, its not supported in the AWS managed version.

Is there any other way I can do it here?

Go to Source
Author: Steve B

mouse and keyboard not working on Ubuntu 20.04

I’m sorry I’m new to Ubuntu so I’ll try be as descriptive as possible.
At the moment my mouse is working when plugged into a specific USB port on the back of my PC. However when I move it to another port it doesn’t work. If I plug my keyboard into this same USB port then the keyboard will work and the mouse won’t. I have my system on a dual boot at the moment and I know for a fact that both the mouse and keyboard do work, it’s only when I reach the login screen that I have issues with my keyboard/mouse. I have tried other solutions given on this site and elsewhere but they don’t seem to work.
Like I said I’m new to Ubuntu and Linux as a whole so I’m sorry if this is an obvious question.

Go to Source
Author: Alexander Hunter

Multiple intersection tables vs multiple joins

I have a hierarchical relationship between my tables, with the children having foreign keys referring back to their parent ids (assuming id is the primary key for each table):

Department has many Category Groups
Category Group has many Category(-ies)
Category has many Sub-Category(-ies)
Sub-Category has many Attributes.

Now, all these entities except for Attributes are optional meaning if I don’t select anything on my hierarchical cascading dropdown based UI, I need to display the Attributes that belong to all Departments, if I only select a Department then I need to display Attributes that belong to all Category Groups belonging to that Department and so on.

Obviously, one option to implement it is to do a inner join between all the tables to get to Attribute. For instance, if nothing is selected it will be:
Department inner join Category Group
inner join Category
inner join Sub-Category
inner join Attribute
to show all the attributes belonging to all departments.

The other thought in my head is to have intersection/relation mapping table(s) –
DepartmentAttributeRelation which has foreign keys to Department and Attribute,
CategoryGroupAttributeRelation which has foreign keys to CategoryGroup and Attribute and so on.
This will enable direct search to get to the Attributes given any entity.

My question is – Are there any downsides to the second approach above or are there any better approaches to solve this?

Go to Source
Author: linuxNoob

Is `en_US.utf8` canonically wrong?

The output of locale seems to distinguish between upper and lowercase:

% locale -a 
C
en_AU.utf8
en_US.utf8
POSIX

Almost everywhere else in the wild seems to use the uppercase .UTF8, however glibc normalises locales to lowercase, and comments:

There is no standard for the codeset names.

What is the standard that defines the form <language>_<country>.<codeset>? Is it really silent on code page capitalisation?

Go to Source
Author: Tom Hale

How to apply custom filters for John The Ripper when cracking RAR3 archive password?

My problem is that I’m trying to crack RAR file with is encrypted with RAR3 encryption.
Decided to try with John The Ripper.
Here are clues I have from my friend.

  1. Max password length is 8
  2. Only capital letters or digits

And I need now filter to make John crack the password without trying to check small lowercase letters.
On hashcat it’s easy to do but program do not support $RAR3$*1 type of hashes.

Go to Source
Author: Madiator2011

GRUB not picking up windows boot manager which is in another drive

Ubuntu 18.04 LTS and Windows 10
I have a laptop that has an SSD and a hard drive
Windows is on the SSD and Ubuntu on the Hard Drive
I made a separate EFI partition while installing ubuntu using the “Something Else” option
When I boot my laptop I have to press “Esc” key to enter GRUB and it does not pickup the windows boot manager
Moreover, Ubuntu is not detecting the SSD
What to do ?
Please ask for any additional info required

Go to Source
Author: Tanmay Bhatnagar