development:system:ubuntu
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:system:ubuntu [2024/08/07 05:02] – [Thay đổi port ssh mặc định] tungnt | development: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 | ||
</ | </ | ||
Line 464: | Line 465: | ||
</ | </ | ||
+ | **Install Multiple PHP Versions:** | ||
+ | |||
+ | <code bash> | ||
+ | apt-get install software-properties-common gnupg2 -y | ||
+ | |||
+ | add-apt-repository ppa: | ||
+ | |||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | **Switch Between Multiple PHP Versions with Nginx:** | ||
+ | |||
+ | <file conf nginx.conf> | ||
+ | server { | ||
+ | listen | ||
+ | |||
+ | server_name | ||
+ | |||
+ | root / | ||
+ | |||
+ | index index.php index.html index.htm; | ||
+ | |||
+ | location / { | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
+ | |||
+ | location ~ \.php$ { | ||
+ | try_files | ||
+ | fastcgi_pass | ||
+ | fastcgi_index | ||
+ | fastcgi_param | ||
+ | include | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | fastcgi_pass | ||
+ | |||
+ | <file conf / | ||
+ | ... | ||
+ | ; The address on which to accept FastCGI requests. | ||
+ | ; Valid syntaxes are: | ||
+ | ; ' | ||
+ | ; a specific port; | ||
+ | ; ' | ||
+ | ; a specific port; | ||
+ | ; ' | ||
+ | ; (IPv6 and IPv4-mapped) on a specific port; | ||
+ | ; '/ | ||
+ | ; Note: This value is mandatory. | ||
+ | listen = 127.0.0.1: | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | https:// | ||
===== Supervisor ===== | ===== Supervisor ===== | ||
Line 507: | Line 573: | ||
| | ||
| | ||
+ | |||
+ | wget \ | ||
+ | -e robots=off \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
</ | </ | ||
Line 622: | Line 700: | ||
< | < | ||
certbot --nginx -d test.com -d www.test.com | certbot --nginx -d test.com -d www.test.com | ||
+ | |||
+ | sudo certbot delete | ||
</ | </ | ||
Line 663: | 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. | ||
</ | </ | ||
**Tham khảo:** https:// | **Tham khảo:** https:// |
development/system/ubuntu.1723006958.txt.gz · Last modified: 2024/08/07 05:02 by tungnt