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/09/07 14:50] – [Cron job] 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 634: | Line 700: | ||
< | < | ||
certbot --nginx -d test.com -d www.test.com | certbot --nginx -d test.com -d www.test.com | ||
+ | |||
+ | sudo certbot delete | ||
</ | </ | ||
Line 687: | Line 755: | ||
**Tham khảo:** https:// | **Tham khảo:** https:// | ||
- | |||
- | https:// |
development/system/ubuntu.1725720605.txt.gz · Last modified: 2024/09/07 14:50 by tungnt