FreeBSD: diferenças entre revisões
Ir para a navegação
Ir para a procura
Sem resumo de edição |
|||
| (Há 12 edições intermédias do mesmo utilizador que não estão a ser apresentadas) | |||
| Linha 3: | Linha 3: | ||
== Sistema == | == Sistema == | ||
< | <syntaxhighlight lang="bash"> | ||
freebsd-update fetch | freebsd-update fetch | ||
freebsd-update install | freebsd-update install | ||
</ | </syntaxhighlight> | ||
== Ports == | == Ports == | ||
<syntaxhighlight lang="bash"> | |||
pkg update | |||
pkg upgrade -y | |||
</syntaxhighlight> | |||
= Serviços = | = Serviços = | ||
== | == Nginx == | ||
=== Instalação === | === Instalação === | ||
< | <syntaxhighlight lang="bash"> | ||
pkg install nginx | pkg install nginx | ||
sysrc nginx_enable="yes" | sysrc nginx_enable="yes" | ||
service nginx start | service nginx start | ||
</ | </syntaxhighlight> | ||
=== Configuração === | === Configuração === | ||
/usr/local/etc/nginx/nginx.conf | * /usr/local/etc/nginx/nginx.conf | ||
< | <syntaxhighlight lang="nginx"> | ||
user www; | user www; | ||
worker_processes 4; | worker_processes 4; | ||
</ | </syntaxhighlight> | ||
=== Certbot === | |||
<syntaxhighlight lang="bash"> | |||
pkg install py37-certbot py37-certbot-nginx | |||
certbot --nginx -d example.com -d www.example.com | |||
</syntaxhighlight> | |||
== MariaDB == | == MariaDB == | ||
< | <syntaxhighlight lang="bash"> | ||
pkg search -o mariadb | pkg search -o mariadb | ||
pkg install mariadb105-server mariadb105-client | pkg install mariadb105-server mariadb105-client | ||
| Linha 42: | Linha 53: | ||
sysrc mysql_args="--bind-address=127.0.0.1" | sysrc mysql_args="--bind-address=127.0.0.1" | ||
service mysql-server restart | service mysql-server restart | ||
</ | </syntaxhighlight> | ||
<syntaxhighlight lang="sql"> | |||
create database DATABASE_NAME; | |||
grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD'; | |||
flush privileges; | |||
</syntaxhighlight> | |||
== PHP-fpm == | == PHP-fpm == | ||
< | <syntaxhighlight lang="bash"> | ||
pkg install php74 php74-mysqli php74-mbstring php74-zlib php74-curl php74-gd php74-json | pkg install php74 php74-mysqli php74-mbstring php74-zlib php74-curl php74-gd php74-json php74-phar php74-filter php74-openssl php74-bcmath php74-ctype php74-fileinfo php74-pdo php74-pdo_mysql php74-tokenizer php74-xml php74-dom php74-xmlwriter | ||
cp /usr/local/etc/php.ini{-production,} | cp /usr/local/etc/php.ini{-production,} | ||
</ | sysrc php_fpm_enable=YES | ||
service php-fpm start | |||
</syntaxhighlight> | |||
* /usr/local/etc/php.ini | * /usr/local/etc/php.ini | ||
* /usr/local/etc/php-fpm.d/www.conf | * /usr/local/etc/php-fpm.d/www.conf | ||
== Redis == | |||
<syntaxhighlight lang="bash"> | |||
pkg install redis php74-pecl-redis | |||
sysrc redis_enable=YES | |||
service redis start | |||
</syntaxhighlight> | |||
* /usr/local/etc/redis.conf | |||
[[Category:*BSD]] | |||
Edição atual desde as 21h19min de 7 de março de 2026
Actualizar
Sistema
freebsd-update fetch
freebsd-update install
Ports
pkg update
pkg upgrade -y
Serviços
Nginx
Instalação
pkg install nginx
sysrc nginx_enable="yes"
service nginx start
Configuração
- /usr/local/etc/nginx/nginx.conf
user www;
worker_processes 4;
Certbot
pkg install py37-certbot py37-certbot-nginx
certbot --nginx -d example.com -d www.example.com
MariaDB
pkg search -o mariadb
pkg install mariadb105-server mariadb105-client
sysrc mysql_enable="yes"
service mysql-server start
/usr/local/bin/mysql_secure_installation
sysrc mysql_args="--bind-address=127.0.0.1"
service mysql-server restart
create database DATABASE_NAME;
grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';
flush privileges;
PHP-fpm
pkg install php74 php74-mysqli php74-mbstring php74-zlib php74-curl php74-gd php74-json php74-phar php74-filter php74-openssl php74-bcmath php74-ctype php74-fileinfo php74-pdo php74-pdo_mysql php74-tokenizer php74-xml php74-dom php74-xmlwriter
cp /usr/local/etc/php.ini{-production,}
sysrc php_fpm_enable=YES
service php-fpm start
- /usr/local/etc/php.ini
- /usr/local/etc/php-fpm.d/www.conf
Redis
pkg install redis php74-pecl-redis
sysrc redis_enable=YES
service redis start
- /usr/local/etc/redis.conf