安装 LiteSpeed 后,试验时的第一个任务通常是设置虚拟主机。
当我们在各种设置下查看仪表板时,我们会遇到一些变量。其中之一是 $VH_ROOT。
如何发现 $VH_ROOT 的值?
另外,更具体地说,可以从终端发现 $VH_ROOT 的值吗?如果是这样,怎么做?
安装 LiteSpeed 后,试验时的第一个任务通常是设置虚拟主机。
当我们在各种设置下查看仪表板时,我们会遇到一些变量。其中之一是 $VH_ROOT。
如何发现 $VH_ROOT 的值?
另外,更具体地说,可以从终端发现 $VH_ROOT 的值吗?如果是这样,怎么做?
我有一个在 Amazon Lightsail 上运行的 Ubuntu 20.04 LTS 实例,但我无法安装lsphp74-imagick。
$ sudo apt install lsphp74-imagick
回复:
The following packages have unmet dependencies:
lsphp74-imagick :
Depends: libmagickcore-6.q16-3 (>= 8:6.9.6.8) but it is not installable
Depends: libmagickwand-6.q16-3 (>= 8:6.9.6.8) but it is not installable
Recommends: ttf-dejavu-core but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
对于 libmagickcore,我得到以下信息:
$ sudo apt install libmagickcore-6.q16-3
..
E: Package 'libmagickcore-6.q16-3' has no installation candidate
不知道从这里去哪里。有人遇到过这个吗?
任何帮助表示赞赏。
我不小心在根目录中使用了这个命令,现在 ipa.ddr.ess:7080 不会让我进去;它说“无效的凭据”。我使用的命令是
chown -R www-data:www-data /.
然后我意识到这是一个错误然后将大多数目录更改为 root:root 使用
chown -R root:root /to-some-directories manually one by one
the directories in root
drwxr-xr-x 19 root root 4096 May 23 09:32 ./
drwxr-xr-x 19 root root 4096 May 23 09:32 ../
lrwxrwxrwx 1 root root 7 May 15 2020 bin -> usr/bin/
drwxr-xr-x 4 root root 4096 May 22 15:17 boot/
-rwxr-xr-x 1 root root 79639 Oct 1 2020 certbot-auto*
-rw------- 1 root root 1028653056 Jun 24 2020 cyberpanel.swap
drwxr-xr-x 16 root root 3780 Jun 15 14:04 dev/
drwxr-xr-x 117 root root 12288 Jun 15 14:38 etc/
drwxr-xr-x 8 root root 4096 Jun 4 17:00 home/
lrwxrwxrwx 1 root root 7 May 15 2020 lib -> usr/lib/
lrwxrwxrwx 1 root root 9 May 15 2020 lib32 -> usr/lib32/
lrwxrwxrwx 1 root root 9 May 15 2020 lib64 -> usr/lib64/
lrwxrwxrwx 1 root root 10 May 15 2020 libx32 -> usr/libx32/
drwx------ 2 root root 16384 May 15 2020 lost+found/
drwxr-xr-x 2 root root 4096 May 15 2020 media/
drwxr-xr-x 5 root root 4096 Jul 24 2020 mnt/
drwxr-xr-x 4 root root 4096 Jun 29 2020 opt/
dr-xr-xr-x 144 root root 0 Jun 9 04:50 proc/
drwx------ 11 root root 4096 Jun 23 10:00 root/
drwxr-xr-x 32 root root 1000 Jun 23 09:55 run/
lrwxrwxrwx 1 root root 8 May 15 2020 sbin -> usr/sbin/
drwxr-xr-x 7 root root 4096 Jun 17 07:19 snap/
drwxr-xr-x 3 root root 4096 Feb 4 09:40 srv/
dr-xr-xr-x 13 root root 0 Jun 9 04:50 sys/
drwxrwxrwt 23 root root 4481024 Jun 23 10:05 tmp/
drwxr-xr-x 15 root root 4096 May 22 15:16 usr/
drwxr-xr-x 13 root root 4096 May 15 2020 var/
-rw-r--r-- 1 root root 384 Jun 9 04:49 webadmin.csr
然后将 /home/example.com/public_html 更改为 www-data:www-data openlitespeed:7080 不让我使用正确的凭据
我设置了两个相同的 VPS(数据库和主机控制面板)。
VPS公司1:总部设在加利福尼亚| 1 GB | 2 核英特尔(R) 至强(R) | 2GB 内存 | 使用 Cloudflare
VPS公司2:总部设在加利福尼亚| 1 GB | 3 核英特尔(R) 至强(R) | 3GB 内存 | 使用 Cloudflare
图为不同的TTFB
请问影响ttfb的其他因素是什么?为了减少响应时间!!
阅读 LiteSpeed 网络服务器文档时,我的印象是,LiteSpeed 使用的虚拟主机配置语法与 Apache 配置的语法相同,因此迁移很容易。
但是,在安装 OpenLiteSpeed 并通过 OpenListeSpeed webUI 创建虚拟主机后,我在服务器上创建了以下虚拟主机配置文件:
docRoot $VH_ROOT
adminEmails [email protected]
cgroups 0
errorlog /www/logs/example.log {
useServer 0
logLevel WARN
}
index {
useServer 1
}
它看起来不像我现有的 Apache vhost 语法。我弄错了吗?
我可以在没有 webUI 的情况下对其进行编辑吗?如何向其中添加一些 Apache 指令?假设我想将此 Apache 指令添加到我的 LiteSpeed 虚拟主机中,例如:
<Directory "/www/protected">
AllowOverride All
Require valid-user
AuthType Basic
AuthName "Protected"
AuthBasicProvider file
AuthUserFile /www/htpasswd
</Directory>
我刚刚在运行 Debian 10 的专用服务器上安装了 OpenLiteSpeed 1.6.17,目标是将来替换我的 Apache 2.4.38。
我可以访问 OpenLiteSpeed WebUI,暂时没有更改默认的 HTTP 侦听端口 8088,因为我正在等待一切顺利运行,然后再切换到 80 并删除 Apache。我开始使用 OpenLiteSpeed webUI 创建一个虚拟主机,其中包含以下内容:
Virtual Host Name: www.example.com
Virtual Host Root: /home/www/production/example.com
Config file: $SERVER_ROOT/conf/vhosts/example.com/vhconf.conf
Document Root: $VH_ROOT
Use Server Index Files: Yes
但是,当我尝试访问时http://www.example.com:8088
,我得到一个 404,显然是由 LiteSpeed 提供的。
我忘记了什么?
更多信息:
/usr/local/lsws/conf/vhosts/example.com/vhost.conf
/home/www/production/example.com/index.html
)。www-data
但我确保 LiteSpeed 用户lsadmn
属于www-data
Linux 组。我只是想在我的 Amazon Linux 2 实例上安装 OLS,但我在开始和所有最后步骤都收到了错误。以下是关于:
当我添加指南存储库推荐时,我收到错误:
failure: repodata/repomd.xml from litespeed: [Errno 256] No more mirrors to try.
http://rpms.litespeedtech.com/centos/8/x86_64/repodata/x86_64/repodata/repomd.xml:[Errno 14] HTTP 错误 404 - 未找到
要修复它,我只需在链接http://rpms.litespeedtech.com/centos/$releasever/$basearch/处将 $releaseserver 替换为 8(我可以在http://rpms.litespeedtech.com/centos/看到) 并且......它有效!但在那之后,当我尝试安装时,我收到这些依赖错误:
Loaded plugins: langpacks, priorities, update-motd
191 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package lsphp73.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: lsphp73-common(x86-64) = 7.3.18-1.el8 for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libssl.so.1.1(OPENSSL_1_1_0)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libssl.so.1.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libcrypto.so.1.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libargon2.so.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
---> Package openlitespeed.x86_64 0:1.6.14-1.el8 will be installed
--> Processing Dependency: lsphp73-xml for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-process for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-pdo for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-opcache for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-mysqlnd for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-mcrypt for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-mbstring for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-imap for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: lsphp73-gd for package: openlitespeed-1.6.14-1.el8.x86_64
--> Processing Dependency: libnsl for package: openlitespeed-1.6.14-1.el8.x86_64
--> Running transaction check
---> Package lsphp73.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libargon2.so.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
---> Package lsphp73-common.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-common-7.3.18-1.el8.x86_64
---> Package lsphp73-gd.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libpng16.so.16(PNG16_0)(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libpng16.so.16()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
---> Package lsphp73-imap.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc-client.so.2007()(64bit) for package: lsphp73-imap-7.3.18-1.el8.x86_64
---> Package lsphp73-mbstring.x86_64 0:7.3.18-1.el8 will be installed
---> Package lsphp73-mysqlnd.x86_64 0:7.3.18-1.el8 will be installed
---> Package lsphp73-opcache.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-opcache-7.3.18-1.el8.x86_64
---> Package lsphp73-pdo.x86_64 0:7.3.18-1.el8 will be installed
---> Package lsphp73-pecl-mcrypt.x86_64 0:1.0.3-1.el8.7.3 will be installed
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: lsphp73-pecl-mcrypt-1.0.3-1.el8.7.3.x86_64
---> Package lsphp73-process.x86_64 0:7.3.18-1.el8 will be installed
---> Package lsphp73-xml.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: lsphp73-xml-7.3.18-1.el8.x86_64
---> Package openlitespeed.x86_64 0:1.6.14-1.el8 will be installed
--> Processing Dependency: libnsl for package: openlitespeed-1.6.14-1.el8.x86_64
---> Package openssl11-libs.x86_64 1:1.1.1c-3.amzn2.0.1 will be installed
--> Running transaction check
---> Package libX11.x86_64 0:1.6.7-2.amzn2 will be installed
--> Processing Dependency: libX11-common >= 1.6.7-2.amzn2 for package: libX11-1.6.7-2.amzn2.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.7-2.amzn2.x86_64
---> Package libXpm.x86_64 0:3.5.12-1.amzn2.0.2 will be installed
---> Package libc-client.x86_64 0:2007f-16.el7 will be installed
---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed
---> Package libxslt.x86_64 0:1.1.28-5.amzn2.0.2 will be installed
---> Package lsphp73.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libargon2.so.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
---> Package lsphp73-common.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-common-7.3.18-1.el8.x86_64
---> Package lsphp73-gd.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libpng16.so.16(PNG16_0)(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libpng16.so.16()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
---> Package lsphp73-opcache.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-opcache-7.3.18-1.el8.x86_64
---> Package openlitespeed.x86_64 0:1.6.14-1.el8 will be installed
--> Processing Dependency: libnsl for package: openlitespeed-1.6.14-1.el8.x86_64
--> Running transaction check
---> Package libX11-common.noarch 0:1.6.7-2.amzn2 will be installed
---> Package libxcb.x86_64 0:1.12-1.amzn2.0.2 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.amzn2.0.2.x86_64
---> Package lsphp73.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libargon2.so.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
---> Package lsphp73-common.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-common-7.3.18-1.el8.x86_64
---> Package lsphp73-gd.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libpng16.so.16(PNG16_0)(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libpng16.so.16()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
---> Package lsphp73-opcache.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-opcache-7.3.18-1.el8.x86_64
---> Package openlitespeed.x86_64 0:1.6.14-1.el8 will be installed
--> Processing Dependency: libnsl for package: openlitespeed-1.6.14-1.el8.x86_64
--> Running transaction check
---> Package libXau.x86_64 0:1.0.8-2.1.amzn2.0.2 will be installed
---> Package lsphp73.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
--> Processing Dependency: libargon2.so.1()(64bit) for package: lsphp73-7.3.18-1.el8.x86_64
---> Package lsphp73-common.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-common-7.3.18-1.el8.x86_64
---> Package lsphp73-gd.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libpng16.so.16(PNG16_0)(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libwebp.so.7()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
--> Processing Dependency: libpng16.so.16()(64bit) for package: lsphp73-gd-7.3.18-1.el8.x86_64
---> Package lsphp73-opcache.x86_64 0:7.3.18-1.el8 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.27)(64bit) for package: lsphp73-opcache-7.3.18-1.el8.x86_64
---> Package openlitespeed.x86_64 0:1.6.14-1.el8 will be installed
--> Processing Dependency: libnsl for package: openlitespeed-1.6.14-1.el8.x86_64
--> Finished Dependency Resolution
Error: Package: lsphp73-opcache-7.3.18-1.el8.x86_64 (litespeed)
Requires: libc.so.6(GLIBC_2.27)(64bit)
Error: Package: lsphp73-7.3.18-1.el8.x86_64 (litespeed)
Requires: libargon2.so.1()(64bit)
Error: Package: lsphp73-gd-7.3.18-1.el8.x86_64 (litespeed)
Requires: libwebp.so.7()(64bit)
Error: Package: openlitespeed-1.6.14-1.el8.x86_64 (litespeed)
Requires: libnsl
Error: Package: lsphp73-common-7.3.18-1.el8.x86_64 (litespeed)
Requires: libc.so.6(GLIBC_2.27)(64bit)
Error: Package: lsphp73-gd-7.3.18-1.el8.x86_64 (litespeed)
Requires: libpng16.so.16(PNG16_0)(64bit)
Error: Package: lsphp73-7.3.18-1.el8.x86_64 (litespeed)
Requires: libc.so.6(GLIBC_2.27)(64bit)
Error: Package: lsphp73-gd-7.3.18-1.el8.x86_64 (litespeed)
Requires: libpng16.so.16()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我不知道如何解决它。感谢您的回复。
OpenLiteSpeed 的新手,在尝试使用 PHP 中的 file_put_contents() API 在网站子目录中写入文件时,我收到了权限被拒绝警告错误。我想也许我需要调整/usr/local/lsws/lsphp73/etc/php/7.3/litespeed/php.ini中的 open_basedir并重新启动 OpenLiteSpeed,但警告仍然存在。然后chown -R www-data:www-data /var/www
我在我的配置中有网站的地方做了,但这似乎没有帮助。然后,我使用 chown 打开要编辑的文件目录的权限,然后是文件本身。似乎没有任何效果。怎么了?
我的 public_html 目录中有一个 .htaccess 文件,其中包含以下规则:
<IfModule litespeed>
php_flag zlib.output_compression On
php_value zlib.output_compression_level 2
php_value session.gc_maxlifetime 200000
php_flag display_startup_errors On
php_flag html_errors On
php_flag ignore_repeated_errors Off
php_flag ignore_repeated_source Off
php_flag report_memleaks On
php_flag track_errors On
php_value log_errors_max_len 0
php_flag display_errors Off
php_flag log_errors On
php_value error_log errors.log
php_value max_execution_time 600
php_value max_input_time 600
php_value max_input_vars 100000
</IfModule>
他们工作正常,通过确认phpinfo();
但是,当我将 .htaccess 文件放在子目录中时,如果使用假设覆盖上述规则的规则,它们将被完全忽略,并且只有上述规则有效。
比如我在我的public_html/admin目录下放了一个.htaccess文件,规则如下
<IfModule litespeed>
php_value session.gc_maxlifetime 7200
php_flag display_errors On
</IfModule>
检查phpinfo();
时显示值仍然是“200000”和“Off”,而不是分别为“7200”和“On”。
为什么会发生这种情况,我该如何解决?