Inglés

PHP 8.4 + Apache|Nginx + MySql|MariaDB + ExtFW

Download from Debian -- Obtener Debian

# sudo apt upgrade
# sudo apt full-upgrade
# sudo apt update
# sudo apt install openssh-server unzip wget
# sudo /etc/init.d/ssh start

# echo 'PS1="\[\e[33m\]\u \[\e[35m\]@ \[\e[31m\]\t \[\e[36m\]\w \[\e[37m\] n\$ "' >> ~/.bashrc
#  ~/.bashrc
# vi /root/.bashrc
# echo 'PS1="\[\e[35m\]\u \[\e[31m\]@ \[\e[36m\]\t \[\e[32m\]\w \[\e[37m\] n\$ "' >> /root/.bashrc

#PHP

# sudo apt install php php-{cli,fpm,gd,zip,xml,bz2,curl,mbstring,intl,soap,bcmath}
# echo '<?php phpinfo();' /var/www/html/test.php
# sudo service php8.4-fpm start

#MySQL / MariaDb

# sudo apt install php-mysql mariadb-server
# mysql
CREATE DATABASE `dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish_ci; 
CREATE USER dbuser@'%' IDENTIFIED BY 'dbpass'; 
GRANT USAGE ON *.* TO dbuser@'%' IDENTIFIED BY 'dbpass' 
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0  
     MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; 
GRANT ALL PRIVILEGES ON dbname.* TO dbuser@'%' WITH GRANT OPTION ; 

Composer (opcional)

Sólo es necesario instalar composer si su instalación va actuar como repositorio o marketplace.
Instalar desde la web https://getcomposer.org/download

# php composer.phar 
# php composer.phar require dompdf/dompdf

OCI 8

Cliente Oracle
Oracle: Instant Client for Linux x86-64 (64-bit) https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
Adaptar las instrucciones siguientes al número de versión a instalar, normalmente la mas reciente.

#apt autoremove
#apt update
# apt upgrade
# cd /home/usuario/downloads/
# wget https://download.oracle.com/otn_software/linux/instantclient/2370000/instantclient-basic-linux.x64-23.7.0.25.01.zip
# wget https://download.oracle.com/otn_software/linux/instantclient/2370000/instantclient-sdk-linux.x64-23.7.0.25.01.zip
# apt install -y php8.4-dev php-pear libaio1 build-essential unzip wget
# mkdir -p /opt/oracle
# unzip instantclient-basic-linux.x64-23.7.0.25.01.zip -d /opt/oracle
# unzip instantclient-sdk-linux.x64-23.7.0.25.01.zip -d /opt/oracle (Responder A)
# cd /opt/oracle/instantclient_23_7/
# ln -s libclntsh.so.23.1 libclntsh.so
# ln -s libocci.so.23.1 libocci.so
# echo "/opt/oracle/instantclient_23_7" | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf
# ldconfig
# pecl channel-update pecl.php.net
# pecl install oci8 

Please provide the path to the ORACLE_HOME directory: instantclient,/opt/oracle/instantclient_23_7

# echo "extension=oci8.so" | sudo tee /etc/php/8.4/mods-available/oci8.ini
# ln -s /etc/php/8.4/mods-available/oci8.ini /etc/php/8.4/fpm/conf.d/20-oci8.ini
# ln -s /etc/php/8.4/mods-available/oci8.ini /etc/php/8.4/cli/conf.d/20-oci8.ini
# systemctl restart php8.4-fpm
# systemctl restart nginx
# php -i | grep -i oci8

Apache2

# sudo apt install apache2 openssl
# sudo a2enmod ssl
# sudo a2enmod rewrite
# sudo vi /etc/apache2/apache2.conf
<directory var/www/html>
    AllowOverride ALL
</directory>
# sudo mkdir /etc/apache2/certs
# cd /etc/apache2/certs
# sudo openssl req -new -newkey rsa:4096 -x509 -sha256 -days 5475 -nodes -out apache.crt -keyout apache.key
Country Name (2 letter code) [AU]:ES
State or Province Name (full name) [Some-State]:<state>
Locality Name (eg, city) []:<city>
Organization Name (eg, company) [Internet Widgits Pty Ltd]:<company>
Organizational Unit Name (eg, section) []:<unit>
Common Name (e.g. server FQDN or YOUR name) []:localhost
Email Address []:email@addr.ess
# sudo vi /etc/apache2/sites-enabled/000-default.conf
<virtualhost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/certs/apache.crt
SSLCertificateKeyFile /etc/apache2/certs/apache.key
</virtualhost>
# sudo /etc/init.d/apache2 start

#ExtFW ExtraLAB Framework

# export USER=usuario
# mkdir /var/www/media
# sudo vi /var/www/html/fix.sh
#!/bin/bash
find /var/www/html -type f -exec chmod 644 {} \; &
find /var/www/html -type d -exec chmod 1755 {} \; &
find /var/www/html -exec chown ${USER}:www-data {} \; &
find /var/www/html/media -exec chown ${USER}:www-data {} \; &
find /var/www/media -type d -exec chmod 1755 {} \; &
find /var/www/media -type f -exec chmod 644 {} \; &
find /var/www/media -exec chown ${USER}:www-data {} \; &
jobs
# sh /var/www/html/fix.sh
# cd /var/www/html
# sudo wget https://software.extralab.net/jux_installer.zip
# unzip jux_installer.zip

Load https://{IP}/install.php in browser

Crear ZIP módulo
https://[HOST]/control_panel/ajax/update/instal/custom_module/[MODULE_NAME]

#Nginx


Enlaces:
https://makarainen.net/how-to-install-nginx-php-letsencrypt-ssl-on-ubuntu-cheat-sheet
https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-on-debian-8
https://askubuntu.com/questions/1379425/system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate

# sudo apt install nginx
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
Country Name (2 letter code) [AU]:ES
State or Province Name (full name) [Some-State]:MURCIA
Locality Name (eg, city) []:MURCIA
Organization Name (eg, company) [Internet Widgits Pty Ltd]:ACHO
Organizational Unit Name (eg, section) []:PIJO
Common Name (e.g. server FQDN or YOUR name) []:localhost
Email Address []: mi@email.es
# sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
# sudo vi /etc/nginx/snippets/self-signed.conf
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
# sudo vi /etc/nginx/snippets/ssl-params.conf
# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
# Disable preloading HSTS for now.  You can use the commented out header line that includes
# the "preload" directive if you understand the implications.
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;

ssl_dhparam /etc/ssl/certs/dhparam.pem;
# sudo vi /etc/nginx/sites-available/default
server {
        listen 443 ssl default_server;
        listen [::]:443 ssl default_server;
        include snippets/self-signed.conf;
        include snippets/ssl-params.conf;
        root /var/www/html;
        index index.php index.html index.htm index.nginx-debian.html;
        server_name _;
        location / {
                try_files $uri $uri/ @ci_index;
        }
        location @ci_index{
                rewrite ^(.*) /index.php?$1 last;
        }
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php8.4-fpm.sock;
                # With php-cgi (or other tcp sockets):
                # fastcgi_pass 127.0.0.1:9000;
        }
}
# sudo service php8.4-fpm stop
# sudo service php8.4-fpm start

Activar cambis en Nginx

# sudo nginx -t

Instalar módulos php en NGINX

# sudo apt install php-module
# sudo /etc/init.d/php8.4-fpm reload

Cambiar entre a php8.0 y php 8.4

# a2disconf php8.4-fpm && a2enconf php8.0-fpm && systemctl reload [apache2|nginx] // de 8.4 a 8.0
# a2disconf php8.0-fpm && a2enconf php8.4-fpm && systemctl reload [apache2|nginx] // de 8.0 a 8.4

#Services

sudo systemctl start apache2.service
sudo systemctl start mariadb.service

sudo systemctl stop apache2.service
sudo systemctl stop mariadb.service

sudo systemctl enable mariadb.service
sudo systemctl enable mariadb-server.service
sudo systemctl enable apache2.service

sudo systemctl disable mariadb.service
sudo systemctl disable mariadb-server.service
sudo systemctl disable apache2.service

sshpass -p "Password" rsync -e "ssh -o StrictHostKeyChecking=no" -a usuario@nombre_maquina:/PRUEBA_RSYNC /

#Links

https://midu.dev/centrar-elementos-css/

https://midu.dev/como-extraer-el-critical-css-con-puppeteer/

https://midu.dev/como-instalar-node-en-mac-y-windows/

https://midu.dev/adios-google-analytics-alternativas-para-tener-estadisticas-en-tu-web/

https://midu.dev/cargar-google-analytics-de-forma-optima/

https://midu.dev/lazy-loading-imagenes-html/

https://midu.dev/cargar-scripts-asincronos-en-javascript/

https://midu.dev/leer-copiar-pegar-portapapeles-javascript/

https://ourcodeworld.com/articles/read/322/how-to-convert-a-base64-image-into-a-image-file-and-upload-it-with-an-asynchronous-form-using-jquery#google_vignette

https://feriman.com/upgrading-raspberry-pi-os-from-bullseye-to-bookworm-11-to-12/









-  
Página 0 de 0 0%
Texto JSON READ WRITE DELETE FAIL

Ésta página utiliza cookies propias y almacenamiento local para facilitar el uso de nuestra web. Si continua navegando, supone la aceptación de nuestra política de cookies. Tenga en cuenta que si las desactiva no podrá utilizar nuestra tienda.