How to , and other stuff about linux, photo, php … Another blog just like others on internet

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”

pdftk ubuntu 18

Filed under: Linux — Tags: , — admin @ 6:22 pm

Today I have tried to install pdftk on ubuntu 18 . After search on developer site I saw that are package only for the redhat/centos.

So after a few search find out that you can install it with snap install pdftk

However this will not work .

Error: Unable to find file.
Error: Failed to open PDF file:
Errors encountered. No output created.
Done. Input errors, so no output created.

Errors like this you will see.

One solution is to download and install from other links

cd /tmp
# download packages
wget http://launchpadlibrarian.net/340410966/libgcj17_6.4.0-8ubuntu1_amd64.deb \
 http://launchpadlibrarian.net/337429932/libgcj-common_6.4-3ubuntu1_all.deb \
 https://launchpad.net/ubuntu/+source/pdftk/2.02-4build1/+build/10581759/+files/pdftk_2.02-4build1_amd64.deb \
 https://launchpad.net/ubuntu/+source/pdftk/2.02-4build1/+build/10581759/+files/pdftk-dbg_2.02-4build1_amd64.deb

And after that you can install them with 
sudo apt-get install ./libgcj17_6.4.0-8ubuntu1_amd64.deb \
    ./libgcj-common_6.4-3ubuntu1_all.deb \
    ./pdftk_2.02-4build1_amd64.deb \
    ./pdftk-dbg_2.02-4build1_amd64.deb

After that you can remove those from /tmp directory

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
     </Directory>

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

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

!docker-directory/

« Newer PostsOlder Posts »

Powered by WordPress