TungNT (Blue)

tungnt.blue@gmail.com

User Tools

Site Tools


development:system:ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:system:ubuntu [2024/09/07 14:50] – [Cron job] tungntdevelopment:system:ubuntu [2025/01/01 07:51] (current) – [certbot] tungnt
Line 423: Line 423:
 $ php -v $ php -v
 $ php --ini $ php --ini
 +php -m | grep opentelemetry
 </code> </code>
  
Line 464: Line 465:
 </code> </code>
  
 +**Install Multiple PHP Versions:**
 +
 +<code bash>
 +apt-get install software-properties-common gnupg2 -y 
 +
 +add-apt-repository ppa:ondrej/php 
 +
 +apt-get update -y 
 +
 +apt-get install php7.2 php7.2-fpm php7.2-cli -y
 +apt-get install php7.4 php7.4-fpm php7.4-cli -y
 +apt-get install php8.0 php8.0-fpm php8.0-cli -y
 +apt-get install php8.1 php8.1-fpm php8.1-cli -y
 +
 +php --version 
 +
 +# Set the Default PHP Version:
 +update-alternatives --config php 
 +</code>
 +
 +**Switch Between Multiple PHP Versions with Nginx:**
 +
 +<file conf nginx.conf>
 +server {
 +        listen       80;
 +
 +        server_name  template.1site.vn api-template.1site.vn cms-template.1site.vn;
 +
 +        root       /var/www/1site/template.1site.vn/public/;
 +
 +        index index.php index.html index.htm;
 +
 +        location / {
 +                try_files $uri $uri/ /index.php?$query_string;
 +        }
 +
 +        location ~ \.php$ {
 +                try_files      $uri = 404;
 +                fastcgi_pass   127.0.0.1:9082;
 +                fastcgi_index  index.php;
 +                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
 +                include        fastcgi_params;
 +        }
 +}
 +</file>
 +
 +fastcgi_pass   127.0.0.1:9082; => Version PHP
 +
 +<file conf /opt/homebrew/etc/php/8.2/php-fpm.d/www.conf>
 +...
 +; The address on which to accept FastCGI requests.
 +; Valid syntaxes are:
 +;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
 +;                            a specific port;
 +;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
 +;                            a specific port;
 +;   'port'                 - to listen on a TCP socket to all addresses
 +;                            (IPv6 and IPv4-mapped) on a specific port;
 +;   '/path/to/unix/socket' - to listen on a unix socket.
 +; Note: This value is mandatory.
 +listen = 127.0.0.1:9082
 +...
 +</file>
 +
 +https://help.clouding.io/hc/en-us/articles/360021630059-How-to-Install-Multiple-PHP-Versions-7-2-7-4-8-0-and-8-1-on-Ubuntu-20-04
 ===== Supervisor ===== ===== Supervisor =====
  
Line 634: Line 700:
 <code> <code>
 certbot --nginx -d test.com -d www.test.com certbot --nginx -d test.com -d www.test.com
 +
 +sudo certbot delete
 </code> </code>
  
Line 687: Line 755:
  
 **Tham khảo:** https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-ubuntu-1804 **Tham khảo:** https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-ubuntu-1804
- 
-https://help.clouding.io/hc/en-us/articles/360021630059-How-to-Install-Multiple-PHP-Versions-7-2-7-4-8-0-and-8-1-on-Ubuntu-20-04 
development/system/ubuntu.1725720605.txt.gz · Last modified: 2024/09/07 14:50 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki