@@ -145,6 +145,268 @@ $ldap_filter = "(&(objectClass=*)($ldap_login_attribute={login}))";
145145
146146### 标准安装
147147
148+ [ 官方安装文档] ( https://self-service-password.readthedocs.io/en/latest/installation.html )
149+
150+
151+
152+ #### 安装php
153+
154+ ##### 安装 [ remi] ( https://blog.remirepo.net/pages/Config-en ) 源
155+
156+ ``` shell
157+ yum -y install epel-release && \
158+ yum -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
159+ ```
160+
161+
162+
163+ ##### 安装php7.4
164+
165+ :::tip 说明
166+
167+ self-service-password依赖的php>=7.4
168+
169+ :::
170+
171+ ``` sh
172+ export PHP_VERSION=php74
173+ yum -y install \
174+ ${PHP_VERSION} -php-fpm \
175+ ${PHP_VERSION} -php-cli \
176+ ${PHP_VERSION} -php-bcmath \
177+ ${PHP_VERSION} -php-gd \
178+ ${PHP_VERSION} -php-json \
179+ ${PHP_VERSION} -php-mbstring \
180+ ${PHP_VERSION} -php-mcrypt \
181+ ${PHP_VERSION} -php-mysqlnd \
182+ ${PHP_VERSION} -php-opcache \
183+ ${PHP_VERSION} -php-pdo \
184+ ${PHP_VERSION} -php-pecl-crypto \
185+ ${PHP_VERSION} -php-pecl-mcrypt \
186+ ${PHP_VERSION} -php-pecl-geoip \
187+ ${PHP_VERSION} -php-recode \
188+ ${PHP_VERSION} -php-snmp \
189+ ${PHP_VERSION} -php-soap \
190+ ${PHP_VERSION} -php-xml \
191+ ${PHP_VERSION} -php-ldap \
192+ ${PHP_VERSION} -php-common
193+ ```
194+
195+
196+
197+ ##### 安装位置
198+
199+ | 类型 | 路径 | 说明 |
200+ | ------------------ | ----------------------------------------------- | ------------------------------------------------------------ |
201+ | 安装目录 | ` /etc/opt/remi/php74 ` | PHP 安装目录 |
202+ | PHP 主程序 | ` /opt/remi/php74/root/usr/bin/php ` | 执行 PHP 程序用 |
203+ | 主配置文件 | ` /etc/opt/remi/php74/php.ini ` | 主配置文件 |
204+ | 池(Pool)配置文件 | ` /etc/opt/remi/php74/php-fpm.d/www.conf ` | 用于配置 php-fpm 接收请求的方式、进程管理、运行用户、监听端口/套接字等参数 |
205+ | socket文件 | ` /var/opt/remi/php74/run/php-fpm/www.sock ` | PHP-FPM socket文件 |
206+ | php-fpm 配置 | ` /etc/opt/remi/php74/php-fpm.conf ` | PHP-FPM 配置文件 |
207+ | 扩展模块 | ` /opt/remi/php74/root/usr/lib64/php/modules ` | 所有模块 ` .so ` 文件目录 |
208+ | systemd 启动 | ` /usr/lib/systemd/system/php74-php-fpm.service ` | 使用 ` systemctl ` 管理 FPM 服务 |
209+
210+
211+
212+ ##### 启动php74
213+
214+ ``` shell
215+ systemctl enable php74-php-fpm && systemctl start php74-php-fpm
216+ ```
217+
218+
219+
220+ ##### 修改目录权限
221+
222+ ``` shell
223+ chown -R www.www /var/opt/remi/php74
224+ chown -R www.www /etc/opt/remi/php74
225+ ```
226+
227+
228+
229+ ##### 修改php-fpm运行用户
230+
231+ 修改 ` /etc/opt/remi/php74/php-fpm.d/www.conf ` 中的以下几项,默认是 ` apache ` 用户
232+
233+ ``` shell
234+ user = www
235+ group = www
236+ listen.acl_users = www
237+ ```
238+
239+
240+
241+ ##### 修改 ` /var/cache/self-service-password ` 目录权限
242+
243+ :::caution 注意
244+
245+ 必须将 ` /var/cache/self-service-password ` 目录以及目录下所有文件的权限修改为 php-fpm 的运行用户,否则访问会报错500
246+
247+ :::
248+
249+ ``` shell
250+ chown -R www.www /var/cache/self-service-password
251+ ```
252+
253+
254+
255+ ##### 重启php-fpm
256+
257+ ``` shell
258+ systemctl restart php74-php-fpm
259+ ```
260+
261+
262+
263+ #### 添加yum源
264+
265+ ``` shell
266+ cat > /etc/yum.repos.d/ltb-project.repo << 'EOF '
267+ [ltb-project-noarch]
268+ name=LTB project packages (noarch)
269+ baseurl=https://ltb-project.org/rpm/$releasever/noarch
270+ enabled=1
271+ gpgcheck=1
272+ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project
273+ EOF
274+ ```
275+
276+
277+
278+ #### 导入存储库密钥
279+
280+ import Tabs from '@theme/Tabs ';
281+ import TabItem from '@theme/TabItem ';
282+
283+ <Tabs >
284+ <TabItem value =" el7/el8 " label =" el7/el8 " default >
285+
286+ ``` shell
287+ rpm --import https://ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project
288+ ```
289+
290+ </TabItem >
291+ <TabItem value =" el9 " label =" el9 " >
292+
293+ ``` shell
294+ rpm --import https://ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-PROJECT-SECURITY
295+ ```
296+
297+ </TabItem >
298+ </Tabs >
299+
300+
301+
302+ #### yum安装
303+
304+ ``` shell
305+ yum -y install self-service-password
306+ ```
307+
308+
309+
310+ ##### 查看安装位置
311+
312+ ``` shell
313+ rpm -ql self-service-password
314+ ```
315+
316+
317+
318+ | 文件类型 | 路径示例 |
319+ | ----------- | ---------------------------------------------- |
320+ | 源码目录 | ` /usr/share/self-service-password/ ` |
321+ | 配置文件 | ` /etc/self-service-password/config.inc.php ` |
322+ | Apache 配置 | ` /etc/httpd/conf.d/self-service-password.conf ` |
323+
324+
325+
326+ #### 配置nginx
327+
328+ [ webserver配置官方文档] ( https://self-service-password.readthedocs.io/en/latest/config_webserver.html )
329+
330+
331+
332+ :::tip 说明
333+
334+ 这里依据官方的文件进行了一下修改
335+
336+ 如果想要在 ` access_log ` 后添加 ` main ` 字段,则需要取消 ` nginx.conf ` 中 ` http ` 块下的 ` log_format main ` 的注释
337+
338+ :::
339+
340+ ``` nginx
341+ server {
342+ listen 80;
343+
344+ root /usr/share/self-service-password/htdocs;
345+ index index.php index.html index.htm;
346+
347+ # Make site accessible from http://localhost/
348+ server_name ssp.ops.com;
349+
350+ # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
351+ sendfile off;
352+
353+ gzip on;
354+ gzip_comp_level 6;
355+ gzip_min_length 1000;
356+ gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
357+ gzip_vary on;
358+ gzip_proxied any;
359+ gzip_disable "MSIE [1-6]\.(?!.*SV1)";
360+
361+ # Add stdout logging
362+
363+ error_log /var/log/nginx/ssp.ops.com_error.log warn;
364+ access_log /var/log/nginx/ssp.ops.com_access.log main;
365+
366+
367+ # pass the PHP scripts to FastCGI server listening on socket
368+ #
369+ location ~ \.php {
370+ fastcgi_pass unix:/var/opt/remi/php74/run/php-fpm/www.sock;
371+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
372+ fastcgi_param PATH_INFO $fastcgi_path_info;
373+ fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
374+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
375+ fastcgi_index index.php;
376+ try_files $fastcgi_script_name =404;
377+ fastcgi_read_timeout 600;
378+ include fastcgi_params;
379+ }
380+
381+ error_page 404 /404.html;
382+ location = /404.html {
383+ root /usr/share/nginx/html;
384+ internal;
385+ }
386+
387+ # deny access to . files, for security
388+ #
389+ location ~ /\. {
390+ log_not_found off;
391+ deny all;
392+ }
393+
394+ location ~ /scripts {
395+ log_not_found off;
396+ deny all;
397+ }
398+
399+ }
400+ ```
401+
402+
403+
404+ #### 访问
405+
406+ ![ iShot_2025-06-20_17.10.43] ( https://raw.githubusercontent.com/pptfz/picgo-images/master/img/iShot_2025-06-20_17.10.43.png )
407+
408+
409+
148410
149411
150412### dokcer安装
@@ -181,7 +443,7 @@ docker run -d \
181443 --name self-service-password \
182444 -p 8000:80 \
183445 -v /data/docker-volume/ssp/config.inc.local.php:/var/www/conf/config.inc.local.php \
184- docker.io/ ltbproject/self-service-password:1.7.3
446+ ltbproject/self-service-password:1.7.3
185447```
186448
187449
@@ -316,7 +578,11 @@ $show_extended_error = true;
316578
317579## 配置邮件重置密码
318580
319- ** <span style={{color: 'red'}}>⚠️在self service password中使用邮箱重置密码功能的前提是邮箱必须是ldap中用户绑定的邮箱</span >**
581+ :::caution 注意
582+
583+ 在self service password中使用邮箱重置密码功能的前提是邮箱必须是ldap中用户绑定的邮箱
584+
585+ :::
320586
321587修改配置文件 ` config.inc.local.php `
322588
0 commit comments