情侣相册LikeGirl
情侣相册LikeGirl

目录
[[toc]]
[toc]
背景
如果有女朋友,那么可以为她搞一个这么精致的项目哦。
如果没,可以先准备下,有了后,可以快速上手。哈哈哈
介绍
- 项目源码:
https://gitee.com/kiCode111/like-girl-v5.2.0
本项目是一个纪录情侣间浪漫故事的的工具,可以纪录文章、上传旅游/生活相册、一起完成的情侣愿望清单、开放留言获取朋友祝福。
- 作者关于本项目的博客:
https://blog.kikiw.cn/index.php/archives/52/

like-girl项目有很多版本,作者为每个版本都单独建立了一个代码仓库,最新版本是v5.2.0。
版权
警告
次文档为自己实际部署like girl项目的操作文档,版权归[原作者](https://blog.kikiw.cn/)所有。涉及的源码请进原作者qq群自行获取。如部署过程里遇到任何问题,可在qq群里联系我帮助解决,感谢。
qq群:

仓库地址:https://gitee.com/kiCode111/like-girl-v5.2.0
开源版demo https://lovey.kikiw.cn/
开源版部署文档:Like Girl v5.2.0 情侣小站开源版文档 - Ki’sBlog
付费版demo https://loveli.kikiw.cn/
付费版 部署文档:
https://blog.kikiw.cn/index.php/archives/65/
微信文章地址: https://mp.weixin.qq.com/s/QscJFdoAKdgU4E-bESMVQw

前提

- 自己本次环境
1centos7.6 1810
2PHP 7.4.33
3mysql 5.7.44 MySQL Community Server (GPL)
4LikeGirl v5.2.0
特别注意:
自己本次是将like girl项目部署在家庭里的虚机,然后通过frp暴露出去的哦,具体细节见下文。
接下来,开始手把手带你部署次项目。
源码作者已提供,具体部署过程,此篇文档也非常详细,只要有手,按照文档一步步来,就肯定会成功的。(有任何问题,可随时联系我😜)
效果
自己部署完成后的效果:

作者demo:
开源版demo https://lovey.kikiw.cn/
付费版demo https://loveli.kikiw.cn/
1、部署php
1.部署php
1#安装依赖
2yum install epel-release -y
3yum install yum-utils -y
4
5#添加 Remi 仓库
6yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
7#启用 PHP 7.4 仓库
8yum-config-manager --enable remi-php74
9
10#安装 PHP 7.4 及常用扩展
11yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json php-opcache php-intl php-soap php-redis -y
12
13#检查 PHP 版本
14php -v
15
16
17#如果使用 Nginx,需要启动 PHP-FPM
18systemctl start php-fpm
19systemctl enable php-fpm
20systemctl status php-fpm
以上步骤就把php部署好了,顺便我们部署下nginx,然后把LikeGirl php项目传到服务器上,用以验证php是否正常:
2.部署nginx
(1)部署nginx
1tee /etc/yum.repos.d/nginx.repo <<EOF
2[nginx]
3name=nginx repo
4baseurl=https://nginx.org/packages/centos/\$releasever/\$basearch/
5gpgcheck=0
6enabled=1
7EOF
8
9yum install nginx -y
10
11
12systemctl start nginx
13systemctl enable nginx
14
15systemctl status nginx
(2)把LikeGirl php项目传到服务器上
1mkdir -p /var/www/html
2
3#然后把LikeGirl-v5.2.0-20250308.zip 传到这个/var/www/html 路径下,然后解压
4
5cd /var/www/html
6cp LikeGirl-v5.2.0-20250308.zip /root
7unzip LikeGirl-v5.2.0-20250308.zip
8cp "LikeGirl v5.2.0 AllData.sql" all.sql
9
10cd like-girl-v5.2.0-master
11mv * ../
12cd ../
13rm -rf like-girl-v5.2.0-master

(3)配置nginx文件:
1#vim /etc/nginx/conf.d/default.conf
2server {
3 listen 80;
4 server_name love.hg.cn;
5 root /var/www/html;
6 index index.php index.html;
7
8 location ~ \.php$ {
9 fastcgi_pass 127.0.0.1:9000;
10 fastcgi_index index.php;
11 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
12 include fastcgi_params;
13 }
14}
注意:
这里的love.hg.cn域名是自定义域名,需要在本地做好映射。
编辑自己winodws C:\Windows\System32\drivers\etc:
1192.168.1.10 love.hg.cn
2
3
4#备注
5192.168.1.10是你虚机ip,love.hg.cn域名为随便自定义的域名。

(4)测试php是否正常
浏览器访问:love.hg.cn
此时会出现一个like girl的php页面,知识提示需要配置数据库,这里继续配置下数据库。
2、部署mysql
1.mysql部署
1#添加 MySQL 5.7 Yum 仓库
2sudo rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
3
4#安装 MySQL 5.7
5sudo yum install mysql-community-server -y --nogpgcheck
6
7#启动 MySQL 并设置开机自启
8sudo systemctl start mysqld
9sudo systemctl enable mysqld
10
11#获取临时密码
12sudo grep 'temporary password' /var/log/mysqld.log
13
14#安全配置 MySQL
15sudo mysql_secure_installation
16#1. 输入临时密码。
17#2. 设置新密码(需符合复杂度要求,如 `MyNewPass@123`)。
18#3. 移除匿名用户、禁止远程 root 登录、删除测试数据库等。
自己具体过程如下:
1[root@localhost conf.d]#sudo grep 'temporary password' /var/log/mysqld.log
22025-06-08T00:42:17.640714Z 1 [Note] A temporary password is generated for root@localhost: 1;,L(nNjJ9&Z
3[root@localhost conf.d]#sudo mysql_secure_installation
4
5Securing the MySQL server deployment.
6
7Enter password for user root:
8
9The existing password for the user account root has expired. Please set a new password.
10
11New password:
12
13Re-enter new password:
14The 'validate_password' plugin is installed on the server.
15The subsequent steps will run with the existing configuration
16of the plugin.
17Using existing password for root.
18
19Estimated strength of the password: 100
20Change the password for root ? ((Press y|Y for Yes, any other key for No) : no
21
22 ... skipping.
23By default, a MySQL installation has an anonymous user,
24allowing anyone to log into MySQL without having to have
25a user account created for them. This is intended only for
26testing, and to make the installation go a bit smoother.
27You should remove them before moving into a production
28environment.
29
30Remove anonymous users? (Press y|Y for Yes, any other key for No) : yes
31Success.
32
33
34Normally, root should only be allowed to connect from
35'localhost'. This ensures that someone cannot guess at
36the root password from the network.
37
38Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no
39
40 ... skipping.
41By default, MySQL comes with a database named 'test' that
42anyone can access. This is also intended only for testing,
43and should be removed before moving into a production
44environment.
45
46
47Remove test database and access to it? (Press y|Y for Yes, any other key for No) : yes
48 - Dropping test database...
49Success.
50
51 - Removing privileges on test database...
52Success.
53
54Reloading the privilege tables will ensure that all changes
55made so far will take effect immediately.
56
57Reload privilege tables now? (Press y|Y for Yes, any other key for No) : yes
58Success.
59
60All done!
61[root@localhost conf.d]#
2.导入mysql数据
先来编辑下like girl项目的配置文件,再进行导入数据:
编辑下like girl项目的配置文件:
1#vim /var/www/html/admin/Config_DB.php
2<?php
3/*
4 * @Version:Like Girl 5.2.0
5 * @Author: Ki.
6 * @Date: 2024-11-08 10:00:00
7 * @LastEditTime: 2024-11-08
8 * @Description: 愿得一人心 白首不相离
9 * @Document:https://blog.kikiw.cn/index.php/archives/52/
10 * @Copyright (c) 2024 by Ki All Rights Reserved.
11 * @Warning:禁止以任何方式出售本项目 如有发现一切后果自行负责
12 * @Warning:禁止以任何方式出售本项目 如有发现一切后果自行负责
13 * @Warning:禁止以任何方式出售本项目 如有发现一切后果自行负责
14 * @Message:开发不易 版权信息请保留 (删除/更改版权的无耻之人请勿使用 查到一个挂一个)
15 * @Message:开发不易 版权信息请保留 (删除/更改版权的无耻之人请勿使用 查到一个挂一个)
16 * @Message:开发不易 版权信息请保留 (删除/更改版权的无耻之人请勿使用 查到一个挂一个)
17 */
18
19header("Content-Type:text/html; charset=utf8");
20
21//数据库地址
22$db_address = "localhost";
23
24//数据库用户名
25$db_username = "root";
26
27//数据库密码
28$db_password = "12345678";
29
30//数据库名称
31$db_name = "LikeGirlv520";
32
33//为了保障你的小站安全 请设置一个复杂且独特的安全码 修改敏感信息时需填写
34$Like_Code = "LovePHP";
35
36//版本号
37$version = 20241108;
将这2个地方修改为上面创建数据库时的信息:

导入数据:
1mysql -uroot -pAdmin@2024ghT
2
3#创建数据库
4create database LikeGirlv520;
5use LikeGirlv520;
6
7#导入数据
8source /var/www/html/all.sql
3.验证
访问首页 http://love.hg.cn/

访问管理端 http://love.hg.cn/admin/
默认账号密码:
admin/loveww

以上,就说明你的项目已经部署完成了。
以下frp配置,是因为我的like girl项目是部署在自己家里的虚机里,此时需要配置frp将这个项目给暴露出去的。如果你恰好也需要这种方式的话,请看下文;
如果以上部署你是在自己的云服务器上配置的话,那么以下步骤可忽略。
3、部署frp(扩展)
1.客户端frpc配置
1#vim frpc.ini
2[common]
3# server_addr为云服务器IP地址
4server_addr = 你自己云服务器IP地址
5# server_port为服务端监听端口,bind_port
6server_port = 7000
7# 服务端设置的token
8token = 666666
9
10[LikeGirl]
11type = tcp
12local_ip = 127.0.0.1
13local_port = 80
14remote_port = 8089
15
16
17
18##启动容器
19docker run --restart=always --network host -d -v /root/frpc.ini:/etc/frp/frpc.ini --name frpc registry.cn-shenzhen.aliyuncs.com/mogublog_business/frpc
2.服务端frps配置
1#vim frps.ini
2[common]
3# 监听端口
4bind_port = 7000
5# 面板端口
6dashboard_port = 7500
7# 登录面板账号设置
8dashboard_user = admin
9# 登录面板的密码
10dashboard_pwd = 123456
11
12# 身份验证
13token = 666666
14
15
16
17##启动容器
18docker run --restart=always --network host -d -v /root/frps.ini:/etc/frp/frps.ini --name frps registry.cn-shenzhen.aliyuncs.com/mogublog_business/frps
3.配置云服务器的nginx
这里的域名填写为 你自己的域名就好。
1[root@wiki ~]# vim /etc/nginx/conf.d/fxj.onedayxyy.cn.conf
2server {
3 listen 80;
4 server_name fxj.onedayxyy.cn;
5 return 301 https://$host$request_uri;
6}
7
8server {
9 listen 443 ssl;
10 server_name fxj.onedayxyy.cn;
11
12 # PHP 项目配置(需根据实际路径调整)
13 root /var/www/html; # 替换为你的 PHP 项目路径
14 index index.php index.html;
15
16 location / {
17 try_files $uri $uri/ /index.php?$query_string;
18 }
19
20 location ~ \.php$ {
21 # 代理到 FRP 暴露的端口(本地回环地址)
22 proxy_pass http://127.0.0.1:8089;
23 proxy_set_header Host $host;
24 proxy_set_header X-Real-IP $remote_addr;
25 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26 proxy_set_header X-Forwarded-Proto $scheme;
27
28 # 如果 PHP 由本地 FastCGI 处理,取消注释以下配置
29 # fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
30 # fastcgi_index index.php;
31 # include fastcgi_params;
32 }
33
34 ssl_certificate /etc/letsencrypt/live/onedayxyy.cn/fullchain.pem;
35 ssl_certificate_key /etc/letsencrypt/live/onedayxyy.cn/privkey.pem;
36
37 ssl_session_timeout 5m;
38 ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
39 ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
40 ssl_prefer_server_ciphers on;
41 add_header Strict-Transport-Security "max-age=31536000";
42
43 access_log /var/log/nginx/umami.onedayxyy.cn.https.log;
44}
45[root@wiki ~]#
扩展:当在云服务器上直接部署时,其nginx配置文件如下(配置了https)
1server {
2 listen 80;
3 server_name fxj.onedayxyy.cn;
4 return 301 https://$host$request_uri;
5}
6
7server {
8 listen 443 ssl;
9 server_name fxj.onedayxyy.cn;
10
11 # PHP 项目配置(需根据实际路径调整)
12 root /var/www/html; # 替换为你的 PHP 项目路径
13 index index.php index.html;
14
15 location ~ \.php$ {
16 fastcgi_pass 127.0.0.1:9000;
17 fastcgi_index index.php;
18 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
19 include fastcgi_params;
20 }
21
22 ssl_certificate /etc/letsencrypt/live/onedayxyy.cn/fullchain.pem;
23 ssl_certificate_key /etc/letsencrypt/live/onedayxyy.cn/privkey.pem;
24
25 ssl_session_timeout 5m;
26 ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
27 ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
28 ssl_prefer_server_ciphers on;
29 add_header Strict-Transport-Security "max-age=31536000";
30
31 access_log /var/log/nginx/umami.onedayxyy.cn.https.log;
32}
4.验证
访问首页:

访问后端:
https://fxj.onedayxyy.cn/admin/

总结
这个项目整体还是很有意思的,很清新,体验下来也丝滑。可以日常记录一些有意义的生活瞬间,无聊是情侣或者婚后的日子。
次项目为开源版本,作者已不再维护,手头充足的情况,可考虑入手作者的付费项目。
like girl Pro付费版项目
如实在需要进行记录使用 可以考虑入手付费版(Pro)也当是支持作者的一份小项目 感谢
- 演示地址:LGNewUi (Demo)
- 项目文档地址:查看Pro版本文档介绍
关于我
我的博客主旨:
- 排版美观,语言精炼;
- 文档即手册,步骤明细,拒绝埋坑,提供源码;
- 本人实战文档都是亲测成功的,各位小伙伴在实际操作过程中如有什么疑问,可随时联系本人帮您解决问题,让我们一起进步!
🍀 个人网站

🍀 微信二维码
x2675263825 (舍得), qq:2675263825。

🍀 微信公众号
《云原生架构师实战》

🍀 csdn
https://blog.csdn.net/weixin_39246554?spm=1010.2135.3001.5421

🍀 知乎
https://www.zhihu.com/people/foryouone

最后
如果你还有疑惑,可以去我的网站查看更多内容或者联系我帮忙查看。
如果你有更好的方式,评论区留言告诉我。谢谢!
好了,本次就到这里了,感谢大家阅读,最后祝大家生活快乐,每天都过的有意义哦,我们下期见!


