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/08/06 14:04] – [Bash file example] tungntdevelopment:system:ubuntu [2025/01/01 07:51] (current) – [certbot] tungnt
Line 320: Line 320:
 $ ssh tungnt@ip_vps -p 2200 $ ssh tungnt@ip_vps -p 2200
 </code> </code>
 +
 +https://www.cybrosys.com/blog/how-to-setup-sftp-server-on-ubuntu-20-04
  
 ====== Cài đặt ứng dụng ====== ====== Cài đặt ứng dụng ======
Line 421: Line 423:
 $ php -v $ php -v
 $ php --ini $ php --ini
 +php -m | grep opentelemetry
 </code> </code>
  
Line 462: 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 505: Line 573:
      --no-parent \      --no-parent \
          http://astritbublaku.com/demos/albertos          http://astritbublaku.com/demos/albertos
 +         
 +wget \
 +     -e robots=off \
 +     --recursive \
 +     --no-clobber \
 +     --page-requisites \
 +     --html-extension \
 +     --convert-links \
 +     --restrict-file-names=windows \
 +     --domains demos.themeselection.com \
 +     --no-parent \
 +         https://demos.themeselection.com/materio-bootstrap-html-admin-template/html/vertical-menu-template/app-email.html         
 </code> </code>
  
Line 620: 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 661: Line 743:
 <code bash> <code bash>
 crontab -e crontab -e
 +
 +# Here are some more examples of how to use cron’s scheduling component:
 +* * * * * - Run the command every minute.
 +12 * * * * - Run the command 12 minutes after every hour.
 +0,15,30,45 * * * * - Run the command every 15 minutes.
 +*/15 * * * * - Run the command every 15 minutes.
 +0 4 * * * - Run the command every day at 4:00 AM.
 +0 4 * * 2-4 - Run the command every Tuesday, Wednesday, and Thursday at 4:00 AM.
 +20,40 */8 * 7-12 * - Run the command on the 20th and 40th minute of every 8th hour every day of the last 6 months of the year.
 </code> </code>
  
 **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
development/system/ubuntu.1722953090.txt.gz · Last modified: 2024/08/06 14:04 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki