技术平台-开发环境-服务暴露

abstiger小于 1 分钟

服务暴露

通过HTTPS对用户提供服务

域名证书

root用户执行:

apt install socat

curl https://get.acme.sh | sh
export DP_Id=******
export DP_Key=******

/root/.acme.sh/acme.sh --issue -d krproject.org -d "*.krproject.org" --dns dns_dp --renew-hook "sh /root/.acme.sh/renew-hook.sh" --server  letsencrypt
/root/.acme.sh/acme.sh --installcert -d krproject.org \
--cert-file /etc/ssl/krproject.org/krproject.org.cer \
--key-file /etc/ssl/krproject.org/krproject.org.key \
--fullchain-file /etc/ssl/krproject.org/fullchain.cer \
--reloadcmd "service apache2 force-reload"

apache2 安装与配置

参考文档:https://computingforgeeks.com/install-and-configure-ldap-account-manager-on-ubuntu/open in new window

安装步骤

sudo apt install apache2 

安装检查

systemctl status apache2

安装配置

a2enmod ssl headers rewrite proxy_http proxy_http2 proxy_wstunnel

防火墙允许https

ufw allow http
ufw allow https

php 的安装配置

因为几个管理端的应用都是基于php的,结合apache2,做如下安装:

sudo apt install php php-fpm php-cgi php-mbstring php-common php-pear php-ldap php-zip php-gmp php-gd 
sudo apt install libapache2-mod-php 
Loading...