Brugerværktøjer

Webstedsværktøjer


webserver_with_apache_php

Dette er en gammel revision af dokumentet!


Apache & PHP

Add Ondrej repos for Apache & PHP

add-apt-repository ppa:ondrej/apache2
add-apt-repository ppa:ondrej/php

Install Apache & PHP

apt install apache2 libapache2-mod-fcgid php7.4-cli php7.4-curl php7.4-gd php7.4-intl php7.4-mbstring php7.4-opcache php7.4-soap php7.4-xmlrpc php7.4-common php7.4-fpm php7.4-imap php7.4-json php7.4-mysql php7.4-readline php7.4-xml php7.4-zip

Enable some modules

a2enmod proxy_fcgi setenvif md

IonCube

Download & install IonCube https://www.ioncube.com/loaders.php

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Copy content to /usr/local/

Create file /etc/php/7.4/mods-available/ioncube.ini with content:

zend_extension = /usr/local/ioncube/ioncube_loader_lin_7.4.so

Create links to this file

ln -s /etc/php/7.4/mods-available/ioncube.ini /etc/php/7.4/fpm/conf.d/00-ioncube.ini
ln -s /etc/php/7.4/mods-available/ioncube.ini /etc/php/7.4/cli/conf.d/00-ioncube.ini

Example of config file for a host

<VirtualHost *:80>
  ServerName hosting.gl
  ServerAlias www.hosting.gl
  DocumentRoot /srv/vhost/hosting.gl
  ServerAdmin webmaster@hosting.gl
  UseCanonicalName On
  CustomLog /var/log/apache2/hosting.gl.log combined

  <Directory /srv/vhost/hosting.gl/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>

  <IfModule proxy_fcgi_module>
    <FilesMatch \.(phtml|php[0-9]*)$>
      SetHandler proxy:unix:/run/php/hostinggl.sock|fcgi://hosting.gl
    </FilesMatch>
  </IfModule> 
</VirtualHost>

MDomain hosting.gl

<VirtualHost *:443>
  ServerName hosting.gl
  ServerAlias www.hosting.gl
  DocumentRoot /srv/vhost/hosting.gl
  ServerAdmin webmaster@hosting.gl
  UseCanonicalName On
  CustomLog /var/log/apache2/hosting.gl-ssl.log combined

  <Directory /srv/vhost/hosting.gl/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>

  Header always set X-Frame-Options DENY

  <IfModule mod_ssl.c>
    Include /etc/apache2/options-ssl-apache.conf
  </IfModule>

  <IfModule proxy_fcgi_module>
    <FilesMatch \.(phtml|php[0-9]*)$>
      SetHandler proxy:unix:/run/php/hostinggl.sock|fcgi://hosting.gl
    </FilesMatch>
  </IfModule>

  <IfModule headers_module>
    RequestHeader set X-HTTPS 1
  </IfModule>
</VirtualHost>


webserver_with_apache_php.1610483618.txt.gz · Sidst ændret: 2021/01/12 20:33 af noer