问题(1). fatal error: libmemcached/memcached.h: No such file or directory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE_ZLIB -I/usr/include/python3.10 -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-3.10/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
In file included from src/_pylibmcmodule.c:34:
src/_pylibmcmodule.h:42:10: fatal error: libmemcached/memcached.h: No such file or directory
42 |
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command'/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1[end of output] note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pylibmc
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
问题(2). fatal error: ffi.h: No such file or directory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.10 -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.10/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
15 |
| ^~~~~~~
compilation terminated.
error: command'/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1[end of output] note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> cffi
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
c/_cffi_backend.c:407:23: error: lvalue required as left operand of assignment
407 | Py_REFCNT(ct)= 43;
| ^
c/_cffi_backend.c:410:23: error: lvalue required as left operand of assignment
410 | Py_REFCNT(ct)= 0;
| ^
c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
c/_cffi_backend.c:6185:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]6185 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:130,
from c/_cffi_backend.c:2:
/usr/include/python3.10/ceval.h:122:37: note: declared here
122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:6245:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]6245 | if(ffi_prep_closure(closure, &cif_descr->cif,
| ^~
In file included from c/_cffi_backend.c:15:
/usr/include/x86_64-linux-gnu/ffi.h:347:1: note: declared here
347 | ffi_prep_closure (ffi_closure*,
| ^~~~~~~~~~~~~~~~
error: command'/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1[end of output]
seafile:seafile-server-latest$ ./seahub.sh start
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...
Error:Seahub failed to start.
Please try to run "./seahub.sh start" again
使用 ./seahub.sh start-fastcgi 可以看到更细节的错误原因。
1
2
3
4
5
6
7
8
9
10
11
seafile:seafile-server-latest$ ./seahub.sh start-fastcgi
LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 ...
Traceback (most recent call last):
----------------------------snip--------------------------------
----------------------------snip--------------------------------
File "/usr/local/seafile-pro-server/seafile-pro-server-9.0.5/seahub/thirdpart/cffi/api.py", line 54, in __init__
raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r. The two versions should be equal; check your installation." % (Exception: Version mismatch: this is the 'cffi' package version 1.14.0, located in '/usr/local/seafile-pro-server/seafile-pro-server-9.0.5/seahub/thirdpart/cffi/api.py'. When we import the top-level '_cffi_backend' extension module, we get version 1.15.0, located in '/usr/local/lib/python3.10/dist-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so'. The two versions should be equal; check your installation.
Error:Seahub failed to start.
---------------------------snip----------------------------------
---------------------------snip----------------------------------
c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
c/_cffi_backend.c:407:23: error: lvalue required as left operand of assignment
407 | Py_REFCNT(ct)= 43;
| ^
c/_cffi_backend.c:410:23: error: lvalue required as left operand of assignment
410 | Py_REFCNT(ct)= 0;
| ^
c/_cffi_backend.c: In function ‘prepare_callback_info_tuple’:
c/_cffi_backend.c:6185:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]6185 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:130,
from c/_cffi_backend.c:2:
/usr/include/python3.10/ceval.h:122:37: note: declared here
122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
c/_cffi_backend.c: In function ‘b_callback’:
c/_cffi_backend.c:6245:5: warning: ‘ffi_prep_closure’ is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations]6245 | if(ffi_prep_closure(closure, &cif_descr->cif,
| ^~
In file included from c/_cffi_backend.c:15:
/usr/include/x86_64-linux-gnu/ffi.h:347:1: note: declared here
347 | ffi_prep_closure (ffi_closure*,
| ^~~~~~~~~~~~~~~~
error: command'/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
c/_cffi_backend.c: In function ‘ctypedescr_dealloc’:
c/_cffi_backend.c:407:23: error: lvalue required as left operand of assignment
407 | Py_REFCNT(ct)= 43;
| ^
c/_cffi_backend.c:410:23: error: lvalue required as left operand of assignment
410 | Py_REFCNT(ct)= 0;
|
imaginemiracle:~$ sudo systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2022-06-20 05:54:15 UTC; 15min ago
Main PID: 29399(mysqld) Status: "Server is operational" Tasks: 39(limit: 19069) Memory: 361.5M
CPU: 2.610s
CGroup: /system.slice/mysql.service
└─29399 /usr/sbin/mysqld
Jun 20 05:54:14 imaginemiracle-linux systemd[1]: Starting MySQL Community Server...
Jun 20 05:54:15 imaginemiracle-linux systemd[1]: Started MySQL Community Server.
3.2.3. 配置 MySQL
使用 mysql_secure_installation 对 MySQL 初始化。 使用该命令,会对你提出几个问题让你回答:
她问你
你就说
是否安装密码校验插件 VALIDATE PASSWORD COMPONENT
no
请为 root 管理员账户设置数据库密码
我是强壮的密码(这里需要自己设置哦!)
删除匿名账户吗
yes
是否禁止root管理员从远程登录
no
是否删除test数据库并取消对它的访问权限
yes
是否刷新授权表,让初始化的设定立即生效
yes
执行 MySQL 配置脚本
1
imaginemiracle:~$ sudo mysql_secure_installation
第一个提示将询问你是否要设置验证密码插件,该插件可用于在认为新用户有效之前测试新 MySQL 用户的密码强度。
如果你选择设置验证密码插件,则创建的任何使用密码进行身份验证的 MySQL 用户都需要具有满足选择的策略的密码,所以选择 No ,便可以使用简单的密码。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: Y
There are three levels of password validation policy:
LOW Length >=8MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0= LOW, 1= MEDIUM and 2= STRONG:
2
无论是否选择设置验证密码插件,下一个提示都是为 MySQL root 用户设置密码。输入并确认你设置的密码:
1
2
3
4
5
Please set the password for root here.
New password:
Re-enter new password:
如果第一个问题选择使用了验证密码插件,则将收到有关新密码强度的反馈。然后脚本将询问你是要继续使用刚刚输入的密码还是要输入新密码。若对刚刚输入的密码强度感到满意,则输入 Y 以继续执行脚本:
1
2
Estimated strength of the password: 100Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
后续将会继续询问,是否需要删除匿名用户、禁用 root 用户远程登录和 是否删除 test 数据库,是否确认现在重新加载权限表?,分别回答 Y、N、Y、Y 便可。
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : yes
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no
... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : yes
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : yes
Success.
All done!
3.2.4. 修改 MySQL root 用户为 mysql_native_password 验证方式
以 root 用户登录 MySQL
1
imaginemiracle:~$ sudo mysql -u root -p
使用 ALTER USER 语句修改用户信息。
1
2
3
4
5
6
7
8
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'imaginemiracle';
Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)mysql> exitBye
3.2.5. 可能发生的意外(Error: SET PASSWORD has no significance for user ‘root’@‘localhost’)
有的小伙伴可能在第一次使用登录时,看到下面提示了 Enter password,并没有使用回车跳过输入,而是习惯性的输入了本机 root 用户的密码。
1
2
imaginemiracle:~$ sudo mysql -u root -p
Enter password:
… Failed! Error: SET PASSWORD has no significance for user ‘root’@‘localhost’ as the
authentication method used doesn’t store authentication data in the MySQL server.
Please consider using ALTER USER instead if you want to change authentication parameters.
seafile:seafile-pro-server-9.0.5$ ./setup-seafile-mysql.sh
Checking python on this machine ...
Checking for java ...
Java is not found. install it first.
On Debian/Ubuntu: apt-get install default-jre
On CentOS/RHEL: yum install jre
Error occured during setup.
Please fix possible problems and run the script again.
该文件夹 seafile-server-latest 是指向当前 Seafile Server 文件夹的符号链接。当您稍后升级到新版本时,升级脚本会更新此链接以指向最新的 Seafile Server 文件夹。
以 root 用户登录数据库。
1
imaginemiracle:~$ sudo mysql -u root -p
创建 mtsqlseafile 用户,imaginemiracle 则为 seafile 用户登录 mysql 的密码。
1
mysql> create user 'seafile'@'localhost' identified by 'imaginemiracle';
将用户 seafile 的身份验证插件更改为 mysql_native_password:
1
mysql> ALTER USER 'seafile'@'localhost' identified with mysql_native_password by 'imaginemiracle';
手动创建数据库 ccnet、seafile、seahub(已使用脚本成功创建数据库的读者无需执行)
1
2
3
4
5
mysql> create database `ccnet_db` character set='utf8';
mysql> create database `seafile_db` character set='utf8';
mysql> create database `seahub_db` character set='utf8';
赋予 seafile 用户这三个数据库的访问权限。(已使用脚本成功创建数据库的读者无需执行)
1
2
3
4
5
mysql> GRANT ALL PRIVILEGES ON `ccnet_db`.* to `seafile`@localhost;
mysql> GRANT ALL PRIVILEGES ON `seafile_db`.* to `seafile`@localhost;
mysql> GRANT ALL PRIVILEGES ON `seahub_db`.* to `seafile`@localhost;
刷新权限表。
1
mysql> FLUSH PRIVILEGES;
退出 mysql
1
mysql> exit
由安装脚本创建的 Seafile 配置文件是为在反向代理后面运行的 Seafile 准备的。
要访问 Seafile 的 Web 界面并在没有反向代理的情况下创建工作共享链接,需要修改以下两个配置文件 /usr/local/seafile-pro-server/conf:
seafile:seafile-server-latest$ ./seafile.sh start
** Message: 06:43:27.575: seafile-controller.c(1023): loading seafdav config from /usr/local/seafile-pro-server/conf/seafdav.conf
2022-06-21 06:43:27 ../common/seaf-utils.c(409): Use database Mysql
2022-06-21 06:43:27 http-server.c(236): fileserver: worker_threads=102022-06-21 06:43:27 http-server.c(249): fileserver: backlog=322022-06-21 06:43:27 http-server.c(264): fileserver: fixed_block_size=83886082022-06-21 06:43:27 http-server.c(279): fileserver: web_token_expire_time=36002022-06-21 06:43:27 http-server.c(294): fileserver: max_indexing_threads=12022-06-21 06:43:27 http-server.c(309): fileserver: max_index_processing_threads=32022-06-21 06:43:27 http-server.c(331): fileserver: cluster_shared_temp_file_mode=6002022-06-21 06:43:27 http-server.c(409): fileserver: enable_async_indexing=02022-06-21 06:43:27 http-server.c(421): fileserver: async_indexing_threshold=7002022-06-21 06:43:27 http-server.c(433): fileserver: fs_id_list_request_timeout=3002022-06-21 06:43:27 http-server.c(446): fileserver: max_sync_file_count=1000002022-06-21 06:43:27 http-server.c(461): fileserver: put_head_commit_request_timeout=102022-06-21 06:43:27 ../common/license.c(709): License file /usr/local/seafile-pro-server/seafile-license.txt does not exist, allow at most 3 trial users
License file /usr/local/seafile-pro-server/seafile-license.txt does not exist, allow at most 3 trial users
2022-06-21 06:43:27 ../common/seaf-db.c(739): Failed to connect to MySQL: Plugin caching_sha2_password could not be loaded: /usr/lib/mariadb/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
2022-06-21 06:43:27 ../common/user-mgr.c(97): Failed to get user number from DB.
2022-06-21 06:43:27 seafile-session.c(422): Failed to init user manager.
failed to run "seaf-server -t"[65280]
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database change
mysql> GRANT ALL PRIVILEGES ON `ccnet_db`.* to `seafile`@'%';
Query OK, 0 rows affected (0.00 sec)mysql> GRANT ALL PRIVILEGES ON `seafile_db`.* to `seafile`@'%';
Query OK, 0 rows affected (0.00 sec)mysql> GRANT ALL PRIVILEGES ON `seahub_db`.* to `seafile`@'%';
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
imaginemiracle:~$ sudo snap install core; sudo snap refresh core
snap "core" is already installed, see 'snap help refresh'snap "core" has no updates available
可能出现的问题(忧心关键点): 当执行更新命令时,也有可能是得到如下错误输出。
1
2
3
imaginemiracle:~$ sudo snap install core; sudo snap refresh core
error: cannot communicate with server: Post http://localhost/v2/snaps/core: dial unix /run/snapd.socket: connect: no such file or directory
error: cannot communicate with server: Post http://localhost/v2/snaps/core: dial unix /run/snapd.socket: connect: no such file or directory