How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

January 30, 2020

Ubuntu 18 imagemagick convert: not authorized

Filed under: Linux — Tags: , , , — admin @ 7:01 pm

Well on ubuntu 18 try to convert some pdf error

convert: not authorized /pdf/original/70/5770.pdf' @ error/constitute.c/ReadImage/412. convert: no images defined/pdf/processed/70/5770.jpg’ @ error/convert.c/ConvertImageCommand/3258.

The solution is to modify the /etc/ImageMagick-6/policy.xml

At the end this

domain=”coder” rights=”none” pattern=”PDF”

Into this

domain=”coder” rights=”read|write” pattern=”PDF”

How to Install PHP-FPM with Apache on Ubuntu 18.04

Filed under: Linux — Tags: , — admin @ 3:33 pm

Common module for php are

apt install php7.1-fpm php7.1-common php7.1-mysql php7.1-xml php7.1-xmlrpc php7.1-curl php7.1-gd php7.1-imagick php7.1-cli php7.1-dev php7.1-imap php7.1-mbstring php7.1-soap php7.1-zip php7.1-bcmath -y

To install apache

apt install apache2

Enable mod proxy

sudo a2enmod proxy_fcgi

A virtual host example

<VirtualHost *:80>
     ServerName External_IP_Address
     DocumentRoot /var/www/html

     <Directory /var/www/html>
          Options Indexes FollowSymLinks
         AllowOverride All
         Require all granted

     <FilesMatch ".php$"> 
         SetHandler "proxy:unix:/var/run/php/php7.1-fpm.sock|fcgi://localhost/"          
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined  

August 29, 2019

Bind mount

Filed under: Linux — Tags: , , , — admin @ 1:34 pm
I note this for me . I need to see a log directory on the account over scp. So one soulution for me was to mount with bind the log directory.

mount --bind /some/where /mnt/readonly
mount -o remount,ro,bind /mnt/readonly

August 19, 2019

Docker COPY failed: stat

Filed under: Linux — Tags: , — admin @ 12:30 pm

Today I am trying to use docker and saw this problem

COPY failed: stat /var/lib/docker/tmp/docker-builder749895154/docker-directory/apache/project.conf: no such file or directory

The fix for this problem is to check your .gitignore file , and add a exception for that directory


January 16, 2019

How to deny execution of php on some directory

Filed under: Linux — Tags: , , , — admin @ 1:12 pm
Just add this on your .htaccess in that directory and php will not be executed.
# Kill PHP Execution
<Files ~ "\.ph(?:p[345]?|t|tml)$">
deny from all
« Newer PostsOlder Posts »

Powered by WordPress