diff --git a/LSQUICCOMMIT b/LSQUICCOMMIT index 8488569ca..7d8130117 100644 --- a/LSQUICCOMMIT +++ b/LSQUICCOMMIT @@ -1 +1 @@ -7483dee0749c024a32a2675408de34246ea6d792 +692a91022d93293415722c0cedf36dc3825021e4 diff --git a/build.sh b/build.sh index 00443541e..506a77b12 100755 --- a/build.sh +++ b/build.sh @@ -19,7 +19,7 @@ ### Author: dxu@litespeedtech.com (David Shue) -VERSION=1.0.0 +VERSION=1.0.1 moduledir="modreqparser modinspector uploadprogress " OS=`uname` ISLINUX=no @@ -28,7 +28,7 @@ VERSIONNUMBER= if [ "${OS}" = "FreeBSD" ] ; then APP_MGRS="pkg" elif [ "${OS}" = "Linux" ] ; then - APP_MGRS="yum apt apt-get zypper" + APP_MGRS="yum apt apt-get zypper apk" elif [ "${OS}" = "Darwin" ] ; then APP_MGRS="port brew" else @@ -79,7 +79,12 @@ getVersionNumber() installCmake() { - ${APP_MGR_CMD} -y install git cmake + if [ "${APP_MGR_CMD}" = "apk" ] ; then + ${APP_MGR_CMD} add --update git cmake + else + ${APP_MGR_CMD} -y install git cmake + fi + if [ $? = 0 ] ; then CMAKEVER=`cmake --version | grep version | awk '{print $3}'` getVersionNumber $CMAKEVER @@ -108,7 +113,12 @@ installCmake() installgo() { - ${APP_MGR_CMD} -y install golang-go + if [ "${APP_MGR_CMD}" = "apk" ] ; then + ${APP_MGR_CMD} add --update go + else + ${APP_MGR_CMD} -y install golang-go + fi + if [ $? = 0 ] ; then echo go installed. else @@ -283,14 +293,28 @@ prepareLinux() apt-get -y install libexpat-dev installCmake - apt-get -y install git libtool + apt-get -y install git libtool ca-certificates apt-get -y install autotools-dev apt-get -y install autoreconf apt-get -y install autoheader apt-get -y install automake installgo - + elif [ -f /etc/alpine-release ] ; then + OSTYPE=ALPINE + ${APP_MGR_CMD} add make + ${APP_MGR_CMD} add gcc g++ + ${APP_MGR_CMD} add patch + installCmake + ${APP_MGR_CMD} add git libtool linux-headers bsd-compat-headers curl + ${APP_MGR_CMD} add automake autoconf + ${APP_MGR_CMD} add build-base expat-dev zlib-dev + installgo + sed -i -e "s/u_int32_t/uint32_t/g" $(grep -rl u_int32_t src/) + sed -i -e "s/u_int64_t/uint64_t/g" $(grep -rl u_int64_t src/) + sed -i -e "s/u_int8_t/uint8_t/g" $(grep -rl u_int8_t src/) + sed -i -e "s@@@g" $(grep -rl "" src/) + sed -i -e "s/PTHREAD_MUTEX_ADAPTIVE_NP/PTHREAD_MUTEX_NORMAL/g" src/lsr/ls_lock.c else echo May not support your platform, but we can do a try to install some tools. @@ -299,7 +323,7 @@ prepareLinux() ${APP_MGR_CMD} -y install clang ${APP_MGR_CMD} -y install patch installCmake - ${APP_MGR_CMD} -y install git libtool + ${APP_MGR_CMD} -y install git libtool ca-certificates ${APP_MGR_CMD} -y install autotools-dev ${APP_MGR_CMD} -y install autoreconf ${APP_MGR_CMD} -y install autoheader @@ -408,6 +432,9 @@ updateSrcCMakelistfile() sed -i -e "s/-Wl,--no-whole-archive//g" src/CMakeLists.txt fi + if [ "${OSTYPE}" = "ALPINE" ] ; then + sed -i -e "s/c_nonshared//g" src/CMakeLists.txt + fi } updateModuleCMakelistfile() @@ -428,9 +455,11 @@ updateModuleCMakelistfile() echo "add_subdirectory(modsecurity-ls)" >> src/modules/CMakeLists.txt fi + #For linux but not alpine, add pagespeed module if [ "${ISLINUX}" = "yes" ] ; then - echo "add_subdirectory(pagespeed)" >> src/modules/CMakeLists.txt - + if [ ! "${OSTYPE}" = "ALPINE" ] ; then + echo "add_subdirectory(pagespeed)" >> src/modules/CMakeLists.txt + fi fi @@ -539,8 +568,8 @@ mkdir thirdparty/lib64 cd thirdparty/script/ - -sed -i -e "s/unittest-cpp/ /g" ./build_ols.sh +#Remove unittest-cpp and add bcrypt +sed -i -e "s/unittest-cpp/bcrypt/g" ./build_ols.sh if [ "${ISLINUX}" != "yes" ] ; then sed -i -e "s/psol/ /g" ./build_ols.sh diff --git a/configure b/configure index 5a90ecdd0..68671b478 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for openlitespeed 1.7.3. +# Generated by GNU Autoconf 2.69 for openlitespeed 1.7.4. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='openlitespeed' PACKAGE_TARNAME='openlitespeed' -PACKAGE_VERSION='1.7.3' -PACKAGE_STRING='openlitespeed 1.7.3' +PACKAGE_VERSION='1.7.4' +PACKAGE_STRING='openlitespeed 1.7.4' PACKAGE_BUGREPORT='info@litespeedtech.com' PACKAGE_URL='http://www.litespeedtech.com/' @@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures openlitespeed 1.7.3 to adapt to many kinds of systems. +\`configure' configures openlitespeed 1.7.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1480,7 +1480,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of openlitespeed 1.7.3:";; + short | recursive ) echo "Configuration of openlitespeed 1.7.4:";; esac cat <<\_ACEOF @@ -1641,7 +1641,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -openlitespeed configure 1.7.3 +openlitespeed configure 1.7.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2315,7 +2315,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by openlitespeed $as_me 1.7.3, which was +It was created by openlitespeed $as_me 1.7.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3181,7 +3181,7 @@ fi # Define the identity of the package. PACKAGE='openlitespeed' - VERSION='1.7.3' + VERSION='1.7.4' # Some tools Automake needs. @@ -19623,7 +19623,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by openlitespeed $as_me 1.7.3, which was +This file was extended by openlitespeed $as_me 1.7.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19690,7 +19690,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -openlitespeed config.status 1.7.3 +openlitespeed config.status 1.7.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 021d7291c..c95869373 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ m4_include(ax_check_libudns.m4) m4_include(ax_check_ip2location.m4) dnl Process this file with autoconf to produce a configure script. -AC_INIT([openlitespeed],[1.7.3],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/]) +AC_INIT([openlitespeed],[1.7.4],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/]) AM_INIT_AUTOMAKE([1.0 foreign no-define subdir-objects]) AC_CONFIG_HEADERS(src/config.h:src/config.h.in) diff --git a/dist/Example/html/index.html b/dist/Example/html/index.html index 3e07698d1..23b516fe4 100644 --- a/dist/Example/html/index.html +++ b/dist/Example/html/index.html @@ -1,271 +1,271 @@ - - - - - - - - Welcome - - - - - - - - - - - - -
-
-
- -
-
openlitespeed logo
-

Congratulations

-

You have successfully installed the OpenLiteSpeed Web Server!

-
- -
- READ ME! -
- - -
-
- -

{  Read Me  }

-
-

You should replace this page with your own web pages.

-

It is not recommended to copy files into the directory where this page located, they might be over-written during upgrade or reinstallation.

-

Create a new virtual host and map a listener to it. Have no clue? Please read the Documentation.

-

For your web administration login page, please refer to the installation guide.

-

Add openlitespeed logo the OpenLiteSpeed logo to your web site if you'd like to help us promote the server.

-
-
-
-
-
- -
-
- - -
-

Simple Feature Demos

-
- - -
- -
-
- cgi -
-
-

CGI script

-
-
Hello World from CGI script -
-
- -
-
-
- -
- -
-
- php -
-
-

Test PHP

-
-
If you enabled PHP during installation,
click here to test it -
- -
-
-
- -
- -
-
- 404 -
-
-

Customized Error Page

-
-
Missing page -
-
- -
-
-
- - - - -
- -
-
- password protection -
-
-

Authentication

-
-
Password protected content,
user name: test, password: test123 -
- -
-
-
- - -
- -
-
- blocked content -
-
-

Blocked Content

-
-
Blocked area -
-
- -
-
-
- -
- -
-
- file upload -
-
-

File Upload

-
-
Test file upload progress module -
-
- -
-
-
-
-
- - -
- - - -
-
-
-

About OpenLiteSpeed

-
-
- -
- -
- -
-
Features
-

-
    -
  • Event-driven architecture and extremely low resource overhead
  • -
  • User friendly WebAdmin GUI
  • -
  • Built-in full-page cache module is highly-customizable and efficient
  • -
  • Native SAPI allows external PHP applications to run up to 50% faster
  • -
  • Install OpenLiteSpeed, MariaDB and WordPress with just one click
  • -
- -
-
- - - - -
-
-
-
- -
- power by openlitespeed -
-

Back to top

- -
-
- - - - - - + + + + + + + + Welcome + + + + + + + + + + + + +
+
+
+ +
+
openlitespeed logo
+

Congratulations

+

You have successfully installed the OpenLiteSpeed Web Server!

+
+ +
+ READ ME! +
+ + +
+
+ +

{  Read Me  }

+
+

You should replace this page with your own web pages.

+

It is not recommended to copy files into the directory where this page located, they might be over-written during upgrade or reinstallation.

+

Create a new virtual host and map a listener to it. Have no clue? Please read the Documentation.

+

For your web administration login page, please refer to the installation guide.

+

Add openlitespeed logo the OpenLiteSpeed logo to your web site if you'd like to help us promote the server.

+
+
+
+
+
+ +
+
+ + +
+

Simple Feature Demos

+
+ + +
+ +
+
+ cgi +
+
+

CGI script

+
+
Hello World from CGI script +
+
+ +
+
+
+ +
+ +
+
+ php +
+
+

Test PHP

+
+
If you enabled PHP during installation,
click here to test it +
+ +
+
+
+ +
+ +
+
+ 404 +
+
+

Customized Error Page

+
+
Missing page +
+
+ +
+
+
+ + + + +
+ +
+
+ password protection +
+
+

Authentication

+
+
Password protected content,
user name: test, password: test123 +
+ +
+
+
+ + +
+ +
+
+ blocked content +
+
+

Blocked Content

+
+
Blocked area +
+
+ +
+
+
+ +
+ +
+
+ file upload +
+
+

File Upload

+
+
Test file upload progress module +
+
+ +
+
+
+
+
+ + +
+ + + +
+
+
+

About OpenLiteSpeed

+
+
+ +
+ +
+ +
+
Features
+

+
    +
  • Event-driven architecture and extremely low resource overhead
  • +
  • User friendly WebAdmin GUI
  • +
  • Built-in full-page cache module is highly-customizable and efficient
  • +
  • Native SAPI allows external PHP applications to run up to 50% faster
  • +
  • Install OpenLiteSpeed, MariaDB and WordPress with just one click
  • +
+ +
+
+ + + + +
+
+
+
+ +
+ power by openlitespeed +
+

Back to top

+ +
+
+ + + + + + diff --git a/dist/VERSION b/dist/VERSION index 661e7aead..10c088013 100644 --- a/dist/VERSION +++ b/dist/VERSION @@ -1 +1 @@ -1.7.3 +1.7.4 diff --git a/dist/add-ons/webcachemgr/VERSION b/dist/add-ons/webcachemgr/VERSION index da38e07b3..f0df1f7d5 100644 --- a/dist/add-ons/webcachemgr/VERSION +++ b/dist/add-ons/webcachemgr/VERSION @@ -1 +1 @@ -1.13.1 \ No newline at end of file +1.13.2 \ No newline at end of file diff --git a/dist/add-ons/webcachemgr/src/CliController.php b/dist/add-ons/webcachemgr/src/CliController.php index 119d3d1f4..0f670efa8 100644 --- a/dist/add-ons/webcachemgr/src/CliController.php +++ b/dist/add-ons/webcachemgr/src/CliController.php @@ -1,6 +1,6 @@ getCount() == 0 ) { - $msg = 'No WordPress installations discovered in the previous scan. If you have any newly ' - . "installed WordPress installations, please scan again or add them with" + $msg = 'No WordPress installations discovered in the previous ' + . 'scan. If you have any newly installed WordPress ' + . 'installations, please scan again or add them with' . "command 'addinstalls'.\n"; } @@ -170,11 +166,13 @@ private function printStatusMsg( WPInstall $wpInstall ) $msg .= 'Could not retrieve WordPress siteURL.'; } elseif ( $status & WPInstall::ST_ERR_DOCROOT ) { - $msg .= 'Could not match WordPress siteURL to a known control panel docroot.'; + $msg .= 'Could not match WordPress siteURL to a known control ' + . 'panel docroot.'; } elseif ( $status & WPInstall::ST_ERR_EXECMD ) { - $msg .= 'WordPress fatal error encountered during action execution. This is most likely ' - . 'caused by custom code in this WordPress installation.'; + $msg .= 'WordPress fatal error encountered during action ' + . 'execution. This is most likely caused by custom code in ' + . 'this WordPress installation.'; } elseif ( $status & WPInstall::ST_ERR_EXECMD_DB ) { $msg .= 'Error establishing WordPress database connection.'; @@ -193,7 +191,7 @@ private function printStatusMsg( WPInstall $wpInstall ) * * @param string[] $args * @return null - * @throws LSCMException + * @throws LSCMException Thrown directly and indirectly. */ private function handleSetCacheRootInput( &$args ) { @@ -209,7 +207,9 @@ private function handleSetCacheRootInput( &$args ) if ( empty($args[$key + 1]) || ($this->svrCacheRootParam = trim($args[$key + 1])) == '' ) { - throw new LSCMException('Invalid Command, missing server cache root value.'); + throw new LSCMException( + 'Invalid Command, missing server cache root value.' + ); } $currSvrCacheRoot = $controlPanel->getServerCacheRoot(); @@ -218,7 +218,9 @@ private function handleSetCacheRootInput( &$args ) if ( !Util::is_dir_empty($this->svrCacheRootParam) ) { throw new LSCMException( - 'Provided server level cache root must be an empty directory.'); + 'Provided server level cache root must be an empty ' + . 'directory.' + ); } $this->cacheRootCmds[] = 'setSvrCacheRoot'; @@ -234,14 +236,17 @@ private function handleSetCacheRootInput( &$args ) || ($this->vhCacheRootParam = trim($args[$key + 1])) == '' ) { throw new LSCMException( - 'Invalid Command, missing virtual host cache root value.'); + 'Invalid Command, missing virtual host cache root value.' + ); } if ( strpos($this->vhCacheRootParam, '$') !== false ) { throw new LSCMException( - 'Invalid Command, virtual host cache root value cannot contain any \'$\' ' - . 'characters. \'$vh_user\' will be automatically added to the end of virtual ' - . 'host cache root values starting with a \'/\'.'); + 'Invalid Command, virtual host cache root value cannot ' + . 'contain any \'$\' characters. \'$vh_user\' will be ' + . 'automatically added to the end of virtual host ' + . 'cache root values starting with a \'/\'.' + ); } $currVHCacheRoot = $controlPanel->getVHCacheRoot(); @@ -253,8 +258,10 @@ private function handleSetCacheRootInput( &$args ) if ( $updatedVhCacheRoot != $currVHCacheRoot && ! Util::is_dir_empty($this->vhCacheRootParam) ) { - throw new LSCMException('Provided absolute path for virtual host level ' - . 'cache root must be an empty directory.'); + throw new LSCMException( + 'Provided absolute path for virtual host level cache ' + . 'root must be an empty directory.' + ); } $this->vhCacheRootParam = $updatedVhCacheRoot; @@ -383,11 +390,15 @@ private function handleDashNotifyInput( $cmdType, &$args ) if ( ($key = array_search('-wppath', $args)) === false ) { throw new LSCMException( - 'Invalid Command, missing required \'-m\' or \'-wppath\'. parameter.'); + 'Invalid Command, missing required \'-m\' or ' + . '\'-wppath\' parameter.' + ); } if ( empty($args[$key + 1]) ) { - throw new LSCMException('Invalid Command, missing \'-wppath\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'-wppath\' value.' + ); } $path = $args[$key + 1]; @@ -416,23 +427,30 @@ private function handleDashNotifyInput( $cmdType, &$args ) $msgFilePath = $args[$key + 1]; if ( !file_exists($msgFilePath) ) { - throw new LSCMException('Provided message file does not exist.'); + throw new LSCMException( + 'Provided message file does not exist.' + ); } if ( ($message = file_get_contents($msgFilePath)) === false ) { throw new LSCMException( - 'Unable to retrieve provided message file content.'); + 'Unable to retrieve provided message file content.' + ); } } else { if ( ($key = array_search('-msg', $args)) === false ) { throw new LSCMException( - 'Invalid Command, missing required \'-msgfile\' or \'-msg\'. parameter.'); + 'Invalid Command, missing required \'-msgfile\' or ' + . '\'-msg\' parameter.' + ); } if ( empty($args[$key + 1]) ) { - throw new LSCMException('Invalid Command, missing \'-msg\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'-msg\' value.' + ); } $message = $args[$key + 1]; @@ -445,19 +463,24 @@ private function handleDashNotifyInput( $cmdType, &$args ) if ( ($key = array_search('-plugin', $args)) !== false ) { if ( empty($args[$key + 1]) ) { - throw new LSCMException('Invalid Command, missing \'-plugin\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'-plugin\' value.' + ); } $slug = $args[$key + 1]; - $url = "https://api.wordpress.org/plugins/info/1.0/{$slug}.json"; + $url = + "https://api.wordpress.org/plugins/info/1.0/{$slug}.json"; $pluginInfoJSON = Util::get_url_contents($url); $pluginInfo = json_decode($pluginInfoJSON, true); if ( empty($pluginInfo['name']) ) { throw new LSCMException( - 'Could not find a plugin mathcing the provided plugin slug.'); + 'Could not find a plugin mathcing the provided plugin ' + . 'slug.' + ); } $dashInput['slug'] = $slug; @@ -477,7 +500,9 @@ private function handleDashNotifyInput( $cmdType, &$args ) $path = $arg1; if ( $path == null ) { - throw new LSCMException('Invalid Command, missing WP path.'); + throw new LSCMException( + 'Invalid Command, missing WP path.' + ); } $wpInstall = new WPInstall($path); @@ -519,8 +544,10 @@ private function handleCpanelPluginInput( &$args ) $controlPanel = ControlPanel::getClassInstance(); if ( !($controlPanel instanceof CPanel) ) { - throw new LSCMException('Command \'cpanelplugin\' cannot be used in a non-cPanel ' - . 'environment.'); + throw new LSCMException( + 'Command \'cpanelplugin\' cannot be used in a non-cPanel ' + . 'environment.' + ); } if ( $args[0] == '--install' ) { @@ -561,33 +588,41 @@ private function handleAddInstallsInput( &$args ) case '-wpinstall': if ( empty($args[1]) ) { - throw new LSCMException('Invalid Command, missing \'\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'\' value.' + ); } $wpInstallsInfo = "{$args[1]}"; if ( empty($args[2]) ) { - throw new LSCMException('Invalid Command, missing \'\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'\' value.' + ); } $wpInstallsInfo .= " {$args[2]}"; if ( empty($args[3]) ) { throw new LSCMException( - 'Invalid Command, missing \'\' value.'); + 'Invalid Command, missing \'\' value.' + ); } $wpInstallsInfo .= " {$args[3]}"; if ( empty($args[4]) ) { - throw new LSCMException('Invalid Command, missing \'\' value.'); + throw new LSCMException( + 'Invalid Command, missing \'\' value.' + ); } $wpInstallsInfo .= " {$args[4]}"; $this->commands[] = WPInstallStorage::CMD_ADD_CUST_WPINSTALLS; - $this->input = array( 'addInstallsInfo' => array($wpInstallsInfo) ); + $this->input = + array( 'addInstallsInfo' => array($wpInstallsInfo) ); unset($args[0], $args[1], $args[2], $args[3], $args[4]); break; @@ -596,19 +631,24 @@ private function handleAddInstallsInput( &$args ) if ( empty($args[1]) ) { throw new LSCMException( - 'Invalid Command, missing \'-wpinstallsfile\' value.'); + 'Invalid Command, missing \'-wpinstallsfile\' value.' + ); } $wpInstallsFile = $args[1]; if ( !file_exists($wpInstallsFile) ) { - throw new LSCMException('Provided wpinstalls file does not exist.'); + throw new LSCMException( + 'Provided wpinstalls file does not exist.' + ); } $fileContent = file_get_contents($wpInstallsFile); if ( $fileContent === false ) { - throw new LSCMException("Could not read wpinstalls file content."); + throw new LSCMException( + 'Could not read wpinstalls file content.' + ); } $wpInstallsInfo = explode("\n", trim($fileContent)); @@ -668,8 +708,10 @@ private function parseCommands( $args ) switch ($cmd) { case 'setcacheroot': if ( $panelClassName == 'custom' ) { - $msg = 'Command \'setcacheroot\' cannot be used in the CustomPanel context.'; - throw new LSCMException($msg); + throw new LSCMException( + 'Command \'setcacheroot\' cannot be used in the ' + . 'CustomPanel context.' + ); } $this->handleSetCacheRootInput($args); @@ -776,12 +818,14 @@ private function doSpecialCommand() switch ( $controlPanel->installCpanelPlugin() ) { case 'update': - echo "Updated LiteSpeed cPanel plugin to current version\n\n"; + echo 'Updated LiteSpeed cPanel plugin to current ' + . "version\n\n"; break; case 'new': $this->initNewCpanelPluginConf($controlPanel); - echo "LiteSpeed cPanel plugin installed, auto install turned on.\n\n"; + echo 'LiteSpeed cPanel plugin installed, auto install ' + . "turned on.\n\n"; break; //no default @@ -793,23 +837,28 @@ private function doSpecialCommand() /* @var $controlPanel CPanel */ $controlPanel->uninstallCpanelPlugin(); - echo "LiteSpeed cPanel plugin uninstalled successfully, auto install turned off.\n\n"; + echo 'LiteSpeed cPanel plugin uninstalled successfully, auto ' + . "install turned off.\n\n"; break; case 'cpanelPluginAutoInstallStatus': $state = (CPanel::isCpanelPluginAutoInstallOn()) ? 'On' : 'Off'; - echo "Auto install is currently {$state} for the LiteSpeed cPanel plugin.\n"; - echo "Use command 'cpanelplugin -autoinstall {0 | 1}' to turn auto install off/on respectively.\n\n"; + echo "Auto install is currently {$state} for the LiteSpeed " + . "cPanel plugin.\n"; + echo 'Use command \'cpanelplugin -autoinstall {0 | 1}\' to ' + . "turn auto install off/on respectively.\n\n"; break; case 'cpanelPluginAutoInstallOn': if ( CPanel::turnOnCpanelPluginAutoInstall() ) { - echo "Auto install is now On for LiteSpeed cPanel plugin.\n\n"; + echo 'Auto install is now On for LiteSpeed cPanel plugin.' + . "\n\n"; } else { - echo "Failed to turn off auto install for LiteSpeed cPanel plugin.\n\n"; + echo 'Failed to turn off auto install for LiteSpeed cPanel ' + . "plugin.\n\n"; } break; @@ -817,10 +866,12 @@ private function doSpecialCommand() case 'cpanelPluginAutoInstallOff': if ( CPanel::turnOffCpanelPluginAutoInstall() ) { - echo "Auto install is now Off for LiteSpeed cPanel plugin.\n\n"; + echo 'Auto install is now Off for LiteSpeed cPanel plugin.' + . "\n\n"; } else { - echo "Failed to turn on auto install for LiteSpeed cPanel plugin.\n\n"; + echo 'Failed to turn on auto install for LiteSpeed cPanel ' + . "plugin.\n\n"; } break; @@ -838,7 +889,8 @@ private function doVersionCommand() case 'list': $allowedVers = $pluginVerInstance->getAllowedVersions(); - echo "Available versions are: \n" . implode("\n",$allowedVers) . "\n"; + echo "Available versions are: \n" . implode("\n",$allowedVers) + . "\n"; break; case 'latest': @@ -852,7 +904,8 @@ private function doVersionCommand() } if ( $latest == $currVer ) { - echo "Current version, {$latest}, is already the latest version.\n"; + echo "Current version, {$latest}, is already the latest " + . "version.\n"; } else { $pluginVerInstance->setActiveVersion($latest); @@ -906,7 +959,11 @@ private function doWPInstallStorageAction() case 'mass_dash_notify': DashNotifier::prepLocalDashPluginFiles(); - $slug = (isset($this->input['slug'])) ? $this->input['slug'] : ''; + $slug = ''; + + if ( isset($this->input['slug']) ) { + $slug = $this->input['slug']; + } $msgInfoJSON = json_encode( array( diff --git a/dist/add-ons/webcachemgr/src/Panel/CPanel.php b/dist/add-ons/webcachemgr/src/Panel/CPanel.php index a1656669e..34f29b8ad 100644 --- a/dist/add-ons/webcachemgr/src/Panel/CPanel.php +++ b/dist/add-ons/webcachemgr/src/Panel/CPanel.php @@ -17,40 +17,122 @@ class CPanel extends ControlPanel { + /** + * @var string + */ const USER_PLUGIN_INSTALL_SCRIPT = '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/res/ls_web_cache_mgr/install.sh'; + + /** + * @var string + */ const USER_PLUGIN_UNINSTALL_SCRIPT = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/uninstall.sh'; - const USER_PLUGIN_CONF = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/lswcm.conf'; + + /** + * @since 1.13.2 + * @var string + */ + const USER_PLUGIN_BACKUP_DIR = '/tmp/lscp-plugin-tmp'; + + /** + * @since 1.13.2 + * @var string + */ + const USER_PLUGIN_DIR = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager'; + + + /** + * @since 1.13.2 + * @var string Old location for cPanel user-end plugin conf file. + */ + const USER_PLUGIN_CONF_OLD = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/lswcm.conf'; + + /** + * @var string + */ + const USER_PLUGIN_CONF = '/usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/data/lswcm.conf'; + + /** + * @var string + */ const CPANEL_AUTOINSTALL_DISABLE_FLAG = '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/cpanel_autoinstall_off'; + + /** + * @var string + */ const USER_PLUGIN_SETTING_VHOST_CACHE_ROOT = 'vhost_cache_root'; + + /** + * @var string + */ const USER_PLUGIN_SETTING_LSWS_DIR = 'lsws_dir'; /** - * @var bool + * @since 1.13.2 + * @var string + */ + protected $cpanelPluginDataDir; + + /** + * @since 1.13.2 + * @var string + */ + protected $cpanelPluginTplDir; + + /** + * @since 1.13.2 + * @var string + */ + protected $cpanelPluginCustTransDir; + + /** + * @since 1.13.2 + * @var string + */ + protected $tmpCpanelPluginDataDir; + + /** + * @since 1.13.2 + * @var string + */ + protected $tmpCpanelPluginTplDir; + + /** + * @since 1.13.2 + * @var string */ - protected $isEA4; + protected $tmpCpanelPluginCustTransDir; protected function __construct() + { + /** @noinspection PhpUnhandledExceptionInspection */ + parent::__construct(); + } + + /** + * + * @since 1.13.2 + */ + protected function init2() { $this->panelName = 'cPanel/WHM'; $this->defaultSvrCacheRoot = '/home/lscache/'; - $this->isEA4 = file_exists('/etc/cpanel/ea4/is_ea4'); - parent::__construct(); + $this->cpanelPluginDataDir = self::USER_PLUGIN_DIR . '/data'; + $this->cpanelPluginTplDir = self::USER_PLUGIN_DIR . '/landing'; + $this->cpanelPluginCustTransDir = self::USER_PLUGIN_DIR . '/lang/cust'; + $this->tmpCpanelPluginDataDir = self::USER_PLUGIN_BACKUP_DIR . '/data'; + $this->tmpCpanelPluginTplDir = + self::USER_PLUGIN_BACKUP_DIR . '/landing'; + $this->tmpCpanelPluginCustTransDir = + self::USER_PLUGIN_BACKUP_DIR . '/cust'; + + /** @noinspection PhpUnhandledExceptionInspection */ + parent::init2(); } protected function initConfPaths() { - if ( $this->isEA4 ) { - $this->apacheConf = - '/etc/apache2/conf.d/includes/pre_main_global.conf'; - $this->apacheVHConf = - '/etc/apache2/conf.d/userdata/lscache_vhosts.conf'; - } - else { - $this->apacheConf = - '/usr/local/apache/conf/includes/pre_main_global.conf'; - $this->apacheVHConf = - '/usr/local/apache/conf/userdata/lscache_vhosts.conf'; - } + $this->apacheConf = '/etc/apache2/conf.d/includes/pre_main_global.conf'; + $this->apacheVHConf = '/etc/apache2/conf.d/userdata/lscache_vhosts.conf'; } /** @@ -101,6 +183,7 @@ protected function addVHCacheRootSection( $file_contents, /** * * @param string $vhConf + * @param string $vhCacheRoot * @throws LSCMException Thrown directly and indirectly. */ public function createVHConfAndSetCacheRoot( $vhConf, @@ -248,20 +331,11 @@ protected function prepareDocrootMap() public function getPhpBinary( WPInstall $wpInstall ) { /** - * Default PHP always works in EA3 as CloudLinux PHP Selector changes - * this binary. + * cPanel php wrapper should accurately detect the correct binary in + * EA4 when EA4 only directive '--ea-reference-dir' is provided. */ - $phpBin = 'php'; - - - if ( $this->isEA4 ) { - /** - * cPanel php wrapper should accurately detect the correct binary in - * EA4 when EA4 only directive '--ea-reference-dir' is provided. - */ - $phpBin = '/usr/local/bin/php ' - . "--ea-reference-dir={$wpInstall->getPath()}/wp-admin"; - } + $phpBin = '/usr/local/bin/php ' + . "--ea-reference-dir={$wpInstall->getPath()}/wp-admin"; return "{$phpBin} {$this->phpOptions}"; } @@ -304,85 +378,160 @@ public static function turnOffCpanelPluginAutoInstall() /** * * @return boolean - * @throws LSCMException + * @throws LSCMException Thrown directly and indirectly. */ public function installCpanelPlugin() { if ( !file_exists(self::USER_PLUGIN_INSTALL_SCRIPT) ) { throw new LSCMException( 'Unable to find cPanel user-end plugin installation script.' - . ' Please ensure that the LiteSpeed WHM plugin is already ' - . 'installed.' + . ' Please ensure that the LiteSpeed WHM plugin is already ' + . 'installed.' ); } - $cpanelPluginDir = - '/usr/local/cpanel/base/frontend/paper_lantern/' - . 'ls_web_cache_manager'; - $cpanelPluginConfFile = "{$cpanelPluginDir}/lswcm.conf"; - $cpanelPluginTplDir = "{$cpanelPluginDir}/landing"; - $cpanelPluginCustTransDir = "{$cpanelPluginDir}/lang/cust"; + $existingInstall = true; + $oldLogic = false; - $existingInstall = false; + if ( !file_exists(self::USER_PLUGIN_CONF) ) { - if ( file_exists($cpanelPluginConfFile) ) { - $existingInstall = true; + if ( file_exists(self::USER_PLUGIN_CONF_OLD) ) { + $oldLogic = true; + } + else { + $existingInstall = false; + } + } - $tmpCpanelDir = '/tmp/lscp-plugin-tmp'; - $tmpCpanelPluginConfFile = "{$tmpCpanelDir}/lswcm.conf"; - $tmpCpanelPluginTplDir = "{$tmpCpanelDir}/landing"; - $tmpCpanelPluginCustTransDir = "{$tmpCpanelDir}/cust"; + if ( $existingInstall ) { + $this->backupCpanelPluginDataFiles($oldLogic); + exec(self::USER_PLUGIN_INSTALL_SCRIPT); + $this->restoreCpanelPluginDataFiles($oldLogic); + } + else { + exec(self::USER_PLUGIN_INSTALL_SCRIPT); + self::turnOnCpanelPluginAutoInstall(); + } - if ( file_exists($tmpCpanelDir) ) { - Util::rrmdir($tmpCpanelDir); - } + return ($existingInstall) ? 'update' : 'new'; + } - if ( !mkdir($tmpCpanelDir, 0755) ) { - throw new LSCMException( - "Failed to make temporary directory {$tmpCpanelDir}"); - } + /** + * + * @since 1.13.2 + * + * @param bool $oldLogic + * @return bool + * @throws LSCMException + */ + protected function backupCpanelPluginDataFiles( $oldLogic = false ) + { + if ( !file_exists(self::USER_PLUGIN_DIR) ) { + return false; + } + + if ( file_exists(self::USER_PLUGIN_BACKUP_DIR) ) { + Util::rrmdir(self::USER_PLUGIN_BACKUP_DIR); + } - /** - * Move existing conf file, templates, and custom translations to - * temp directory and remove default template dir to prevent - * overwrite when moving back. - */ - $commands = - "/bin/mv {$cpanelPluginConfFile} {$tmpCpanelPluginConfFile}; " - . "/bin/mv {$cpanelPluginTplDir} {$tmpCpanelPluginTplDir}; " - . "/bin/rm -rf {$tmpCpanelPluginTplDir}/default; " - . "/bin/mv {$cpanelPluginCustTransDir} {$tmpCpanelPluginCustTransDir}; " - . "/bin/rm -rf {$tmpCpanelPluginCustTransDir}/README"; - - exec($commands); + if ( !mkdir(self::USER_PLUGIN_BACKUP_DIR, 0755) ) { + throw new LSCMException( + 'Failed to make temporary directory ' + . self::USER_PLUGIN_BACKUP_DIR + ); } - exec(self::USER_PLUGIN_INSTALL_SCRIPT); + $cpanelPluginDataDir = self::USER_PLUGIN_DIR . '/data'; + $cpanelPluginTplDir = self::USER_PLUGIN_DIR . '/landing'; + $cpanelPluginCustTransDir = self::USER_PLUGIN_DIR . '/lang/cust'; - if ( $existingInstall ) { - $cpanelPluginLangDir = dirname($cpanelPluginCustTransDir); + $tmpCpanelPluginDataDir = self::USER_PLUGIN_BACKUP_DIR . '/data'; + $tmpCpanelPluginTplDir = self::USER_PLUGIN_BACKUP_DIR . '/landing'; + $tmpCpanelPluginCustTransDir = self::USER_PLUGIN_BACKUP_DIR . '/cust'; - if ( !file_exists($cpanelPluginLangDir) ) { - mkdir($cpanelPluginLangDir, 0755); - } + /** + * Move existing conf file, templates, and custom translations to + * temp directory and remove default template dir to prevent + * overwrite when moving back. + */ - /** - * Replace cPanel plugin conf file, templates, and custom - * translations and remove temp directory. - */ - $commands = - "/bin/mv -f {$tmpCpanelPluginConfFile} {$cpanelPluginConfFile}; " - . "/bin/cp -prf {$tmpCpanelPluginTplDir} {$cpanelPluginDir}; " - . "/bin/cp -prf {$tmpCpanelPluginCustTransDir} {$cpanelPluginCustTransDir}; " - . "/bin/rm -rf {$tmpCpanelDir}"; - - exec($commands); + if ($oldLogic) { + $backupCmds = '/bin/mv ' . self::USER_PLUGIN_CONF_OLD . " " + . self::USER_PLUGIN_BACKUP_DIR . '/lswcm.conf;'; } else { - self::turnOnCpanelPluginAutoInstall(); + $backupCmds = + "/bin/mv {$cpanelPluginDataDir} {$tmpCpanelPluginDataDir};"; } - return ($existingInstall) ? 'update' : 'new'; + $backupCmds .= + " /bin/mv {$cpanelPluginTplDir} {$tmpCpanelPluginTplDir}; " + . "/bin/rm -rf {$tmpCpanelPluginTplDir}/default; " + . "/bin/mv {$cpanelPluginCustTransDir} {$tmpCpanelPluginCustTransDir}; " + . "/bin/rm -rf {$tmpCpanelPluginCustTransDir}/README"; + + exec($backupCmds); + + return true; + } + + /** + * + * @since 1.13.2 + * + * @param bool $oldLogic + * @return bool + */ + protected function restoreCpanelPluginDataFiles( $oldLogic = false ) + { + if ( !file_exists(self::USER_PLUGIN_BACKUP_DIR) + || !file_exists(self::USER_PLUGIN_DIR) ) { + + return false; + } + + $tmpCpanelPluginDataDir = self::USER_PLUGIN_BACKUP_DIR . '/data'; + $tmpCpanelPluginTplDir = self::USER_PLUGIN_BACKUP_DIR . '/landing'; + $tmpCpanelPluginCustTransDir = self::USER_PLUGIN_BACKUP_DIR . '/cust'; + + $cpanelPluginDataDir = self::USER_PLUGIN_DIR . '/data'; + $cpanelPluginTplDir = self::USER_PLUGIN_DIR . '/landing'; + $cpanelPluginCustTransDir = self::USER_PLUGIN_DIR . '/lang/cust'; + + $cpanelPluginLangDir = dirname($cpanelPluginCustTransDir); + + if ( !file_exists($cpanelPluginLangDir) ) { + mkdir($cpanelPluginLangDir, 0755); + } + + if ( file_exists($cpanelPluginDataDir) ) { + $cpanelPluginConfFile = self::USER_PLUGIN_CONF; + } + else { + $cpanelPluginConfFile = self::USER_PLUGIN_CONF_OLD; + } + + if ( $oldLogic ) { + $restoreCmds = '/bin/mv -f ' . self::USER_PLUGIN_BACKUP_DIR + . "/lswcm.conf {$cpanelPluginConfFile};"; + } + else { + $restoreCmds = + "/bin/cp -prf {$tmpCpanelPluginDataDir} {$cpanelPluginDataDir};"; + } + + /** + * Replace cPanel plugin conf file, templates, and custom + * translations and remove temp directory. + */ + $restoreCmds .= + " /bin/cp -prf {$tmpCpanelPluginTplDir} {$cpanelPluginTplDir}; " + . "/bin/cp -prf {$tmpCpanelPluginCustTransDir} {$cpanelPluginCustTransDir}; " + . '/bin/rm -rf ' . self::USER_PLUGIN_BACKUP_DIR; + + exec($restoreCmds); + + return true; } public function uninstallCpanelPlugin() @@ -390,7 +539,7 @@ public function uninstallCpanelPlugin() if ( !file_exists(self::USER_PLUGIN_UNINSTALL_SCRIPT) ) { throw new LSCMException( 'Unable to find cPanel user-end plugin uninstallation script.' - . ' Plugin may already be uninstalled.' + . ' Plugin may already be uninstalled.' ); } @@ -406,7 +555,16 @@ public function uninstallCpanelPlugin() */ public function UpdateCpanelPluginConf( $setting, $value ) { + $confFile = ''; + if ( file_exists(self::USER_PLUGIN_CONF) ) { + $confFile = self::USER_PLUGIN_CONF; + } + elseif ( file_exists(self::USER_PLUGIN_CONF_OLD) ) { + $confFile = self::USER_PLUGIN_CONF_OLD; + } + + if ( $confFile != '' ) { switch( $setting ) { @@ -424,16 +582,15 @@ public function UpdateCpanelPluginConf( $setting, $value ) return; } - $content = file_get_contents(self::USER_PLUGIN_CONF); + $content = file_get_contents($confFile); if ( preg_match($pattern, $content) ) { $content = preg_replace($pattern, $replacement, $content); - file_put_contents(self::USER_PLUGIN_CONF, $content); + file_put_contents($confFile, $content); } else { - file_put_contents(self::USER_PLUGIN_CONF, $replacement, - FILE_APPEND); + file_put_contents($confFile, $replacement, FILE_APPEND); } } } diff --git a/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php b/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php index ac24fc353..251579d0d 100644 --- a/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php +++ b/dist/add-ons/webcachemgr/src/Panel/ControlPanel.php @@ -34,7 +34,7 @@ abstract class ControlPanel /** * @var string */ - const PANEL_API_VERSION = '1.13.1'; + const PANEL_API_VERSION = '1.13.2'; /** * @since 1.9 @@ -123,9 +123,23 @@ abstract class ControlPanel protected static $instance; /** + * * @throws LSCMException Thrown indirectly. */ protected function __construct() + { + $this->init2(); + } + + /** + * Temporary function name until existing deprecated public static init() + * function is removed. + * + * @since 1.13.2 + * + * @throws LSCMException Thrown indirectly. + */ + protected function init2() { /** * output_handler value cleared to avoid compressed output through @@ -915,6 +929,7 @@ public static function meetsMinAPIVerRequirement() public static function checkPanelAPICompatibility( $panelAPIVer ) { $supportedAPIVers = array ( + '1.13.2', '1.13.1', '1.13.0.3', '1.13.0.2', diff --git a/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php b/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php index 7bd2ef8ed..c92fc4636 100644 --- a/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php +++ b/dist/add-ons/webcachemgr/src/Panel/CustomPanel.php @@ -21,9 +21,22 @@ protected function __construct() */ $this->panelName = 'customPanel'; + /** @noinspection PhpUnhandledExceptionInspection */ parent::__construct(); } + /** + * + * @since 1.13.2 + */ + protected function init2() + { + $this->panelName = 'customPanel'; + + /** @noinspection PhpUnhandledExceptionInspection */ + parent::init2(); + } + /** * Gets a list of found docroots and associated server names. * Only needed for lscmctl 'scan' command. diff --git a/dist/add-ons/webcachemgr/src/Panel/DirectAdmin.php b/dist/add-ons/webcachemgr/src/Panel/DirectAdmin.php index c1de025a7..2b89c4241 100644 --- a/dist/add-ons/webcachemgr/src/Panel/DirectAdmin.php +++ b/dist/add-ons/webcachemgr/src/Panel/DirectAdmin.php @@ -2,6 +2,7 @@ /** ****************************************** * LiteSpeed Web Server Cache Manager + * * @author: LiteSpeed Technologies, Inc. (https://www.litespeedtech.com) * @copyright: (c) 2019-2020 * ******************************************* */ @@ -16,17 +17,29 @@ class DirectAdmin extends ControlPanel { protected function __construct() + { + /** @noinspection PhpUnhandledExceptionInspection */ + parent::__construct(); + } + + /** + * + * @since 1.13.2 + */ + protected function init2() { $this->panelName = 'DirectAdmin'; $this->defaultSvrCacheRoot = '/home/lscache/'; - parent::__construct(); + + /** @noinspection PhpUnhandledExceptionInspection */ + parent::init2(); } protected function initConfPaths() { $this->apacheConf = '/etc/httpd/conf/extra/httpd-includes.conf'; $this->apacheVHConf = '/usr/local/directadmin/data/templates/custom/' - . 'cust_httpd.CUSTOM.2.pre'; + . 'cust_httpd.CUSTOM.2.pre'; } /** diff --git a/dist/add-ons/webcachemgr/src/Panel/Plesk.php b/dist/add-ons/webcachemgr/src/Panel/Plesk.php index ccf0e2829..de15c1f2c 100644 --- a/dist/add-ons/webcachemgr/src/Panel/Plesk.php +++ b/dist/add-ons/webcachemgr/src/Panel/Plesk.php @@ -17,11 +17,26 @@ class Plesk extends ControlPanel { + /** + * + * @throws LSCMException Thrown indirectly. + */ public function __construct() + { + parent::__construct(); + } + + /** + * + * @since 1.13.2 + * + * @throws LSCMException Thrown indirectly. + */ + protected function init2() { $this->panelName = 'Plesk'; $this->defaultSvrCacheRoot = '/var/www/vhosts/lscache/'; - parent::__construct(); + parent::init2(); } /** diff --git a/dist/admin/html.open/lib/DMsg.php b/dist/admin/html.open/lib/DMsg.php index 0968cbf08..b1f52b0c7 100644 --- a/dist/admin/html.open/lib/DMsg.php +++ b/dist/admin/html.open/lib/DMsg.php @@ -74,7 +74,7 @@ public static function GetSupportedLang(&$cur_lang) public static function SetLang($lang) { - if (array_key_exists($lang, self::$_supported)) { + if (PHP_SAPI !== 'cli' && array_key_exists($lang, self::$_supported)) { $_SESSION[DMsg::_COOKIE_LANG_] = $lang; self::$_curlang = ''; self::$_curtips = ''; diff --git a/dist/admin/html.open/lib/util/build_php/BuildConfig.php b/dist/admin/html.open/lib/util/build_php/BuildConfig.php index 9d57000da..8b6bdd3f4 100644 --- a/dist/admin/html.open/lib/util/build_php/BuildConfig.php +++ b/dist/admin/html.open/lib/util/build_php/BuildConfig.php @@ -25,18 +25,17 @@ public static function GetVersion($field) case self::PHP_VERSION: return array( - '7.4.7', - '7.3.19', - '7.2.31', + '7.4.8', + '7.3.20', + '7.2.32', '7.1.33', '7.0.33', '5.6.40', '5.5.38', '5.4.45', - '5.3.29', - '5.2.17'); + '5.3.29'); - case self::LSAPI_VERSION: return '7.6'; + case self::LSAPI_VERSION: return '7.7'; case self::SUHOSIN_VERSION: return '0.9.38'; diff --git a/dist/admin/html.open/res/css/googlefonts.css b/dist/admin/html.open/res/css/googlefonts.css new file mode 100644 index 000000000..441d4cbf1 --- /dev/null +++ b/dist/admin/html.open/res/css/googlefonts.css @@ -0,0 +1,45 @@ +/* open-sans-300 - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), + url('../fonts/open-sans-v17-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/open-sans-v17-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* open-sans-regular - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans Regular'), local('OpenSans-Regular'), + url('../fonts/open-sans-v17-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/open-sans-v17-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* open-sans-italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 400; + src: local('Open Sans Italic'), local('OpenSans-Italic'), + url('../fonts/open-sans-v17-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/open-sans-v17-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* open-sans-700 - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), + url('../fonts/open-sans-v17-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/open-sans-v17-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* open-sans-700italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 700; + src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), + url('../fonts/open-sans-v17-latin-700italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ + url('../fonts/open-sans-v17-latin-700italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff b/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff new file mode 100644 index 000000000..26567ff25 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff2 b/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff2 new file mode 100644 index 000000000..7bf901c28 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-300.woff2 differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff new file mode 100644 index 000000000..b8b46d0b4 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff2 b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff2 new file mode 100644 index 000000000..3a38286c6 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700.woff2 differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff new file mode 100644 index 000000000..2fb93a388 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff2 b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff2 new file mode 100644 index 000000000..515381338 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-700italic.woff2 differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff b/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff new file mode 100644 index 000000000..2bfa58261 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff2 b/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff2 new file mode 100644 index 000000000..10031c022 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-italic.woff2 differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff b/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff new file mode 100644 index 000000000..39e88ed92 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff differ diff --git a/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff2 b/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff2 new file mode 100644 index 000000000..e9f58b775 Binary files /dev/null and b/dist/admin/html.open/res/fonts/open-sans-v17-latin-regular.woff2 differ diff --git a/dist/bin/lswsctrl b/dist/bin/lswsctrl index e8fd6e91e..fd9abb352 100755 --- a/dist/bin/lswsctrl +++ b/dist/bin/lswsctrl @@ -140,6 +140,7 @@ stop() delay_stop() { killwatch + kill -USR2 $PID kill -HUP $PID ret=$? if [ $ret -eq 0 ]; then @@ -147,7 +148,6 @@ delay_stop() # sleep 1 # fi echo "[OK] $DESC: graceful stop." - sleep 3 else echo "[ERROR] can not kill $DESC" fi diff --git a/dist/conf/vhosts/Example/vhconf.conf b/dist/conf/vhosts/Example/vhconf.conf index 8baa33824..36c32c55c 100644 --- a/dist/conf/vhosts/Example/vhconf.conf +++ b/dist/conf/vhosts/Example/vhconf.conf @@ -100,13 +100,13 @@ realm SampleProtectedArea { userDB { cacheTimeout 60 maxCacheSize 200 - location conf/vhosts/Example/htpasswd + location conf/vhosts/$VH_NAME/htpasswd } groupDB { cacheTimeout 60 maxCacheSize 200 - location conf/vhosts/Example/htgroup + location conf/vhosts/$VH_NAME/htgroup } } diff --git a/dist/docs/AdminGeneral_Help.html b/dist/docs/AdminGeneral_Help.html index 58cc66cc8..e9d6da4a3 100644 --- a/dist/docs/AdminGeneral_Help.html +++ b/dist/docs/AdminGeneral_Help.html @@ -17,7 +17,7 @@

OpenLiteSpeed Web Server Users' Manual

-

Version 1.7  — Rev. 13

+

Version 1.7  — Rev. 17


Log Level

Description

Specifies the level of logging. Available levels (from high to low) are ERROR, WARNING, NOTICE, INFO, and DEBUG. Only messages with a level higher than or equal to the current setting will be logged. If you want to set it to DEBUG, you must set the server log level to DEBUG as well. The level of debugging is controlled solely at the server level by Debug Level.

Syntax

Select from drop down list

Tips

Unless Debug Level is set to a level other than NONE, DEBUG log level does not have any performance impact and is recommended.

See Also

Debug Level

Rolling Size (bytes)

Description

Specifies when the current log file needs to be rolled over, also known as log rotation. When the file size is over the rollover limit, the active log file will be renamed to log_name.mm_dd_yyyy(.sequence) in the same directory and a new active log file will be created. The actual size of the rotated log file once it is created will sometimes be a little bigger than this size limit. Set to 0 to disable log rotation.

Syntax

Integer number

Tips

Append "K", "M", "G" to the number for kilo-, mega- and giga- bytes.

+

Keep Days

Description

Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

Syntax

Integer number

Log Control

Description

Where the access log should be written. There are three options:

  1. Write to the server's access log
  2. Create an access log for this virtual host
  3. Disable access logging

Syntax

Select from drop down list

File Name

Description

The access log filename.

Syntax

Filename which can be an absolute path or a relative path to $SERVER_ROOT, $VH_ROOT.

Tips

Put access log file on a separate disk.

Piped Logger

Description

Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's External App Set UID Mode settings and will never run on behalf of a privileged user.

LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

Syntax

Select from drop down list

Log Format

Description

Specifies the log format for the access log. When log format is set, it will override the Log Headers setting.

Syntax

String. The syntax of log format is compatible with Apache 2.0's custom log format.

Example

Common Log Format (CLF)
"%h %l %u %t \"%r\" %>s %b"

Common Log Format with Virtual Host
"%v %h %l %u %t \"%r\" %>s %b"

NCSA extended/combined log format
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

Log cookie value of Foobar
"%{Foobar}C"

See Also

Log Headers

Log Headers

Description

Specifies whether to log HTTP request headers: Referer, UserAgent, and Host.

Syntax

Select from checkbox

Tips

Turn this off if you do not need these headers in the access log.

See Also

Log Format

-

Keep Days

Description

Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

Syntax

Integer number

Bytes Log

Description

Specifies the path to the bandwidth bytes log file. When specified, a cPanel compatible bandwidth log will be created. This will log the total bytes transferred for a request including both the request and reply bodies.

Syntax

Filename which can be an absolute path or a relative path to $SERVER_ROOT.

Tips

Put the log file on a separate disk.

Compress Archive

Description

Specifies whether to compress rotated log files in order to save disk space.

Syntax

Select from radio box

Tips

Log files are highly compressible and this is recommended to reduce disk usage for old logs.

diff --git a/dist/docs/AdminListeners_General_Help.html b/dist/docs/AdminListeners_General_Help.html index 3cccdf892..412667df7 100644 --- a/dist/docs/AdminListeners_General_Help.html +++ b/dist/docs/AdminListeners_General_Help.html @@ -17,7 +17,7 @@

OpenLiteSpeed Web Server Users' Manual

-

Version 1.7  — Rev. 13

+

Version 1.7  — Rev. 17


    diff --git a/dist/docs/AdminListeners_SSL_Help.html b/dist/docs/AdminListeners_SSL_Help.html index e2455e716..f833026fc 100644 --- a/dist/docs/AdminListeners_SSL_Help.html +++ b/dist/docs/AdminListeners_SSL_Help.html @@ -17,7 +17,7 @@

    OpenLiteSpeed Web Server Users' Manual

    -

    Version 1.7  — Rev. 13

    +

    Version 1.7  — Rev. 17


      diff --git a/dist/docs/AdminSecurity_Help.html b/dist/docs/AdminSecurity_Help.html index d6a1975b4..b614e17da 100644 --- a/dist/docs/AdminSecurity_Help.html +++ b/dist/docs/AdminSecurity_Help.html @@ -17,7 +17,7 @@

      OpenLiteSpeed Web Server Users' Manual

      -

      Version 1.7  — Rev. 13

      +

      Version 1.7  — Rev. 17


        diff --git a/dist/docs/App_Server_Context.html b/dist/docs/App_Server_Context.html index 8d3c48de3..42221a0b4 100644 --- a/dist/docs/App_Server_Context.html +++ b/dist/docs/App_Server_Context.html @@ -17,7 +17,7 @@

        OpenLiteSpeed Web Server Users' Manual

        -

        Version 1.7  — Rev. 13

        +

        Version 1.7  — Rev. 17


          diff --git a/dist/docs/App_Server_Help.html b/dist/docs/App_Server_Help.html index 1964c6c40..dbcbb709f 100644 --- a/dist/docs/App_Server_Help.html +++ b/dist/docs/App_Server_Help.html @@ -17,7 +17,7 @@

          OpenLiteSpeed Web Server Users' Manual

          -

          Version 1.7  — Rev. 13

          +

          Version 1.7  — Rev. 17


            diff --git a/dist/docs/CGI_Context.html b/dist/docs/CGI_Context.html index a7c18e52f..31ef06eb3 100644 --- a/dist/docs/CGI_Context.html +++ b/dist/docs/CGI_Context.html @@ -17,7 +17,7 @@

            OpenLiteSpeed Web Server Users' Manual

            -

            Version 1.7  — Rev. 13

            +

            Version 1.7  — Rev. 17


              diff --git a/dist/docs/CompilePHP_Help.html b/dist/docs/CompilePHP_Help.html index 679300ab3..10e8efc64 100644 --- a/dist/docs/CompilePHP_Help.html +++ b/dist/docs/CompilePHP_Help.html @@ -17,7 +17,7 @@

              OpenLiteSpeed Web Server Users' Manual

              -

              Version 1.7  — Rev. 13

              +

              Version 1.7  — Rev. 17


                diff --git a/dist/docs/Context_Help.html b/dist/docs/Context_Help.html index 5693a808f..79cf1b670 100644 --- a/dist/docs/Context_Help.html +++ b/dist/docs/Context_Help.html @@ -17,7 +17,7 @@

                OpenLiteSpeed Web Server Users' Manual

                -

                Version 1.7  — Rev. 13

                +

                Version 1.7  — Rev. 17


                  diff --git a/dist/docs/ExtApp_Help.html b/dist/docs/ExtApp_Help.html index ce9c7d708..7b77b52fa 100644 --- a/dist/docs/ExtApp_Help.html +++ b/dist/docs/ExtApp_Help.html @@ -17,7 +17,7 @@

                  OpenLiteSpeed Web Server Users' Manual

                  -

                  Version 1.7  — Rev. 13

                  +

                  Version 1.7  — Rev. 17


                    diff --git a/dist/docs/External_FCGI.html b/dist/docs/External_FCGI.html index b18c8f578..266cc6594 100644 --- a/dist/docs/External_FCGI.html +++ b/dist/docs/External_FCGI.html @@ -17,7 +17,7 @@

                    OpenLiteSpeed Web Server Users' Manual

                    -

                    Version 1.7  — Rev. 13

                    +

                    Version 1.7  — Rev. 17


                      diff --git a/dist/docs/External_FCGI_Auth.html b/dist/docs/External_FCGI_Auth.html index a9c66e8d7..9f4bed6fd 100644 --- a/dist/docs/External_FCGI_Auth.html +++ b/dist/docs/External_FCGI_Auth.html @@ -17,7 +17,7 @@

                      OpenLiteSpeed Web Server Users' Manual

                      -

                      Version 1.7  — Rev. 13

                      +

                      Version 1.7  — Rev. 17


                        diff --git a/dist/docs/External_LB.html b/dist/docs/External_LB.html index b31d47686..6c82f5351 100644 --- a/dist/docs/External_LB.html +++ b/dist/docs/External_LB.html @@ -17,7 +17,7 @@

                        OpenLiteSpeed Web Server Users' Manual

                        -

                        Version 1.7  — Rev. 13

                        +

                        Version 1.7  — Rev. 17


                          diff --git a/dist/docs/External_LSAPI.html b/dist/docs/External_LSAPI.html index 653d33a72..e37a3042d 100644 --- a/dist/docs/External_LSAPI.html +++ b/dist/docs/External_LSAPI.html @@ -17,7 +17,7 @@

                          OpenLiteSpeed Web Server Users' Manual

                          -

                          Version 1.7  — Rev. 13

                          +

                          Version 1.7  — Rev. 17


                            diff --git a/dist/docs/External_PL.html b/dist/docs/External_PL.html index f1a62e3f2..5085cfd42 100644 --- a/dist/docs/External_PL.html +++ b/dist/docs/External_PL.html @@ -17,7 +17,7 @@

                            OpenLiteSpeed Web Server Users' Manual

                            -

                            Version 1.7  — Rev. 13

                            +

                            Version 1.7  — Rev. 17


                              diff --git a/dist/docs/External_Servlet.html b/dist/docs/External_Servlet.html index b96290d3c..3ce5e608d 100644 --- a/dist/docs/External_Servlet.html +++ b/dist/docs/External_Servlet.html @@ -17,7 +17,7 @@

                              OpenLiteSpeed Web Server Users' Manual

                              -

                              Version 1.7  — Rev. 13

                              +

                              Version 1.7  — Rev. 17


                                diff --git a/dist/docs/External_WS.html b/dist/docs/External_WS.html index 90717eb75..02b7da871 100644 --- a/dist/docs/External_WS.html +++ b/dist/docs/External_WS.html @@ -17,7 +17,7 @@

                                OpenLiteSpeed Web Server Users' Manual

                                -

                                Version 1.7  — Rev. 13

                                +

                                Version 1.7  — Rev. 17


                                  diff --git a/dist/docs/FCGI_Context.html b/dist/docs/FCGI_Context.html index 6f8d44dac..3578b283d 100644 --- a/dist/docs/FCGI_Context.html +++ b/dist/docs/FCGI_Context.html @@ -17,7 +17,7 @@

                                  OpenLiteSpeed Web Server Users' Manual

                                  -

                                  Version 1.7  — Rev. 13

                                  +

                                  Version 1.7  — Rev. 17


                                    diff --git a/dist/docs/Java_Web_App_Context.html b/dist/docs/Java_Web_App_Context.html index 017f4b31f..afb9b9748 100644 --- a/dist/docs/Java_Web_App_Context.html +++ b/dist/docs/Java_Web_App_Context.html @@ -17,7 +17,7 @@

                                    OpenLiteSpeed Web Server Users' Manual

                                    -

                                    Version 1.7  — Rev. 13

                                    +

                                    Version 1.7  — Rev. 17


                                      diff --git a/dist/docs/LB_Context.html b/dist/docs/LB_Context.html index 0f044f922..9291f5845 100644 --- a/dist/docs/LB_Context.html +++ b/dist/docs/LB_Context.html @@ -17,7 +17,7 @@

                                      OpenLiteSpeed Web Server Users' Manual

                                      -

                                      Version 1.7  — Rev. 13

                                      +

                                      Version 1.7  — Rev. 17


                                        diff --git a/dist/docs/LSAPI_Context.html b/dist/docs/LSAPI_Context.html index 9f35d1c06..094b3d3e1 100644 --- a/dist/docs/LSAPI_Context.html +++ b/dist/docs/LSAPI_Context.html @@ -17,7 +17,7 @@

                                        OpenLiteSpeed Web Server Users' Manual

                                        -

                                        Version 1.7  — Rev. 13

                                        +

                                        Version 1.7  — Rev. 17


                                          diff --git a/dist/docs/Listeners_General_Help.html b/dist/docs/Listeners_General_Help.html index 019b391b6..91436b74f 100644 --- a/dist/docs/Listeners_General_Help.html +++ b/dist/docs/Listeners_General_Help.html @@ -17,7 +17,7 @@

                                          OpenLiteSpeed Web Server Users' Manual

                                          -

                                          Version 1.7  — Rev. 13

                                          +

                                          Version 1.7  — Rev. 17


                                            diff --git a/dist/docs/Listeners_SSL_Help.html b/dist/docs/Listeners_SSL_Help.html index 6063a7bcb..0f972ea42 100644 --- a/dist/docs/Listeners_SSL_Help.html +++ b/dist/docs/Listeners_SSL_Help.html @@ -17,7 +17,7 @@

                                            OpenLiteSpeed Web Server Users' Manual

                                            -

                                            Version 1.7  — Rev. 13

                                            +

                                            Version 1.7  — Rev. 17


                                              diff --git a/dist/docs/Module_Context.html b/dist/docs/Module_Context.html index 84435d4e5..b69c19067 100644 --- a/dist/docs/Module_Context.html +++ b/dist/docs/Module_Context.html @@ -17,7 +17,7 @@

                                              OpenLiteSpeed Web Server Users' Manual

                                              -

                                              Version 1.7  — Rev. 13

                                              +

                                              Version 1.7  — Rev. 17


                                                diff --git a/dist/docs/Module_Help.html b/dist/docs/Module_Help.html index 42f8f6e8c..94b77233f 100644 --- a/dist/docs/Module_Help.html +++ b/dist/docs/Module_Help.html @@ -17,7 +17,7 @@

                                                OpenLiteSpeed Web Server Users' Manual

                                                -

                                                Version 1.7  — Rev. 13

                                                +

                                                Version 1.7  — Rev. 17


                                                  diff --git a/dist/docs/Proxy_Context.html b/dist/docs/Proxy_Context.html index d0b123b65..0bd11f666 100644 --- a/dist/docs/Proxy_Context.html +++ b/dist/docs/Proxy_Context.html @@ -17,7 +17,7 @@

                                                  OpenLiteSpeed Web Server Users' Manual

                                                  -

                                                  Version 1.7  — Rev. 13

                                                  +

                                                  Version 1.7  — Rev. 17


                                                    diff --git a/dist/docs/Redirect_Context.html b/dist/docs/Redirect_Context.html index d4c149786..011a97d64 100644 --- a/dist/docs/Redirect_Context.html +++ b/dist/docs/Redirect_Context.html @@ -17,7 +17,7 @@

                                                    OpenLiteSpeed Web Server Users' Manual

                                                    -

                                                    Version 1.7  — Rev. 13

                                                    +

                                                    Version 1.7  — Rev. 17


                                                      diff --git a/dist/docs/Rewrite_Help.html b/dist/docs/Rewrite_Help.html index a761391fd..c0afe13cb 100644 --- a/dist/docs/Rewrite_Help.html +++ b/dist/docs/Rewrite_Help.html @@ -17,7 +17,7 @@

                                                      OpenLiteSpeed Web Server Users' Manual

                                                      -

                                                      Version 1.7  — Rev. 13

                                                      +

                                                      Version 1.7  — Rev. 17


                                                        diff --git a/dist/docs/ScriptHandler_Help.html b/dist/docs/ScriptHandler_Help.html index aa61e14b2..8d3c18dd5 100644 --- a/dist/docs/ScriptHandler_Help.html +++ b/dist/docs/ScriptHandler_Help.html @@ -17,7 +17,7 @@

                                                        OpenLiteSpeed Web Server Users' Manual

                                                        -

                                                        Version 1.7  — Rev. 13

                                                        +

                                                        Version 1.7  — Rev. 17


                                                          diff --git a/dist/docs/ServGeneral_Help.html b/dist/docs/ServGeneral_Help.html index 0721b5ebe..59ddc534a 100644 --- a/dist/docs/ServGeneral_Help.html +++ b/dist/docs/ServGeneral_Help.html @@ -17,7 +17,7 @@

                                                          OpenLiteSpeed Web Server Users' Manual

                                                          -

                                                          Version 1.7  — Rev. 13

                                                          +

                                                          Version 1.7  — Rev. 17


                                                            diff --git a/dist/docs/ServLog_Help.html b/dist/docs/ServLog_Help.html index 63a20fc45..45e81193d 100644 --- a/dist/docs/ServLog_Help.html +++ b/dist/docs/ServLog_Help.html @@ -17,7 +17,7 @@

                                                            OpenLiteSpeed Web Server Users' Manual

                                                            -

                                                            Version 1.7  — Rev. 13

                                                            +

                                                            Version 1.7  — Rev. 17


                                                              @@ -97,20 +97,20 @@

                                                              Version 1.7  — Rev. 13

                                                              Server Log

                                                              Table of Contents

                                                              Server Log

                                                              -File Name | Log Level | Debug Level | Rolling Size (bytes) | Enable stderr Log

                                                              +File Name | Log Level | Debug Level | Rolling Size (bytes) | Keep Days | Enable stderr Log

                                                              Access Log

                                                              -File Name | Piped Logger | Log Format | Log Headers | Rolling Size (bytes) | Keep Days | Compress Archive

                                                              +File Name | Piped Logger | Log Format | Log Headers | Rolling Size (bytes) | Keep Days | Compress Archive

                                                              File Name

                                                              Description

                                                              Specifies the path for the log file.

                                                              Syntax

                                                              Filename which can be an absolute path or a relative path to $SERVER_ROOT.

                                                              Tips

                                                              Place the log file on a separate disk.

                                                              Log Level

                                                              Description

                                                              Specifies the level of logging to include in your log file. Available levels (from high to low) are: ERROR, WARNING, NOTICE, INFO and DEBUG. Only messages with level higher or equal to the current setting will be logged.

                                                              Syntax

                                                              Select from drop down list

                                                              Tips

                                                              Using DEBUG log level does not have any performance impact, unless Debug Level is set to a level other than NONE. It's recommended to set Log Level to DEBUG and Debug Level to NONE. These settings mean that you will not fill up your hard disk with debug logging, but you will be able to use the Toggle Debug Logging action to control debug output. This action can turn debug logging on and off on the fly, and is useful for debugging busy production servers.

                                                              See Also

                                                              Debug Level

                                                              Debug Level

                                                              Description

                                                              Specifies the level of debug logging. Log Level must be set to DEBUG to use this feature. Debug logging is disabled when "Debug Level" is set to NONE even if Log Level is set to DEBUG. Toggle Debug Logging can be used to control debug level on a live server without restarting.

                                                              Syntax

                                                              Select from drop down list

                                                              Tips

                                                              Important! Always set this to NONE if you do not need detailed debug logging. Active debug logging will severely degrade service performance and potentially saturate disk space in a very short time. Debug logging includes detailed information for each request and response.

                                                              It's recommended to set Log Level to DEBUG and Debug Level to NONE. These settings mean that you will not fill up your hard disk with debug logging, but you will be able to use the Toggle Debug Logging action to control debug output. This action can turn debug logging on and off on the fly, and is useful for debugging busy production servers.

                                                              See Also

                                                              Log Level, Toggle Debug Logging

                                                              Rolling Size (bytes)

                                                              Description

                                                              Specifies when the current log file needs to be rolled over, also known as log rotation. When the file size is over the rollover limit, the active log file will be renamed to log_name.mm_dd_yyyy(.sequence) in the same directory and a new active log file will be created. The actual size of the rotated log file once it is created will sometimes be a little bigger than this size limit. Set to 0 to disable log rotation.

                                                              Syntax

                                                              Integer number

                                                              Tips

                                                              Append "K", "M", "G" to the number for kilo-, mega- and giga- bytes.

                                                              +

                                                              Keep Days

                                                              Description

                                                              Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                              Syntax

                                                              Integer number

                                                              Enable stderr Log

                                                              Description

                                                              Specifies whether to write to log when receiving stderr output from processes started by the server.

                                                              If enabled, stderr messages will be logged in the same directory as the server log with the fixed name "stderr.log". If disabled, all stderr output will be discarded.

                                                              Functions like PHP's error_log() which do not write directly to stderr (file handle 2) are not affected by this setting and will write to the file set in PHP ini directive 'error_log' or the server's "error.log" file with tag '[STDERR]' if that directive is not set.

                                                              Syntax

                                                              Select from radio box

                                                              Tips

                                                              Turn it on if you need to debug configured external applications: i.e. PHP, Ruby, Java, Python, Perl.

                                                              File Name

                                                              Description

                                                              The access log filename.

                                                              Syntax

                                                              Filename which can be an absolute path or a relative path to $SERVER_ROOT.

                                                              Tips

                                                              Put access log file on a separate disk.

                                                              Piped Logger

                                                              Description

                                                              Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

                                                              The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

                                                              The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's External App Set UID Mode settings and will never run on behalf of a privileged user.

                                                              LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

                                                              If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

                                                              Syntax

                                                              Select from drop down list

                                                              Log Format

                                                              Description

                                                              Specifies the log format for the access log. When log format is set, it will override the Log Headers setting.

                                                              Syntax

                                                              String. The syntax of log format is compatible with Apache 2.0's custom log format.

                                                              Example

                                                              Common Log Format (CLF)
                                                              "%h %l %u %t \"%r\" %>s %b"

                                                              Common Log Format with Virtual Host
                                                              "%v %h %l %u %t \"%r\" %>s %b"

                                                              NCSA extended/combined log format
                                                              "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                              Log cookie value of Foobar
                                                              "%{Foobar}C"

                                                              See Also

                                                              Log Headers

                                                              Log Headers

                                                              Description

                                                              Specifies whether to log HTTP request headers: Referer, UserAgent, and Host.

                                                              Syntax

                                                              Select from checkbox

                                                              Tips

                                                              Turn this off if you do not need these headers in the access log.

                                                              See Also

                                                              Log Format

                                                              -

                                                              Keep Days

                                                              Description

                                                              Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                              Syntax

                                                              Integer number

                                                              Compress Archive

                                                              Description

                                                              Specifies whether to compress rotated log files in order to save disk space.

                                                              Syntax

                                                              Select from radio box

                                                              Tips

                                                              Log files are highly compressible and this is recommended to reduce disk usage for old logs.

                                                              diff --git a/dist/docs/ServSecurity_Help.html b/dist/docs/ServSecurity_Help.html index 5cbc854f5..a97f18bfc 100644 --- a/dist/docs/ServSecurity_Help.html +++ b/dist/docs/ServSecurity_Help.html @@ -17,7 +17,7 @@

                                                              OpenLiteSpeed Web Server Users' Manual

                                                              -

                                                              Version 1.7  — Rev. 13

                                                              +

                                                              Version 1.7  — Rev. 17


                                                                diff --git a/dist/docs/ServTuning_Help.html b/dist/docs/ServTuning_Help.html index 4341f750f..a7616639b 100644 --- a/dist/docs/ServTuning_Help.html +++ b/dist/docs/ServTuning_Help.html @@ -17,7 +17,7 @@

                                                                OpenLiteSpeed Web Server Users' Manual

                                                                -

                                                                Version 1.7  — Rev. 13

                                                                +

                                                                Version 1.7  — Rev. 17


                                                                  @@ -119,10 +119,10 @@

                                                                  Server Tuning

                                                                  Table of Contents

                                                                  Keep-Alive Timeout (secs)

                                                                  Description

                                                                  Specifies the maximum idle time between requests from a keep-alive connection. If no new request is received during this period of time, the connection will be closed. This setting only applies to HTTP/1.1 connections. HTTP/2 connections have long keep-alive timeouts by design and are not affected by this setting.

                                                                  Syntax

                                                                  Integer number

                                                                  Tips

                                                                  We recommend that you set this value just long enough to wait for subsequent requests from a client when there are more assets referenced by a single page that need to be loaded. Do not set this too long hoping that the next page will be served over the keep-alive connection. Keeping many idle keep-alive connections is a waste of server resources and could be taken advantage of by (D)DoS attacks. 2-5 seconds is a reasonable range for most applications. LiteSpeed is highly efficient in a non-keep-alive environment.

                                                                Send Buffer Size (bytes)

                                                                Description

                                                                The sending buffer size of each TCP socket. 512K is the maximum allowed buffer size.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                It is recommended to leave this value as "Not Set" or set to 0 to use the operating system's default buffer size.
                                                                If your web site serves large static files, increase the send buffer size to improve performance.
                                                                Setting this to a lower value will reduce throughput and memory usage per socket allowing the server to have more concurrent sockets when memory is a bottleneck.

                                                                Receive Buffer Size (bytes)

                                                                Description

                                                                The receiving buffer size of each TCP socket. 512K is the maximum allowed buffer size.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                It is recommended to leave this value as "Not Set" or set to 0 to use the operating system's default buffer size.
                                                                A large receive buffer will increase performance when processing incoming requests with large payloads, i.e. file uploads.
                                                                Setting this to a lower value will reduce throughput and memory usage per socket allowing the server to have more concurrent sockets when memory is a bottleneck.

                                                                -

                                                                Max Request URL Length (bytes)

                                                                Description

                                                                Specifies the maximum size of a request URL. URL is the full text address used to access a server resource including the query string. 64K bytes is the hard limit.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to reduce memory usage and help identify bogus requests and DoS attacks.
                                                                2-3K is big enough for most web sites unless the HTTP GET method is used with large query strings instead of POST.

                                                                -

                                                                Max Request Header Size (bytes)

                                                                Description

                                                                Specifies the maximum size of an HTTP request header including request URL. Hard limit is 16380 bytes.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to reduce memory usage and help identify bogus requests and DoS attacks.
                                                                4-8K is big enough for most web sites.

                                                                +

                                                                Max Request URL Length (bytes)

                                                                Description

                                                                Specifies the maximum size of a request URL. URL is the full text address used to access a server resource including the query string. Hard limit is 65530 bytes. Values larger than this, such as 64K (6 bytes larger), will be treated as if 65530 was used.

                                                                Default value: 8192 or 8K.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to reduce memory usage and help identify bogus requests and DoS attacks.
                                                                2-3K is big enough for most web sites unless the HTTP GET method is used with large query strings instead of POST.

                                                                +

                                                                Max Request Header Size (bytes)

                                                                Description

                                                                Specifies the maximum size of an HTTP request header including request URL. Hard limit is 131072 bytes or 128K.

                                                                Default value: 32768 or 32K

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to reduce memory usage and help identify bogus requests and DoS attacks.
                                                                4-8K is big enough for most web sites under normal circumstances.

                                                                Max Request Body Size (bytes)

                                                                Description

                                                                Specifies the maximum size of an HTTP request body. For a 32Bit OS, 2GB is the hard limit. For a 64Bit OS, it is virtually unlimited.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                To help prevent DoS attacks, try to constrain this limit to only what is really needed. Your swapping space must have enough free space to accommodate this limit.

                                                                -

                                                                Max Dynamic Response Header Size (bytes)

                                                                Description

                                                                Specifies the maximum header size of a dynamically generated response. Hard limit is 64K.

                                                                Default value: 16K

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to help recognize bad responses dynamically generated by external applications.

                                                                +

                                                                Max Dynamic Response Header Size (bytes)

                                                                Description

                                                                Specifies the maximum header size of a dynamically generated response. Hard limit is 131072 bytes or 128K.

                                                                Default value: 32768 or 32K

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set it reasonably low to help recognize bad responses dynamically generated by external applications.

                                                                Max Dynamic Response Body Size (bytes)

                                                                Description

                                                                Specifies the maximum body size of a dynamically generated response. Hard limit is 2047MB.

                                                                Syntax

                                                                Integer number

                                                                Tips

                                                                Set the limit reasonably low to help identify bad responses. It is not uncommon to malformed scripts to contain an infinite loop which leads to infinity-sized responses.

                                                                Max Cached Small File Size (bytes)

                                                                Description

                                                                Specifies the largest static file that will be cached in a pre-allocated memory buffer. Static files can be served in four different ways: memory buffer cache, memory-mapped cache, plain read/write, and sendfile(). Files whose size is smaller than this setting are served from memory buffer cache. Files whose size is larger than this setting, but smaller than the Max MMAP File Size (bytes) will be served from memory-mapped cache. Files whose size is larger than the Max MMAP File Size (bytes) will be served via plain read/write or sendfile(). It is optimal to serve static files smaller than 4K from the memory buffer cache.

                                                                Syntax

                                                                Integer number

                                                                Total Small File Cache Size (bytes)

                                                                Description

                                                                Specifies the total memory that can be allocated to the buffer cache in order to cache/serve small static files.

                                                                Syntax

                                                                Integer number

                                                                diff --git a/dist/docs/ServerStat_Help.html b/dist/docs/ServerStat_Help.html index 24d7d743d..046326029 100644 --- a/dist/docs/ServerStat_Help.html +++ b/dist/docs/ServerStat_Help.html @@ -17,7 +17,7 @@

                                                                OpenLiteSpeed Web Server Users' Manual

                                                                -

                                                                Version 1.7  — Rev. 13

                                                                +

                                                                Version 1.7  — Rev. 17


                                                                  diff --git a/dist/docs/Servlet_Context.html b/dist/docs/Servlet_Context.html index 7bbf2e6e7..5d692ca20 100644 --- a/dist/docs/Servlet_Context.html +++ b/dist/docs/Servlet_Context.html @@ -17,7 +17,7 @@

                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                  -

                                                                  Version 1.7  — Rev. 13

                                                                  +

                                                                  Version 1.7  — Rev. 17


                                                                    diff --git a/dist/docs/Static_Context.html b/dist/docs/Static_Context.html index f4583ec98..ab4d3ba07 100644 --- a/dist/docs/Static_Context.html +++ b/dist/docs/Static_Context.html @@ -17,7 +17,7 @@

                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                    -

                                                                    Version 1.7  — Rev. 13

                                                                    +

                                                                    Version 1.7  — Rev. 17


                                                                      diff --git a/dist/docs/Templates_Help.html b/dist/docs/Templates_Help.html index 19c1b33fe..0fde520fa 100644 --- a/dist/docs/Templates_Help.html +++ b/dist/docs/Templates_Help.html @@ -17,7 +17,7 @@

                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                      -

                                                                      Version 1.7  — Rev. 13

                                                                      +

                                                                      Version 1.7  — Rev. 17


                                                                        diff --git a/dist/docs/VHGeneral_Help.html b/dist/docs/VHGeneral_Help.html index 6528cc0ce..2e406a608 100644 --- a/dist/docs/VHGeneral_Help.html +++ b/dist/docs/VHGeneral_Help.html @@ -17,7 +17,7 @@

                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                        -

                                                                        Version 1.7  — Rev. 13

                                                                        +

                                                                        Version 1.7  — Rev. 17


                                                                        Log Level

                                                                        Description

                                                                        Specifies the level of logging. Available levels (from high to low) are ERROR, WARNING, NOTICE, INFO, and DEBUG. Only messages with a level higher than or equal to the current setting will be logged. If you want to set it to DEBUG, you must set the server log level to DEBUG as well. The level of debugging is controlled solely at the server level by Debug Level.

                                                                        Syntax

                                                                        Select from drop down list

                                                                        Tips

                                                                        Unless Debug Level is set to a level other than NONE, DEBUG log level does not have any performance impact and is recommended.

                                                                        See Also

                                                                        Debug Level

                                                                        Rolling Size (bytes)

                                                                        Description

                                                                        Specifies when the current log file needs to be rolled over, also known as log rotation. When the file size is over the rollover limit, the active log file will be renamed to log_name.mm_dd_yyyy(.sequence) in the same directory and a new active log file will be created. The actual size of the rotated log file once it is created will sometimes be a little bigger than this size limit. Set to 0 to disable log rotation.

                                                                        Syntax

                                                                        Integer number

                                                                        Tips

                                                                        Append "K", "M", "G" to the number for kilo-, mega- and giga- bytes.

                                                                        +

                                                                        Keep Days

                                                                        Description

                                                                        Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                        Syntax

                                                                        Integer number

                                                                        Log Control

                                                                        Description

                                                                        Where the access log should be written. There are three options:

                                                                        1. Write to the server's access log
                                                                        2. Create an access log for this virtual host
                                                                        3. Disable access logging

                                                                        Syntax

                                                                        Select from drop down list

                                                                        File Name

                                                                        Description

                                                                        The access log filename.

                                                                        Syntax

                                                                        Filename which can be an absolute path or a relative path to $SERVER_ROOT, $VH_ROOT.

                                                                        Tips

                                                                        Put access log file on a separate disk.

                                                                        Piped Logger

                                                                        Description

                                                                        Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

                                                                        The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

                                                                        The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's External App Set UID Mode settings and will never run on behalf of a privileged user.

                                                                        LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

                                                                        If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

                                                                        Syntax

                                                                        Select from drop down list

                                                                        Log Format

                                                                        Description

                                                                        Specifies the log format for the access log. When log format is set, it will override the Log Headers setting.

                                                                        Syntax

                                                                        String. The syntax of log format is compatible with Apache 2.0's custom log format.

                                                                        Example

                                                                        Common Log Format (CLF)
                                                                        "%h %l %u %t \"%r\" %>s %b"

                                                                        Common Log Format with Virtual Host
                                                                        "%v %h %l %u %t \"%r\" %>s %b"

                                                                        NCSA extended/combined log format
                                                                        "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                        Log cookie value of Foobar
                                                                        "%{Foobar}C"

                                                                        See Also

                                                                        Log Headers

                                                                        Log Headers

                                                                        Description

                                                                        Specifies whether to log HTTP request headers: Referer, UserAgent, and Host.

                                                                        Syntax

                                                                        Select from checkbox

                                                                        Tips

                                                                        Turn this off if you do not need these headers in the access log.

                                                                        See Also

                                                                        Log Format

                                                                        -

                                                                        Keep Days

                                                                        Description

                                                                        Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                        Syntax

                                                                        Integer number

                                                                        Bytes Log

                                                                        Description

                                                                        Specifies the path to the bandwidth bytes log file. When specified, a cPanel compatible bandwidth log will be created. This will log the total bytes transferred for a request including both the request and reply bodies.

                                                                        Syntax

                                                                        Filename which can be an absolute path or a relative path to $SERVER_ROOT.

                                                                        Tips

                                                                        Put the log file on a separate disk.

                                                                        Compress Archive

                                                                        Description

                                                                        Specifies whether to compress rotated log files in order to save disk space.

                                                                        Syntax

                                                                        Select from radio box

                                                                        Tips

                                                                        Log files are highly compressible and this is recommended to reduce disk usage for old logs.

                                                                        Use Server Index Files

                                                                        Description

                                                                        Specifies whether to use the server's index file settings. If set to Yes, only the server's settings will be used. If set to No, the server's settings will not be used. If set to Addition, additional index files can be added to server's index file list for this virtual host. If you want to disable index files for this virtual host, you can set the value to No and leave the index files field empty.

                                                                        Syntax

                                                                        Select from drop down list

                                                                        diff --git a/dist/docs/VHSSL_Help.html b/dist/docs/VHSSL_Help.html index 458510d0c..97a2701da 100644 --- a/dist/docs/VHSSL_Help.html +++ b/dist/docs/VHSSL_Help.html @@ -17,7 +17,7 @@

                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                        -

                                                                        Version 1.7  — Rev. 13

                                                                        +

                                                                        Version 1.7  — Rev. 17


                                                                          diff --git a/dist/docs/VHSecurity_Help.html b/dist/docs/VHSecurity_Help.html index 28bd3dfc2..7b6ae7e2c 100644 --- a/dist/docs/VHSecurity_Help.html +++ b/dist/docs/VHSecurity_Help.html @@ -17,7 +17,7 @@

                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                          -

                                                                          Version 1.7  — Rev. 13

                                                                          +

                                                                          Version 1.7  — Rev. 17


                                                                            diff --git a/dist/docs/VHWebSocket_Help.html b/dist/docs/VHWebSocket_Help.html index a47d11564..32e8f485e 100644 --- a/dist/docs/VHWebSocket_Help.html +++ b/dist/docs/VHWebSocket_Help.html @@ -17,7 +17,7 @@

                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                            -

                                                                            Version 1.7  — Rev. 13

                                                                            +

                                                                            Version 1.7  — Rev. 17


                                                                              diff --git a/dist/docs/VirtualHosts_Help.html b/dist/docs/VirtualHosts_Help.html index d1f5c197a..c534ba67b 100644 --- a/dist/docs/VirtualHosts_Help.html +++ b/dist/docs/VirtualHosts_Help.html @@ -17,7 +17,7 @@

                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                              -

                                                                              Version 1.7  — Rev. 13

                                                                              +

                                                                              Version 1.7  — Rev. 17


                                                                                diff --git a/dist/docs/admin.html b/dist/docs/admin.html index 27bbcf597..c209437ee 100644 --- a/dist/docs/admin.html +++ b/dist/docs/admin.html @@ -17,7 +17,7 @@

                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                -

                                                                                Version 1.7  — Rev. 13

                                                                                +

                                                                                Version 1.7  — Rev. 17


                                                                                  diff --git a/dist/docs/config.html b/dist/docs/config.html index 8e5bf75fb..37118839d 100644 --- a/dist/docs/config.html +++ b/dist/docs/config.html @@ -17,7 +17,7 @@

                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                  -

                                                                                  Version 1.7  — Rev. 13

                                                                                  +

                                                                                  Version 1.7  — Rev. 17


                                                                                    diff --git a/dist/docs/index.html b/dist/docs/index.html index df2e122e9..defbf021c 100644 --- a/dist/docs/index.html +++ b/dist/docs/index.html @@ -17,7 +17,7 @@

                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                    -

                                                                                    Version 1.7  — Rev. 13

                                                                                    +

                                                                                    Version 1.7  — Rev. 17


                                                                                      @@ -102,7 +102,7 @@



                                                                                      Users' Manual

                                                                                      - — Rev. 13 + — Rev. 17


                                                                                      diff --git a/dist/docs/install.html b/dist/docs/install.html index b37495b68..5bb7275ab 100644 --- a/dist/docs/install.html +++ b/dist/docs/install.html @@ -17,7 +17,7 @@

                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                      -

                                                                                      Version 1.7  — Rev. 13

                                                                                      +

                                                                                      Version 1.7  — Rev. 17


                                                                                        diff --git a/dist/docs/intro.html b/dist/docs/intro.html index 25c6c2e7d..0669d8015 100644 --- a/dist/docs/intro.html +++ b/dist/docs/intro.html @@ -17,7 +17,7 @@

                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                        -

                                                                                        Version 1.7  — Rev. 13

                                                                                        +

                                                                                        Version 1.7  — Rev. 17


                                                                                          diff --git a/dist/docs/ja-JP/AdminGeneral_Help.html b/dist/docs/ja-JP/AdminGeneral_Help.html index 59d83e83e..5094a4269 100644 --- a/dist/docs/ja-JP/AdminGeneral_Help.html +++ b/dist/docs/ja-JP/AdminGeneral_Help.html @@ -86,9 +86,9 @@

                                                                                          管理コンソールの一般

                                                                                          目次

                                                                                          一般

                                                                                          コアダンプを有効にする | セッションタイムアウト(秒)

                                                                                          バーチャルホストログ

                                                                                          -サーバーのログを使用する | File Name | ログレベル | ローテーションサイズ(バイト)

                                                                                          +サーバーのログを使用する | File Name | ログレベル | ローテーションサイズ(バイト) | Keep Days

                                                                                          アクセスログ

                                                                                          -ログ制御 | ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | 保持日数 | バイトログ | アーカイブを圧縮する

                                                                                          +ログ制御 | ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | Keep Days | バイトログ | アーカイブを圧縮する

                                                                                          コアダンプを有効にする

                                                                                          説明

                                                                                          サーバーが「root」ユーザーによって開始されたときにコア・ダンプを使用可能にするかどうかを指定します。 最新のUnixシステムでは、セキュリティ上の理由から、ユーザーIDまたはグループIDを変更するプロセスはコアファイルをダンプできません。 ただし、コアダンプを持つ問題の根本原因を特定する方がはるかに簡単です。 このオプションは、Linuxカーネル2.4以上でのみ動作します。 Solarisユーザーは coreadm コマンドを使用してこの機能を制御する必要があります。

                                                                                          構文

                                                                                          ラジオボックスから選択

                                                                                          ヒント

                                                                                          [セキュリティ]サーバログファイルにコアファイルが作成されていないと表示されている場合にのみ有効にします。 コアファイルを生成した直後に無効にしてください。 コアダンプが作成されたときにバグレポートを提出してください。

                                                                                          セッションタイムアウト(秒)

                                                                                          説明

                                                                                          WebAdmin Consoleのセッションタイムアウトの長さをカスタマイズします。 デフォルトは60秒です。

                                                                                          構文

                                                                                          整数

                                                                                          ヒント

                                                                                          [セキュリティ]プロダクション使用に適切な値を設定します。通常は300秒未満です。

                                                                                          @@ -96,12 +96,12 @@

                                                                                          目次

                                                                                          File Name

                                                                                          説明

                                                                                          ログファイルのパスを指定します。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOT、$VH_ROOTからの相対パス。

                                                                                          ヒント

                                                                                          [パフォーマンス]ログファイルを別のディスクに配置します。

                                                                                          ログレベル

                                                                                          説明

                                                                                          ロギングのレベルを指定します。 使用可能なレベルは、ERRORWARNINGNOTICEINFODEBUGです。 現在の設定以上のレベルのメッセージのみが記録されます。 DEBUGに設定する場合は、サーバログレベルをDEBUGに設定する必要があります。 デバッグのレベルは、デバッグレベルによってサーバーレベルでのみ制御されます。

                                                                                          構文

                                                                                          選択

                                                                                          ヒント

                                                                                          [パフォーマンス] デバッグレベルNONE以外のレベルに設定されていない限り、DEBUGログレベルはパフォーマンスに影響を及ぼさず、推奨されます。

                                                                                          参照

                                                                                          デバッグレベル

                                                                                          ローテーションサイズ(バイト)

                                                                                          説明

                                                                                          現在のログファイルをロールオーバーする必要があるとき、つまりログローテーションを指定します。 ファイルサイズがロールオーバー制限を超えると、アクティブなログファイルは同じディレクトリにlog_name.mm_dd_yyyy(.sequence)という名前に変更され、新しいアクティブなログファイルが作成されます。 回転ログファイルが実際に作成されると、そのサイズはこのサイズ制限より少し大きくなることがあります。 ログのローテーションを無効にするには、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          ヒント

                                                                                          キロ、メガ、ギガバイトの数字に「K」、「M」、「G」を追加します。

                                                                                          +

                                                                                          Keep Days

                                                                                          説明

                                                                                          Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                          構文

                                                                                          整数

                                                                                          ログ制御

                                                                                          説明

                                                                                          アクセスログを書き込むべき場所。 3つのオプションがあります:

                                                                                          1. サーバのアクセスログに書き込む
                                                                                          2. このバーチャルホストのアクセスログを作成する
                                                                                          3. アクセスログを無効にする

                                                                                          構文

                                                                                          選択

                                                                                          ファイル名

                                                                                          説明

                                                                                          アクセスログファイル名。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOT、$VH_ROOTからの相対パス。

                                                                                          ヒント

                                                                                          [パフォーマンス]アクセスログファイルを別のディスクに配置します。

                                                                                          パイプロガー

                                                                                          説明

                                                                                          LiteSpeedがSTDINストリーム上のパイプを通じて送信するアクセスログデータを受け取る外部アプリケーションを指定します(ファイルハンドルは0)。 このフィールドが指定されると、アクセスログはロガーアプリケーションにのみ送信され、前のエントリで指定されたアクセスログファイルには送信されません。

                                                                                          ロガーアプリケーションは、最初に外部アプリケーションセクションで定義する必要があります。 サーバー・レベルのアクセス・ロギングは、サーバー・レベルで定義された外部ロガー・アプリケーションのみを使用できます。 バーチャルホストレベルのアクセスロギングでは、バーチャルホストレベルで定義されたロガーアプリケーションのみを使用できます。

                                                                                          ロガープロセスは、他の外部(CGI/FastCGI/LSAPI)プロセスと同じ方法で生成されます。 つまり、バーチャルホストの外部アプリ Set UID モード設定で指定されたユーザーIDとして実行され、特権ユーザーのために実行されることはありません。.

                                                                                          LiteSpeed Webサーバーは、複数のロガーアプリケーションのインスタンスが設定されている場合、複数のロガーアプリケーション間で簡単なロードバランシングを実行します。 LiteSpeedサーバーは、常にロガーアプリケーションの数を可能な限り低く抑えようとします。 1つのロガーアプリケーションがアクセスログエントリを時間内に処理できない場合にのみ、サーバーはロガーアプリケーションの別のインスタンスを生成しようとします。

                                                                                          ロガーがクラッシュした場合、Webサーバーは別のインスタンスを開始しますが、ストリームバッファーのログデータは失われます。 外部ロガーがログ・ストリームの速度と量に追いつけない場合、ログ・データを失う可能性があります。

                                                                                          構文

                                                                                          選択

                                                                                          Log Format

                                                                                          説明

                                                                                          アクセスログのログ形式を指定します。 ログフォーマットが設定されると、ログヘッダーの設定より優先されます。

                                                                                          構文

                                                                                          文字列。ログフォーマットの構文はApache 2.0のカスタムと互換性があります log format


                                                                                          共通ログフォーマット(CLF)
                                                                                          "%h %l %u %t \"%r\" %>s %b"

                                                                                          バーチャルホストによる共通ログフォーマット
                                                                                          "%v %h %l %u %t \"%r\" %>s %b"

                                                                                          NCSA拡張/結合ログフォーマット
                                                                                          "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                          FoobarのログCookie値
                                                                                          "%{Foobar}C"

                                                                                          参照

                                                                                          ログヘッダー

                                                                                          ログヘッダー

                                                                                          説明

                                                                                          RefererUserAgentHostのいずれかをHTTPリクエストヘッダとして記録するかどうかを指定します。

                                                                                          構文

                                                                                          チェックボックス

                                                                                          ヒント

                                                                                          [パフォーマンス]これらのヘッダーがアクセスログに必要ない場合は、これをオフにします。

                                                                                          参照

                                                                                          Log Format

                                                                                          -

                                                                                          保持日数

                                                                                          説明

                                                                                          アクセスログファイルをディスクに保管する日数を指定します。 指定した日数より古いローテーションしたログファイルのみが削除されます。 現在のログファイルには、それに含まれるデータの日数にかかわらず、表示されません。 古いログファイルを自動削除しない場合は、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          バイトログ

                                                                                          説明

                                                                                          帯域幅バイトのログファイルへのパスを指定します。 指定すると、cPanel互換の帯域幅ログが作成されます。 これにより、要求と応答本体の両方を含む要求に対して転送された合計バイトが記録されます。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOTからの相対パス

                                                                                          ヒント

                                                                                          [パフォーマンス]ログファイルを別のディスクに配置します。

                                                                                          アーカイブを圧縮する

                                                                                          説明

                                                                                          ディスク領域を節約するためにローテーションしたログファイルを圧縮するかどうかを指定します。

                                                                                          構文

                                                                                          ラジオボックスから選択

                                                                                          ヒント

                                                                                          ログファイルは圧縮率が高く、古いログのディスク使用量を減らすために推奨されます。

                                                                                          diff --git a/dist/docs/ja-JP/ServLog_Help.html b/dist/docs/ja-JP/ServLog_Help.html index aa5a5306b..f0a6cfc17 100644 --- a/dist/docs/ja-JP/ServLog_Help.html +++ b/dist/docs/ja-JP/ServLog_Help.html @@ -82,20 +82,20 @@
                                                                                          Version 1.4  — Rev. 3

                                                                                          サーバーログ

                                                                                          目次

                                                                                          サーバーログ

                                                                                          -ファイル名 | ログレベル | デバッグレベル | ローテーションサイズ(バイト) | stderrログを有効にする

                                                                                          +ファイル名 | ログレベル | デバッグレベル | ローテーションサイズ(バイト) | Keep Days | stderrログを有効にする

                                                                                          アクセスログ

                                                                                          -ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | 保持日数 | アーカイブを圧縮する

                                                                                          +ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | Keep Days | アーカイブを圧縮する

                                                                                          ファイル名

                                                                                          説明

                                                                                          ログファイルのパスを指定します。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOTからの相対パス

                                                                                          ヒント

                                                                                          [パフォーマンス]ログファイルを別のディスクに配置します。

                                                                                          ログレベル

                                                                                          説明

                                                                                          ログファイルに含めるログのレベルを指定します。 使用可能なレベルは、エラー警告通知情報および DEBUG です。 現在の設定以上のレベルのメッセージのみが記録されます。

                                                                                          構文

                                                                                          選択

                                                                                          ヒント

                                                                                          [パフォーマンス] デバッグレベル NONE 以外のレベルに設定されていない限り、 DEBUG ログレベルを使用してもパフォーマンスに影響はありません。 ログレベルを DEBUG に設定し、デバッグレベルを NONE に設定することをお勧めします。 これらの設定は、ハードディスクにデバッグログを書き込まないことを意味しますが、デバッグログを切り替えるアクションを使用してデバッグ出力を制御することができます。 これにより、デバッグログのオン/オフを切り替えることができ、多忙な運用サーバーのデバッグに役立ちます。

                                                                                          参照

                                                                                          デバッグレベル

                                                                                          デバッグレベル

                                                                                          説明

                                                                                          デバッグログのレベルを指定します。 この機能を使用するには、ログレベル DEBUG に設定する必要があります。 ログレベル DEBUG に設定されていても、「デバッグレベル」が NONE に設定されていると、デバッグロギングは無効になります。 デバッグログを切り替えるは、再起動せずにライブサーバー上のデバッグレベルを制御するために使用できます。.

                                                                                          構文

                                                                                          選択

                                                                                          ヒント

                                                                                          [パフォーマンス]重要! 詳細なデバッグログが必要ない場合は、常にこれを NONE に設定してください。 アクティブデバッグロギングは、サービスのパフォーマンスを著しく低下させ、非常に短時間でディスクスペースを飽和させる可能性があります。 デバッグログには、各要求と応答の詳細情報が含まれています。
                                                                                          ログレベルを DEBUG に設定し、デバッグレベルを NONE に設定することをお勧めします。 これらの設定は、ハードディスクにデバッグログを書き込まないことを意味しますが、デバッグログを切り替えるアクションを使用してデバッグ出力を制御することができます。 これにより、デバッグログのオン/オフを切り替えることができ、多忙な運用サーバーのデバッグに役立ちます。

                                                                                          参照

                                                                                          ログレベル, デバッグログを切り替える

                                                                                          ローテーションサイズ(バイト)

                                                                                          説明

                                                                                          現在のログファイルをロールオーバーする必要があるとき、つまりログローテーションを指定します。 ファイルサイズがロールオーバー制限を超えると、アクティブなログファイルは同じディレクトリにlog_name.mm_dd_yyyy(.sequence)という名前に変更され、新しいアクティブなログファイルが作成されます。 回転ログファイルが実際に作成されると、そのサイズはこのサイズ制限より少し大きくなることがあります。 ログのローテーションを無効にするには、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          ヒント

                                                                                          キロ、メガ、ギガバイトの数字に「K」、「M」、「G」を追加します。

                                                                                          +

                                                                                          Keep Days

                                                                                          説明

                                                                                          Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                          構文

                                                                                          整数

                                                                                          stderrログを有効にする

                                                                                          説明

                                                                                          サーバーが開始したプロセスからstderr出力を受け取ったときにログに書き込むかどうかを指定します。 有効にすると、stderrメッセージは固定名 "stderr.log"を持つサーバーログと同じディレクトリに記録されます。 無効にすると、すべてのstderr出力は破棄されます。

                                                                                          構文

                                                                                          ラジオボックスから選択

                                                                                          ヒント

                                                                                          設定された外部アプリケーション(PHP、Ruby、Java、Python、Perl)をデバッグする必要がある場合にオンにします。

                                                                                          ファイル名

                                                                                          説明

                                                                                          アクセスログファイル名。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOTからの相対パス

                                                                                          ヒント

                                                                                          [パフォーマンス]アクセスログファイルを別のディスクに入れます。

                                                                                          パイプロガー

                                                                                          説明

                                                                                          LiteSpeedがSTDINストリーム上のパイプを通じて送信するアクセスログデータを受け取る外部アプリケーションを指定します(ファイルハンドルは0)。 このフィールドが指定されると、アクセスログはロガーアプリケーションにのみ送信され、前のエントリで指定されたアクセスログファイルには送信されません。

                                                                                          ロガーアプリケーションは、最初に外部アプリケーションセクションで定義する必要があります。 サーバー・レベルのアクセス・ロギングは、サーバー・レベルで定義された外部ロガー・アプリケーションのみを使用できます。 バーチャルホストレベルのアクセスロギングでは、バーチャルホストレベルで定義されたロガーアプリケーションのみを使用できます。

                                                                                          ロガープロセスは、他の外部(CGI/FastCGI/LSAPI)プロセスと同じ方法で生成されます。 つまり、バーチャルホストの外部アプリ Set UID モード設定で指定されたユーザーIDとして実行され、特権ユーザーのために実行されることはありません。.

                                                                                          LiteSpeed Webサーバーは、複数のロガーアプリケーションのインスタンスが設定されている場合、複数のロガーアプリケーション間で簡単なロードバランシングを実行します。 LiteSpeedサーバーは、常にロガーアプリケーションの数を可能な限り低く抑えようとします。 1つのロガーアプリケーションがアクセスログエントリを時間内に処理できない場合にのみ、サーバーはロガーアプリケーションの別のインスタンスを生成しようとします。

                                                                                          ロガーがクラッシュした場合、Webサーバーは別のインスタンスを開始しますが、ストリームバッファーのログデータは失われます。 外部ロガーがログ・ストリームの速度と量に追いつけない場合、ログ・データを失う可能性があります。

                                                                                          構文

                                                                                          選択

                                                                                          Log Format

                                                                                          説明

                                                                                          アクセスログのログ形式を指定します。 ログフォーマットが設定されると、ログヘッダーの設定より優先されます。

                                                                                          構文

                                                                                          文字列。ログフォーマットの構文はApache 2.0のカスタムと互換性があります log format


                                                                                          共通ログフォーマット(CLF)
                                                                                          "%h %l %u %t \"%r\" %>s %b"

                                                                                          バーチャルホストによる共通ログフォーマット
                                                                                          "%v %h %l %u %t \"%r\" %>s %b"

                                                                                          NCSA拡張/結合ログフォーマット
                                                                                          "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                          FoobarのログCookie値
                                                                                          "%{Foobar}C"

                                                                                          参照

                                                                                          ログヘッダー

                                                                                          ログヘッダー

                                                                                          説明

                                                                                          RefererUserAgentHostのいずれかをHTTPリクエストヘッダとして記録するかどうかを指定します。

                                                                                          構文

                                                                                          チェックボックス

                                                                                          ヒント

                                                                                          [パフォーマンス]これらのヘッダーがアクセスログに必要ない場合は、これをオフにします。

                                                                                          参照

                                                                                          Log Format

                                                                                          -

                                                                                          保持日数

                                                                                          説明

                                                                                          アクセスログファイルをディスクに保管する日数を指定します。 指定した日数より古いローテーションしたログファイルのみが削除されます。 現在のログファイルには、それに含まれるデータの日数にかかわらず、表示されません。 古いログファイルを自動削除しない場合は、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          アーカイブを圧縮する

                                                                                          説明

                                                                                          ディスク領域を節約するためにローテーションしたログファイルを圧縮するかどうかを指定します。

                                                                                          構文

                                                                                          ラジオボックスから選択

                                                                                          ヒント

                                                                                          ログファイルは圧縮率が高く、古いログのディスク使用量を減らすために推奨されます。

                                                                                          diff --git a/dist/docs/ja-JP/VHGeneral_Help.html b/dist/docs/ja-JP/VHGeneral_Help.html index 9df69f7aa..b9b8f648c 100644 --- a/dist/docs/ja-JP/VHGeneral_Help.html +++ b/dist/docs/ja-JP/VHGeneral_Help.html @@ -84,9 +84,9 @@
                                                                                          Version 1.4  — Rev. 3

                                                                                          バーチャルホストの一般

                                                                                          目次

                                                                                          一般

                                                                                          ドキュメントルート | 管理者用電子メール | GZIPを有効にする | IPジオロケーションを有効にする | cgroups

                                                                                          バーチャルホストログ

                                                                                          -サーバーのログを使用する | File Name | ログレベル | ローテーションサイズ(バイト)

                                                                                          +サーバーのログを使用する | File Name | ログレベル | ローテーションサイズ(バイト) | Keep Days

                                                                                          アクセスログ

                                                                                          -ログ制御 | ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | 保持日数 | バイトログ | アーカイブを圧縮する

                                                                                          +ログ制御 | ファイル名 | パイプロガー | Log Format | ログヘッダー | ローテーションサイズ(バイト) | Keep Days | バイトログ | アーカイブを圧縮する

                                                                                          インデックスファイル

                                                                                          サーバーインデックスファイルを使用する | インデックスファイル | 自動インデックス | 自動インデックス URI

                                                                                          カスタマイズされたエラーページ

                                                                                          @@ -111,12 +111,12 @@

                                                                                          バーチャルホストの一般

                                                                                          目次

                                                                                          File Name

                                                                                          説明

                                                                                          ログファイルのパスを指定します。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOT、$VH_ROOTからの相対パス。

                                                                                          ヒント

                                                                                          [パフォーマンス]ログファイルを別のディスクに配置します。

                                                                                          ログレベル

                                                                                          説明

                                                                                          ロギングのレベルを指定します。 使用可能なレベルは、ERRORWARNINGNOTICEINFODEBUGです。 現在の設定以上のレベルのメッセージのみが記録されます。 DEBUGに設定する場合は、サーバログレベルをDEBUGに設定する必要があります。 デバッグのレベルは、デバッグレベルによってサーバーレベルでのみ制御されます。

                                                                                          構文

                                                                                          選択

                                                                                          ヒント

                                                                                          [パフォーマンス] デバッグレベルNONE以外のレベルに設定されていない限り、DEBUGログレベルはパフォーマンスに影響を及ぼさず、推奨されます。

                                                                                          参照

                                                                                          デバッグレベル

                                                                                          ローテーションサイズ(バイト)

                                                                                          説明

                                                                                          現在のログファイルをロールオーバーする必要があるとき、つまりログローテーションを指定します。 ファイルサイズがロールオーバー制限を超えると、アクティブなログファイルは同じディレクトリにlog_name.mm_dd_yyyy(.sequence)という名前に変更され、新しいアクティブなログファイルが作成されます。 回転ログファイルが実際に作成されると、そのサイズはこのサイズ制限より少し大きくなることがあります。 ログのローテーションを無効にするには、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          ヒント

                                                                                          キロ、メガ、ギガバイトの数字に「K」、「M」、「G」を追加します。

                                                                                          +

                                                                                          Keep Days

                                                                                          説明

                                                                                          Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                          構文

                                                                                          整数

                                                                                          ログ制御

                                                                                          説明

                                                                                          アクセスログを書き込むべき場所。 3つのオプションがあります:

                                                                                          1. サーバのアクセスログに書き込む
                                                                                          2. このバーチャルホストのアクセスログを作成する
                                                                                          3. アクセスログを無効にする

                                                                                          構文

                                                                                          選択

                                                                                          ファイル名

                                                                                          説明

                                                                                          アクセスログファイル名。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOT、$VH_ROOTからの相対パス。

                                                                                          ヒント

                                                                                          [パフォーマンス]アクセスログファイルを別のディスクに配置します。

                                                                                          パイプロガー

                                                                                          説明

                                                                                          LiteSpeedがSTDINストリーム上のパイプを通じて送信するアクセスログデータを受け取る外部アプリケーションを指定します(ファイルハンドルは0)。 このフィールドが指定されると、アクセスログはロガーアプリケーションにのみ送信され、前のエントリで指定されたアクセスログファイルには送信されません。

                                                                                          ロガーアプリケーションは、最初に外部アプリケーションセクションで定義する必要があります。 サーバー・レベルのアクセス・ロギングは、サーバー・レベルで定義された外部ロガー・アプリケーションのみを使用できます。 バーチャルホストレベルのアクセスロギングでは、バーチャルホストレベルで定義されたロガーアプリケーションのみを使用できます。

                                                                                          ロガープロセスは、他の外部(CGI/FastCGI/LSAPI)プロセスと同じ方法で生成されます。 つまり、バーチャルホストの外部アプリ Set UID モード設定で指定されたユーザーIDとして実行され、特権ユーザーのために実行されることはありません。.

                                                                                          LiteSpeed Webサーバーは、複数のロガーアプリケーションのインスタンスが設定されている場合、複数のロガーアプリケーション間で簡単なロードバランシングを実行します。 LiteSpeedサーバーは、常にロガーアプリケーションの数を可能な限り低く抑えようとします。 1つのロガーアプリケーションがアクセスログエントリを時間内に処理できない場合にのみ、サーバーはロガーアプリケーションの別のインスタンスを生成しようとします。

                                                                                          ロガーがクラッシュした場合、Webサーバーは別のインスタンスを開始しますが、ストリームバッファーのログデータは失われます。 外部ロガーがログ・ストリームの速度と量に追いつけない場合、ログ・データを失う可能性があります。

                                                                                          構文

                                                                                          選択

                                                                                          Log Format

                                                                                          説明

                                                                                          アクセスログのログ形式を指定します。 ログフォーマットが設定されると、ログヘッダーの設定より優先されます。

                                                                                          構文

                                                                                          文字列。ログフォーマットの構文はApache 2.0のカスタムと互換性があります log format


                                                                                          共通ログフォーマット(CLF)
                                                                                          "%h %l %u %t \"%r\" %>s %b"

                                                                                          バーチャルホストによる共通ログフォーマット
                                                                                          "%v %h %l %u %t \"%r\" %>s %b"

                                                                                          NCSA拡張/結合ログフォーマット
                                                                                          "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                          FoobarのログCookie値
                                                                                          "%{Foobar}C"

                                                                                          参照

                                                                                          ログヘッダー

                                                                                          ログヘッダー

                                                                                          説明

                                                                                          RefererUserAgentHostのいずれかをHTTPリクエストヘッダとして記録するかどうかを指定します。

                                                                                          構文

                                                                                          チェックボックス

                                                                                          ヒント

                                                                                          [パフォーマンス]これらのヘッダーがアクセスログに必要ない場合は、これをオフにします。

                                                                                          参照

                                                                                          Log Format

                                                                                          -

                                                                                          保持日数

                                                                                          説明

                                                                                          アクセスログファイルをディスクに保管する日数を指定します。 指定した日数より古いローテーションしたログファイルのみが削除されます。 現在のログファイルには、それに含まれるデータの日数にかかわらず、表示されません。 古いログファイルを自動削除しない場合は、 0 に設定します。

                                                                                          構文

                                                                                          整数

                                                                                          バイトログ

                                                                                          説明

                                                                                          帯域幅バイトのログファイルへのパスを指定します。 指定すると、cPanel互換の帯域幅ログが作成されます。 これにより、要求と応答本体の両方を含む要求に対して転送された合計バイトが記録されます。

                                                                                          構文

                                                                                          ファイル名への絶対パス又は$SERVER_ROOTからの相対パス

                                                                                          ヒント

                                                                                          [パフォーマンス]ログファイルを別のディスクに配置します。

                                                                                          アーカイブを圧縮する

                                                                                          説明

                                                                                          ディスク領域を節約するためにローテーションしたログファイルを圧縮するかどうかを指定します。

                                                                                          構文

                                                                                          ラジオボックスから選択

                                                                                          ヒント

                                                                                          ログファイルは圧縮率が高く、古いログのディスク使用量を減らすために推奨されます。

                                                                                          サーバーインデックスファイルを使用する

                                                                                          説明

                                                                                          サーバーのインデックスファイル設定を使用するかどうかを指定します。 はいに設定すると、サーバーの設定だけが使用されます。 いいえに設定すると、サーバーの設定は使用されません。 追加に設定すると、このバーチャルホストのインデックスファイルリストに追加のインデックスファイルを追加できます。 このバーチャルホストのインデックスファイルを無効にする場合は、値をいいえに設定して、インデックスファイルのフィールドを空のままにします。

                                                                                          構文

                                                                                          選択

                                                                                          diff --git a/dist/docs/license.html b/dist/docs/license.html index 1b0e000ee..eb40bbf67 100644 --- a/dist/docs/license.html +++ b/dist/docs/license.html @@ -17,7 +17,7 @@

                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                          -

                                                                                          Version 1.7  — Rev. 13

                                                                                          +

                                                                                          Version 1.7  — Rev. 17


                                                                                            diff --git a/dist/docs/security.html b/dist/docs/security.html index 4e9e2cc16..bc3241d83 100644 --- a/dist/docs/security.html +++ b/dist/docs/security.html @@ -17,7 +17,7 @@

                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                            -

                                                                                            Version 1.7  — Rev. 13

                                                                                            +

                                                                                            Version 1.7  — Rev. 17


                                                                                              diff --git a/dist/docs/webconsole.html b/dist/docs/webconsole.html index b06a6a945..d17f1065d 100644 --- a/dist/docs/webconsole.html +++ b/dist/docs/webconsole.html @@ -17,7 +17,7 @@

                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                              -

                                                                                              Version 1.7  — Rev. 13

                                                                                              +

                                                                                              Version 1.7  — Rev. 17


                                                                                                diff --git a/dist/docs/zh-CN/AdminGeneral_Help.html b/dist/docs/zh-CN/AdminGeneral_Help.html index 86cb14c03..d74e940ae 100644 --- a/dist/docs/zh-CN/AdminGeneral_Help.html +++ b/dist/docs/zh-CN/AdminGeneral_Help.html @@ -17,7 +17,7 @@

                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                -

                                                                                                Version 1.7  — Rev. 13

                                                                                                +

                                                                                                Version 1.7  — Rev. 17


                                                                                                日志级别

                                                                                                Description

                                                                                                指定日志记录级别。可用级别(从高到低)为ERROR, WARNING, NOTICE, INFO, 和 DEBUG。 只有当消息等级高于或与当前设置相同时才被记录。 如果您希望将此设置为DEBUG,您也需要设置服务器日志级别为DEBUG。 调试的级别只能在服务器级别通过调试级别控制。

                                                                                                Syntax

                                                                                                选项

                                                                                                Tips

                                                                                                [性能建议] 除非调试级别设置为NONE以外的日志级别, 否则DEBUG级别不会对性能产生任何影响,推荐采用。

                                                                                                See Also

                                                                                                调试级别

                                                                                                回滚大小

                                                                                                Description

                                                                                                指定何时日志文件需要回滚,也称为日志循环。 当文件大小超过回滚限制后,在使用的日志文件将在同一目录中被重命名 为log_name.mm_dd_yyyy(.sequence),一个新的日志文件将被创建。 回滚的日志文件的实际大小有时会比限制值稍微大一些。 将值设置为0将禁用日志循环。

                                                                                                Syntax

                                                                                                无符号整数

                                                                                                Tips

                                                                                                请用“K”,“M”,“G”代表千字节,兆字节和千兆字节。

                                                                                                +

                                                                                                Keep Days

                                                                                                Description

                                                                                                Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                                Syntax

                                                                                                无符号整数

                                                                                                日志管理

                                                                                                Description

                                                                                                指定写入访问日志的地点。这里有三个选项: 1. 写入到服务器的访问日志; 2. 为虚拟主机创建一个访问日志; 3. 禁用访问日志记录。

                                                                                                Syntax

                                                                                                选项

                                                                                                File Name

                                                                                                Description

                                                                                                The access log filename.

                                                                                                Syntax

                                                                                                Filename which can be an absolute path or a relative path to $SERVER_ROOT, $VH_ROOT.

                                                                                                Tips

                                                                                                Put access log file on a separate disk.

                                                                                                Piped Logger

                                                                                                Description

                                                                                                Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

                                                                                                The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

                                                                                                The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's 外部应用程序设置UID模式 settings and will never run on behalf of a privileged user.

                                                                                                LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

                                                                                                If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

                                                                                                Syntax

                                                                                                Select from drop down list

                                                                                                日志格式

                                                                                                Description

                                                                                                指定访问日志的格式。 设置之后,它将覆盖记录头部 的设定。

                                                                                                Syntax

                                                                                                字符串。日志格式的语法与Apache 2.0自定义 日志格式兼容。

                                                                                                Example

                                                                                                一般日志格式(CLF)
                                                                                                "%h %l %u %t \"%r\" %>s %b"

                                                                                                支持虚拟主机的一般日志格式
                                                                                                "%v %h %l %u %t \"%r\" %>s %b"

                                                                                                NCSA扩展/组合日志格式
                                                                                                "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                                记录Foobar的cookie值
                                                                                                "%{Foobar}C"

                                                                                                See Also

                                                                                                记录头部

                                                                                                记录头部

                                                                                                Description

                                                                                                指定是否记录HTTP请求头: RefererUserAgentHost

                                                                                                Syntax

                                                                                                复选框

                                                                                                Tips

                                                                                                [性能建议] 如果你不需要在访问日志中记录这些头部信息,关闭这个功能。

                                                                                                See Also

                                                                                                日志格式

                                                                                                -

                                                                                                保留天数

                                                                                                Description

                                                                                                指定访问日志文件将被保存在磁盘上多少天。 只有超出指定天数的回滚日志文件会被删除。 当前的日志文件不会被删除,无论它包含了多少天的数据。 如果你不想自动删除过时的、很旧的日志文件, 将该值设置为0

                                                                                                Syntax

                                                                                                无符号整数

                                                                                                字节记录

                                                                                                Description

                                                                                                指定带宽字节日志文件的路径。设置后,将创建一份兼容cPanel面板的带宽日志。这将记录 一个请求传输的总字节数,包括请求内容和响应内容。

                                                                                                Syntax

                                                                                                文件2

                                                                                                Tips

                                                                                                [性能建议] 将日志文件放置在一个单独的磁盘上。

                                                                                                压缩存档

                                                                                                Description

                                                                                                指定是否压缩回滚日志以节省磁盘空间。

                                                                                                Syntax

                                                                                                布尔值

                                                                                                Tips

                                                                                                日志文件是高度可压缩的,建议采取压缩以减少旧日志的磁盘占用量。

                                                                                                diff --git a/dist/docs/zh-CN/AdminListeners_General_Help.html b/dist/docs/zh-CN/AdminListeners_General_Help.html index c6f35fcaf..5031907d4 100644 --- a/dist/docs/zh-CN/AdminListeners_General_Help.html +++ b/dist/docs/zh-CN/AdminListeners_General_Help.html @@ -17,7 +17,7 @@

                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                -

                                                                                                Version 1.7  — Rev. 13

                                                                                                +

                                                                                                Version 1.7  — Rev. 17


                                                                                                  diff --git a/dist/docs/zh-CN/AdminListeners_SSL_Help.html b/dist/docs/zh-CN/AdminListeners_SSL_Help.html index a2b12dab3..a97963fca 100644 --- a/dist/docs/zh-CN/AdminListeners_SSL_Help.html +++ b/dist/docs/zh-CN/AdminListeners_SSL_Help.html @@ -17,7 +17,7 @@

                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                  -

                                                                                                  Version 1.7  — Rev. 13

                                                                                                  +

                                                                                                  Version 1.7  — Rev. 17


                                                                                                    diff --git a/dist/docs/zh-CN/AdminSecurity_Help.html b/dist/docs/zh-CN/AdminSecurity_Help.html index 23a587d57..698717558 100644 --- a/dist/docs/zh-CN/AdminSecurity_Help.html +++ b/dist/docs/zh-CN/AdminSecurity_Help.html @@ -17,7 +17,7 @@

                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                    -

                                                                                                    Version 1.7  — Rev. 13

                                                                                                    +

                                                                                                    Version 1.7  — Rev. 17


                                                                                                      diff --git a/dist/docs/zh-CN/App_Server_Context.html b/dist/docs/zh-CN/App_Server_Context.html index 191ccdafe..47d1afda9 100644 --- a/dist/docs/zh-CN/App_Server_Context.html +++ b/dist/docs/zh-CN/App_Server_Context.html @@ -17,7 +17,7 @@

                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                      -

                                                                                                      Version 1.7  — Rev. 13

                                                                                                      +

                                                                                                      Version 1.7  — Rev. 17


                                                                                                        diff --git a/dist/docs/zh-CN/App_Server_Help.html b/dist/docs/zh-CN/App_Server_Help.html index aa56baaa9..8516562b9 100644 --- a/dist/docs/zh-CN/App_Server_Help.html +++ b/dist/docs/zh-CN/App_Server_Help.html @@ -17,7 +17,7 @@

                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                        -

                                                                                                        Version 1.7  — Rev. 13

                                                                                                        +

                                                                                                        Version 1.7  — Rev. 17


                                                                                                          diff --git a/dist/docs/zh-CN/CGI_Context.html b/dist/docs/zh-CN/CGI_Context.html index 657fdf25e..ca6e597c6 100644 --- a/dist/docs/zh-CN/CGI_Context.html +++ b/dist/docs/zh-CN/CGI_Context.html @@ -17,7 +17,7 @@

                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                          -

                                                                                                          Version 1.7  — Rev. 13

                                                                                                          +

                                                                                                          Version 1.7  — Rev. 17


                                                                                                            diff --git a/dist/docs/zh-CN/CompilePHP_Help.html b/dist/docs/zh-CN/CompilePHP_Help.html index 418b117d4..a6d301c01 100644 --- a/dist/docs/zh-CN/CompilePHP_Help.html +++ b/dist/docs/zh-CN/CompilePHP_Help.html @@ -17,7 +17,7 @@

                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                            -

                                                                                                            Version 1.7  — Rev. 13

                                                                                                            +

                                                                                                            Version 1.7  — Rev. 17


                                                                                                              diff --git a/dist/docs/zh-CN/Context_Help.html b/dist/docs/zh-CN/Context_Help.html index 02c0c88c9..a0c116e1b 100644 --- a/dist/docs/zh-CN/Context_Help.html +++ b/dist/docs/zh-CN/Context_Help.html @@ -17,7 +17,7 @@

                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                              -

                                                                                                              Version 1.7  — Rev. 13

                                                                                                              +

                                                                                                              Version 1.7  — Rev. 17


                                                                                                                diff --git a/dist/docs/zh-CN/ExtApp_Help.html b/dist/docs/zh-CN/ExtApp_Help.html index bf4fae6bf..df686291b 100644 --- a/dist/docs/zh-CN/ExtApp_Help.html +++ b/dist/docs/zh-CN/ExtApp_Help.html @@ -17,7 +17,7 @@

                                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                                -

                                                                                                                Version 1.7  — Rev. 13

                                                                                                                +

                                                                                                                Version 1.7  — Rev. 17


                                                                                                                  diff --git a/dist/docs/zh-CN/External_FCGI.html b/dist/docs/zh-CN/External_FCGI.html index 20f0313f5..2d303fc30 100644 --- a/dist/docs/zh-CN/External_FCGI.html +++ b/dist/docs/zh-CN/External_FCGI.html @@ -17,7 +17,7 @@

                                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                                  -

                                                                                                                  Version 1.7  — Rev. 13

                                                                                                                  +

                                                                                                                  Version 1.7  — Rev. 17


                                                                                                                    diff --git a/dist/docs/zh-CN/External_FCGI_Auth.html b/dist/docs/zh-CN/External_FCGI_Auth.html index e39b85c06..fa7f98e64 100644 --- a/dist/docs/zh-CN/External_FCGI_Auth.html +++ b/dist/docs/zh-CN/External_FCGI_Auth.html @@ -17,7 +17,7 @@

                                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                                    -

                                                                                                                    Version 1.7  — Rev. 13

                                                                                                                    +

                                                                                                                    Version 1.7  — Rev. 17


                                                                                                                      diff --git a/dist/docs/zh-CN/External_LB.html b/dist/docs/zh-CN/External_LB.html index 87a2382f6..9e264136e 100644 --- a/dist/docs/zh-CN/External_LB.html +++ b/dist/docs/zh-CN/External_LB.html @@ -17,7 +17,7 @@

                                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                                      -

                                                                                                                      Version 1.7  — Rev. 13

                                                                                                                      +

                                                                                                                      Version 1.7  — Rev. 17


                                                                                                                        diff --git a/dist/docs/zh-CN/External_LSAPI.html b/dist/docs/zh-CN/External_LSAPI.html index 225a0617b..bec77a0b8 100644 --- a/dist/docs/zh-CN/External_LSAPI.html +++ b/dist/docs/zh-CN/External_LSAPI.html @@ -17,7 +17,7 @@

                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                        -

                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                        +

                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                          diff --git a/dist/docs/zh-CN/External_PL.html b/dist/docs/zh-CN/External_PL.html index 7617c6edf..71fd7df0a 100644 --- a/dist/docs/zh-CN/External_PL.html +++ b/dist/docs/zh-CN/External_PL.html @@ -17,7 +17,7 @@

                                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                                          -

                                                                                                                          Version 1.7  — Rev. 13

                                                                                                                          +

                                                                                                                          Version 1.7  — Rev. 17


                                                                                                                            diff --git a/dist/docs/zh-CN/External_Servlet.html b/dist/docs/zh-CN/External_Servlet.html index d22c32aee..f2bec7a28 100644 --- a/dist/docs/zh-CN/External_Servlet.html +++ b/dist/docs/zh-CN/External_Servlet.html @@ -17,7 +17,7 @@

                                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                                            -

                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                            +

                                                                                                                            Version 1.7  — Rev. 17


                                                                                                                              diff --git a/dist/docs/zh-CN/External_WS.html b/dist/docs/zh-CN/External_WS.html index 6ff515f6e..448b05e0a 100644 --- a/dist/docs/zh-CN/External_WS.html +++ b/dist/docs/zh-CN/External_WS.html @@ -17,7 +17,7 @@

                                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                                              -

                                                                                                                              Version 1.7  — Rev. 13

                                                                                                                              +

                                                                                                                              Version 1.7  — Rev. 17


                                                                                                                                diff --git a/dist/docs/zh-CN/FCGI_Context.html b/dist/docs/zh-CN/FCGI_Context.html index c4af463a3..cc8c0c404 100644 --- a/dist/docs/zh-CN/FCGI_Context.html +++ b/dist/docs/zh-CN/FCGI_Context.html @@ -17,7 +17,7 @@

                                                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                                                -

                                                                                                                                Version 1.7  — Rev. 13

                                                                                                                                +

                                                                                                                                Version 1.7  — Rev. 17


                                                                                                                                  diff --git a/dist/docs/zh-CN/Java_Web_App_Context.html b/dist/docs/zh-CN/Java_Web_App_Context.html index 07670d374..989ffd37a 100644 --- a/dist/docs/zh-CN/Java_Web_App_Context.html +++ b/dist/docs/zh-CN/Java_Web_App_Context.html @@ -17,7 +17,7 @@

                                                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                                                  -

                                                                                                                                  Version 1.7  — Rev. 13

                                                                                                                                  +

                                                                                                                                  Version 1.7  — Rev. 17


                                                                                                                                    diff --git a/dist/docs/zh-CN/LB_Context.html b/dist/docs/zh-CN/LB_Context.html index de98efa99..7650cd5c8 100644 --- a/dist/docs/zh-CN/LB_Context.html +++ b/dist/docs/zh-CN/LB_Context.html @@ -17,7 +17,7 @@

                                                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                                                    -

                                                                                                                                    Version 1.7  — Rev. 13

                                                                                                                                    +

                                                                                                                                    Version 1.7  — Rev. 17


                                                                                                                                      diff --git a/dist/docs/zh-CN/LSAPI_Context.html b/dist/docs/zh-CN/LSAPI_Context.html index 46ea923fd..1375f7c01 100644 --- a/dist/docs/zh-CN/LSAPI_Context.html +++ b/dist/docs/zh-CN/LSAPI_Context.html @@ -17,7 +17,7 @@

                                                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                                                      -

                                                                                                                                      Version 1.7  — Rev. 13

                                                                                                                                      +

                                                                                                                                      Version 1.7  — Rev. 17


                                                                                                                                        diff --git a/dist/docs/zh-CN/Listeners_General_Help.html b/dist/docs/zh-CN/Listeners_General_Help.html index 950477a52..c9dff4a29 100644 --- a/dist/docs/zh-CN/Listeners_General_Help.html +++ b/dist/docs/zh-CN/Listeners_General_Help.html @@ -17,7 +17,7 @@

                                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                                        -

                                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                                        +

                                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                                          diff --git a/dist/docs/zh-CN/Listeners_SSL_Help.html b/dist/docs/zh-CN/Listeners_SSL_Help.html index 51e982732..0461304d2 100644 --- a/dist/docs/zh-CN/Listeners_SSL_Help.html +++ b/dist/docs/zh-CN/Listeners_SSL_Help.html @@ -17,7 +17,7 @@

                                                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                                                          -

                                                                                                                                          Version 1.7  — Rev. 13

                                                                                                                                          +

                                                                                                                                          Version 1.7  — Rev. 17


                                                                                                                                            diff --git a/dist/docs/zh-CN/Module_Context.html b/dist/docs/zh-CN/Module_Context.html index ae33bdb31..5f62f29c7 100644 --- a/dist/docs/zh-CN/Module_Context.html +++ b/dist/docs/zh-CN/Module_Context.html @@ -17,7 +17,7 @@

                                                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                                                            -

                                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                                            +

                                                                                                                                            Version 1.7  — Rev. 17


                                                                                                                                              diff --git a/dist/docs/zh-CN/Module_Help.html b/dist/docs/zh-CN/Module_Help.html index fe2eefcab..2948548d2 100644 --- a/dist/docs/zh-CN/Module_Help.html +++ b/dist/docs/zh-CN/Module_Help.html @@ -17,7 +17,7 @@

                                                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                                                              -

                                                                                                                                              Version 1.7  — Rev. 13

                                                                                                                                              +

                                                                                                                                              Version 1.7  — Rev. 17


                                                                                                                                                diff --git a/dist/docs/zh-CN/Proxy_Context.html b/dist/docs/zh-CN/Proxy_Context.html index a1d2ccdd9..26ad9426b 100644 --- a/dist/docs/zh-CN/Proxy_Context.html +++ b/dist/docs/zh-CN/Proxy_Context.html @@ -17,7 +17,7 @@

                                                                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                -

                                                                                                                                                Version 1.7  — Rev. 13

                                                                                                                                                +

                                                                                                                                                Version 1.7  — Rev. 17


                                                                                                                                                  diff --git a/dist/docs/zh-CN/Redirect_Context.html b/dist/docs/zh-CN/Redirect_Context.html index 2d93282bc..e7291f244 100644 --- a/dist/docs/zh-CN/Redirect_Context.html +++ b/dist/docs/zh-CN/Redirect_Context.html @@ -17,7 +17,7 @@

                                                                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                  -

                                                                                                                                                  Version 1.7  — Rev. 13

                                                                                                                                                  +

                                                                                                                                                  Version 1.7  — Rev. 17


                                                                                                                                                    diff --git a/dist/docs/zh-CN/Rewrite_Help.html b/dist/docs/zh-CN/Rewrite_Help.html index 9a43c0fe5..f0fb18ffd 100644 --- a/dist/docs/zh-CN/Rewrite_Help.html +++ b/dist/docs/zh-CN/Rewrite_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                    -

                                                                                                                                                    Version 1.7  — Rev. 13

                                                                                                                                                    +

                                                                                                                                                    Version 1.7  — Rev. 17


                                                                                                                                                      diff --git a/dist/docs/zh-CN/ScriptHandler_Help.html b/dist/docs/zh-CN/ScriptHandler_Help.html index a8027a5b0..b47ebfa34 100644 --- a/dist/docs/zh-CN/ScriptHandler_Help.html +++ b/dist/docs/zh-CN/ScriptHandler_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                      -

                                                                                                                                                      Version 1.7  — Rev. 13

                                                                                                                                                      +

                                                                                                                                                      Version 1.7  — Rev. 17


                                                                                                                                                        diff --git a/dist/docs/zh-CN/ServGeneral_Help.html b/dist/docs/zh-CN/ServGeneral_Help.html index 97134922d..eb5437cf8 100644 --- a/dist/docs/zh-CN/ServGeneral_Help.html +++ b/dist/docs/zh-CN/ServGeneral_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                        -

                                                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                                                        +

                                                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                                                          diff --git a/dist/docs/zh-CN/ServLog_Help.html b/dist/docs/zh-CN/ServLog_Help.html index 1bbbad8a1..154a4a71a 100644 --- a/dist/docs/zh-CN/ServLog_Help.html +++ b/dist/docs/zh-CN/ServLog_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                          -

                                                                                                                                                          Version 1.7  — Rev. 13

                                                                                                                                                          +

                                                                                                                                                          Version 1.7  — Rev. 17


                                                                                                                                                            @@ -97,20 +97,20 @@

                                                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                                                            Server Log

                                                                                                                                                            Table of Contents

                                                                                                                                                            服务器日志

                                                                                                                                                            -文件名 | 日志级别 | 调试级别 | 回滚大小 | 启用标准错误日志(stderr)

                                                                                                                                                            +文件名 | 日志级别 | 调试级别 | 回滚大小 | Keep Days | 启用标准错误日志(stderr)

                                                                                                                                                            访问日志

                                                                                                                                                            -文件名 | Piped Logger | 日志格式 | 记录头部 | 回滚大小 | 保留天数 | 压缩存档

                                                                                                                                                            +文件名 | Piped Logger | 日志格式 | 记录头部 | 回滚大小 | Keep Days | 压缩存档

                                                                                                                                                            文件名

                                                                                                                                                            Description

                                                                                                                                                            指定日志文件的路径。

                                                                                                                                                            Syntax

                                                                                                                                                            文件2

                                                                                                                                                            Tips

                                                                                                                                                            [性能建议] 将日志文件放置在一个单独的磁盘上。

                                                                                                                                                            日志级别

                                                                                                                                                            Description

                                                                                                                                                            指定日志文件中记录的日志级别。 可用级别(由高到低)为: ERRORWARNINGNOTICEINFODEBUG。 只有级别与当前设置相同或更高的消息将被记录(级别越低记录越详细)。

                                                                                                                                                            Syntax

                                                                                                                                                            选项

                                                                                                                                                            Tips

                                                                                                                                                            [性能建议] 使用DEBUG日志级别对 性能没有任何影响,除非调试级别没有被设置为NONE.。我们推荐将日志级别设置为DEBUG,将 调试级别值设置为NONE。这样设置意味着你的磁盘不会被调试日志塞满,但是你可以使用Toggle Debug Logging 控制调试输出。这个操作可以实时启用或关闭调试记录, 对于调试繁忙的生产服务器非常有用。

                                                                                                                                                            See Also

                                                                                                                                                            调试级别

                                                                                                                                                            调试级别

                                                                                                                                                            Description

                                                                                                                                                            指定调试日志级别。 要使用此功能,日志级别必须设置为DEBUG。 在“调试级别”设置为NONE时,即使日志级别 设置为DEBUG,调试日志也是被禁用的。 在正在运行的服务器上,Toggle Debug Logging可以被用于 控制调试级别而无需重启。

                                                                                                                                                            Syntax

                                                                                                                                                            选项

                                                                                                                                                            Tips

                                                                                                                                                            [性能建议] 重要!如果你不需要详细的调试日志记录, 应始终将其设置为NONE。启用调试日志记录将严重降低服务性能 ,且可能在很短时间耗尽磁盘空间。 调试日志记录包括每个请求和响应的详细信息。

                                                                                                                                                            我们推荐将日志级别设置为DEBUG,调试级别设置为NONE。 这些设置意味着你的磁盘不会被调试日志塞满, 但是你可以使用Toggle Debug Logging 控制调试输出。这个动作可以实时启用或关闭调试记录, 对于调试繁忙的生产服务器非常有用。

                                                                                                                                                            See Also

                                                                                                                                                            日志级别, Toggle Debug Logging

                                                                                                                                                            回滚大小

                                                                                                                                                            Description

                                                                                                                                                            指定何时日志文件需要回滚,也称为日志循环。 当文件大小超过回滚限制后,在使用的日志文件将在同一目录中被重命名 为log_name.mm_dd_yyyy(.sequence),一个新的日志文件将被创建。 回滚的日志文件的实际大小有时会比限制值稍微大一些。 将值设置为0将禁用日志循环。

                                                                                                                                                            Syntax

                                                                                                                                                            无符号整数

                                                                                                                                                            Tips

                                                                                                                                                            请用“K”,“M”,“G”代表千字节,兆字节和千兆字节。

                                                                                                                                                            +

                                                                                                                                                            Keep Days

                                                                                                                                                            Description

                                                                                                                                                            Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                                                                                            Syntax

                                                                                                                                                            无符号整数

                                                                                                                                                            启用标准错误日志(stderr)

                                                                                                                                                            Description

                                                                                                                                                            指定在接受到服务器启动的进程输出的标准错误时,是否写入到日志。 如果启用,标准错误信息将记录到服务器日志所在目录内的固定名为“stderr.log”的文件。如果禁用,所有的标准错误输出都将被丢弃。

                                                                                                                                                            Syntax

                                                                                                                                                            布尔值

                                                                                                                                                            Tips

                                                                                                                                                            如果您需要调试配置的外部应用程序,如PHP、Ruby、Java、Python、Perl,请开启该功能。

                                                                                                                                                            文件名

                                                                                                                                                            Description

                                                                                                                                                            指定访问日志文件的文件名。

                                                                                                                                                            Syntax

                                                                                                                                                            文件2

                                                                                                                                                            Tips

                                                                                                                                                            [性能建议] 将访问日志文件放置在一个单独的磁盘上。

                                                                                                                                                            Piped Logger

                                                                                                                                                            Description

                                                                                                                                                            Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

                                                                                                                                                            The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

                                                                                                                                                            The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's 外部应用程序设置UID模式 settings and will never run on behalf of a privileged user.

                                                                                                                                                            LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

                                                                                                                                                            If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

                                                                                                                                                            Syntax

                                                                                                                                                            Select from drop down list

                                                                                                                                                            日志格式

                                                                                                                                                            Description

                                                                                                                                                            指定访问日志的格式。 设置之后,它将覆盖记录头部 的设定。

                                                                                                                                                            Syntax

                                                                                                                                                            字符串。日志格式的语法与Apache 2.0自定义 日志格式兼容。

                                                                                                                                                            Example

                                                                                                                                                            一般日志格式(CLF)
                                                                                                                                                            "%h %l %u %t \"%r\" %>s %b"

                                                                                                                                                            支持虚拟主机的一般日志格式
                                                                                                                                                            "%v %h %l %u %t \"%r\" %>s %b"

                                                                                                                                                            NCSA扩展/组合日志格式
                                                                                                                                                            "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                                                                                            记录Foobar的cookie值
                                                                                                                                                            "%{Foobar}C"

                                                                                                                                                            See Also

                                                                                                                                                            记录头部

                                                                                                                                                            记录头部

                                                                                                                                                            Description

                                                                                                                                                            指定是否记录HTTP请求头: RefererUserAgentHost

                                                                                                                                                            Syntax

                                                                                                                                                            复选框

                                                                                                                                                            Tips

                                                                                                                                                            [性能建议] 如果你不需要在访问日志中记录这些头部信息,关闭这个功能。

                                                                                                                                                            See Also

                                                                                                                                                            日志格式

                                                                                                                                                            -

                                                                                                                                                            保留天数

                                                                                                                                                            Description

                                                                                                                                                            指定访问日志文件将被保存在磁盘上多少天。 只有超出指定天数的回滚日志文件会被删除。 当前的日志文件不会被删除,无论它包含了多少天的数据。 如果你不想自动删除过时的、很旧的日志文件, 将该值设置为0

                                                                                                                                                            Syntax

                                                                                                                                                            无符号整数

                                                                                                                                                            压缩存档

                                                                                                                                                            Description

                                                                                                                                                            指定是否压缩回滚日志以节省磁盘空间。

                                                                                                                                                            Syntax

                                                                                                                                                            布尔值

                                                                                                                                                            Tips

                                                                                                                                                            日志文件是高度可压缩的,建议采取压缩以减少旧日志的磁盘占用量。

                                                                                                                                                            diff --git a/dist/docs/zh-CN/ServSecurity_Help.html b/dist/docs/zh-CN/ServSecurity_Help.html index 029436634..5599ca3ef 100644 --- a/dist/docs/zh-CN/ServSecurity_Help.html +++ b/dist/docs/zh-CN/ServSecurity_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                            -

                                                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                                                            +

                                                                                                                                                            Version 1.7  — Rev. 17


                                                                                                                                                              diff --git a/dist/docs/zh-CN/ServTuning_Help.html b/dist/docs/zh-CN/ServTuning_Help.html index acd128a7f..ecca16966 100644 --- a/dist/docs/zh-CN/ServTuning_Help.html +++ b/dist/docs/zh-CN/ServTuning_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                              -

                                                                                                                                                              Version 1.7  — Rev. 13

                                                                                                                                                              +

                                                                                                                                                              Version 1.7  — Rev. 17


                                                                                                                                                                diff --git a/dist/docs/zh-CN/ServerStat_Help.html b/dist/docs/zh-CN/ServerStat_Help.html index 237d7fd3c..33c187619 100644 --- a/dist/docs/zh-CN/ServerStat_Help.html +++ b/dist/docs/zh-CN/ServerStat_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                -

                                                                                                                                                                Version 1.7  — Rev. 13

                                                                                                                                                                +

                                                                                                                                                                Version 1.7  — Rev. 17


                                                                                                                                                                  diff --git a/dist/docs/zh-CN/Servlet_Context.html b/dist/docs/zh-CN/Servlet_Context.html index 6fbf36a26..4425c13cb 100644 --- a/dist/docs/zh-CN/Servlet_Context.html +++ b/dist/docs/zh-CN/Servlet_Context.html @@ -17,7 +17,7 @@

                                                                                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                  -

                                                                                                                                                                  Version 1.7  — Rev. 13

                                                                                                                                                                  +

                                                                                                                                                                  Version 1.7  — Rev. 17


                                                                                                                                                                    diff --git a/dist/docs/zh-CN/Static_Context.html b/dist/docs/zh-CN/Static_Context.html index aaeb647cf..ca8f07b07 100644 --- a/dist/docs/zh-CN/Static_Context.html +++ b/dist/docs/zh-CN/Static_Context.html @@ -17,7 +17,7 @@

                                                                                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                    -

                                                                                                                                                                    Version 1.7  — Rev. 13

                                                                                                                                                                    +

                                                                                                                                                                    Version 1.7  — Rev. 17


                                                                                                                                                                      diff --git a/dist/docs/zh-CN/Templates_Help.html b/dist/docs/zh-CN/Templates_Help.html index e30305c27..2a8df6327 100644 --- a/dist/docs/zh-CN/Templates_Help.html +++ b/dist/docs/zh-CN/Templates_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                      -

                                                                                                                                                                      Version 1.7  — Rev. 13

                                                                                                                                                                      +

                                                                                                                                                                      Version 1.7  — Rev. 17


                                                                                                                                                                        diff --git a/dist/docs/zh-CN/VHGeneral_Help.html b/dist/docs/zh-CN/VHGeneral_Help.html index cc9e4f5b3..6b41b6eb5 100644 --- a/dist/docs/zh-CN/VHGeneral_Help.html +++ b/dist/docs/zh-CN/VHGeneral_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                        -

                                                                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                                                                        +

                                                                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                                                                        日志级别

                                                                                                                                                                        Description

                                                                                                                                                                        指定日志记录级别。可用级别(从高到低)为ERROR, WARNING, NOTICE, INFO, 和 DEBUG。 只有当消息等级高于或与当前设置相同时才被记录。 如果您希望将此设置为DEBUG,您也需要设置服务器日志级别为DEBUG。 调试的级别只能在服务器级别通过调试级别控制。

                                                                                                                                                                        Syntax

                                                                                                                                                                        选项

                                                                                                                                                                        Tips

                                                                                                                                                                        [性能建议] 除非调试级别设置为NONE以外的日志级别, 否则DEBUG级别不会对性能产生任何影响,推荐采用。

                                                                                                                                                                        See Also

                                                                                                                                                                        调试级别

                                                                                                                                                                        回滚大小

                                                                                                                                                                        Description

                                                                                                                                                                        指定何时日志文件需要回滚,也称为日志循环。 当文件大小超过回滚限制后,在使用的日志文件将在同一目录中被重命名 为log_name.mm_dd_yyyy(.sequence),一个新的日志文件将被创建。 回滚的日志文件的实际大小有时会比限制值稍微大一些。 将值设置为0将禁用日志循环。

                                                                                                                                                                        Syntax

                                                                                                                                                                        无符号整数

                                                                                                                                                                        Tips

                                                                                                                                                                        请用“K”,“M”,“G”代表千字节,兆字节和千兆字节。

                                                                                                                                                                        +

                                                                                                                                                                        Keep Days

                                                                                                                                                                        Description

                                                                                                                                                                        Specifies how many days the access log file will be kept on disk. Only rotated log files older than the specified number of days will be deleted. The current log file will not be touched regardless how many days worth of data it contains. If you do not want to auto-delete stale and very old log files, set this to 0.

                                                                                                                                                                        Syntax

                                                                                                                                                                        无符号整数

                                                                                                                                                                        日志管理

                                                                                                                                                                        Description

                                                                                                                                                                        指定写入访问日志的地点。这里有三个选项: 1. 写入到服务器的访问日志; 2. 为虚拟主机创建一个访问日志; 3. 禁用访问日志记录。

                                                                                                                                                                        Syntax

                                                                                                                                                                        选项

                                                                                                                                                                        File Name

                                                                                                                                                                        Description

                                                                                                                                                                        The access log filename.

                                                                                                                                                                        Syntax

                                                                                                                                                                        Filename which can be an absolute path or a relative path to $SERVER_ROOT, $VH_ROOT.

                                                                                                                                                                        Tips

                                                                                                                                                                        Put access log file on a separate disk.

                                                                                                                                                                        Piped Logger

                                                                                                                                                                        Description

                                                                                                                                                                        Specifies the external application that will receive the access log data sent by LiteSpeed through a pipe on its STDIN stream (file handle is 0). When this field is specified, the access log will be sent only to the logger application and not the access log file specified in previous entry.

                                                                                                                                                                        The logger application must be defined in External Apps section first. Server-level access logging can only use an external logger application defined at the server level. Virtual host-level access logging can only use a logger application defined at the virtual host level.

                                                                                                                                                                        The logger process is spawned in the same way as other external (CGI/FastCGI/LSAPI) processes. This means it will execute as the user ID specified in the virtual host's 外部应用程序设置UID模式 settings and will never run on behalf of a privileged user.

                                                                                                                                                                        LiteSpeed web server performs simple load balancing among multiple logger applications if more than one instance of a logger application is configured. LiteSpeed server always attempts to keep the number of logger applications as low as possible. Only when one logger application fails to process access log entries in time will the server attempt to spawn another instance of the logger application.

                                                                                                                                                                        If a logger crashes, the web server will start another instance but the log data in the stream buffer will be lost. It is possible to lose log data if external loggers cannot keep up with the speed and volume of the log stream.

                                                                                                                                                                        Syntax

                                                                                                                                                                        Select from drop down list

                                                                                                                                                                        日志格式

                                                                                                                                                                        Description

                                                                                                                                                                        指定访问日志的格式。 设置之后,它将覆盖记录头部 的设定。

                                                                                                                                                                        Syntax

                                                                                                                                                                        字符串。日志格式的语法与Apache 2.0自定义 日志格式兼容。

                                                                                                                                                                        Example

                                                                                                                                                                        一般日志格式(CLF)
                                                                                                                                                                        "%h %l %u %t \"%r\" %>s %b"

                                                                                                                                                                        支持虚拟主机的一般日志格式
                                                                                                                                                                        "%v %h %l %u %t \"%r\" %>s %b"

                                                                                                                                                                        NCSA扩展/组合日志格式
                                                                                                                                                                        "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

                                                                                                                                                                        记录Foobar的cookie值
                                                                                                                                                                        "%{Foobar}C"

                                                                                                                                                                        See Also

                                                                                                                                                                        记录头部

                                                                                                                                                                        记录头部

                                                                                                                                                                        Description

                                                                                                                                                                        指定是否记录HTTP请求头: RefererUserAgentHost

                                                                                                                                                                        Syntax

                                                                                                                                                                        复选框

                                                                                                                                                                        Tips

                                                                                                                                                                        [性能建议] 如果你不需要在访问日志中记录这些头部信息,关闭这个功能。

                                                                                                                                                                        See Also

                                                                                                                                                                        日志格式

                                                                                                                                                                        -

                                                                                                                                                                        保留天数

                                                                                                                                                                        Description

                                                                                                                                                                        指定访问日志文件将被保存在磁盘上多少天。 只有超出指定天数的回滚日志文件会被删除。 当前的日志文件不会被删除,无论它包含了多少天的数据。 如果你不想自动删除过时的、很旧的日志文件, 将该值设置为0

                                                                                                                                                                        Syntax

                                                                                                                                                                        无符号整数

                                                                                                                                                                        字节记录

                                                                                                                                                                        Description

                                                                                                                                                                        指定带宽字节日志文件的路径。设置后,将创建一份兼容cPanel面板的带宽日志。这将记录 一个请求传输的总字节数,包括请求内容和响应内容。

                                                                                                                                                                        Syntax

                                                                                                                                                                        文件2

                                                                                                                                                                        Tips

                                                                                                                                                                        [性能建议] 将日志文件放置在一个单独的磁盘上。

                                                                                                                                                                        压缩存档

                                                                                                                                                                        Description

                                                                                                                                                                        指定是否压缩回滚日志以节省磁盘空间。

                                                                                                                                                                        Syntax

                                                                                                                                                                        布尔值

                                                                                                                                                                        Tips

                                                                                                                                                                        日志文件是高度可压缩的,建议采取压缩以减少旧日志的磁盘占用量。

                                                                                                                                                                        使用服务器索引文件

                                                                                                                                                                        Description

                                                                                                                                                                        指定是否使用服务器的索引文件。 如果设置为Yes,那么只有服务器的设置将被使用。 如果设置为No,那么服务器的设置将不会被使用。 如果设置为Addition,那么附加的索引文件可以被添加到此虚拟主机服务器的索引文件列表中。 如果想要禁用此虚拟主机的索引文件,您可以将该值设置为No,并将索引文件栏留空。

                                                                                                                                                                        Syntax

                                                                                                                                                                        选项

                                                                                                                                                                        diff --git a/dist/docs/zh-CN/VHSSL_Help.html b/dist/docs/zh-CN/VHSSL_Help.html index 6945b8a45..4605c0fc5 100644 --- a/dist/docs/zh-CN/VHSSL_Help.html +++ b/dist/docs/zh-CN/VHSSL_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                        -

                                                                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                                                                        +

                                                                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                                                                          diff --git a/dist/docs/zh-CN/VHSecurity_Help.html b/dist/docs/zh-CN/VHSecurity_Help.html index 04bd95e66..a8f0e89d7 100644 --- a/dist/docs/zh-CN/VHSecurity_Help.html +++ b/dist/docs/zh-CN/VHSecurity_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                          -

                                                                                                                                                                          Version 1.7  — Rev. 13

                                                                                                                                                                          +

                                                                                                                                                                          Version 1.7  — Rev. 17


                                                                                                                                                                            diff --git a/dist/docs/zh-CN/VHWebSocket_Help.html b/dist/docs/zh-CN/VHWebSocket_Help.html index a33de89ed..9101a9eba 100644 --- a/dist/docs/zh-CN/VHWebSocket_Help.html +++ b/dist/docs/zh-CN/VHWebSocket_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                            -

                                                                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                                                                            +

                                                                                                                                                                            Version 1.7  — Rev. 17


                                                                                                                                                                              diff --git a/dist/docs/zh-CN/VirtualHosts_Help.html b/dist/docs/zh-CN/VirtualHosts_Help.html index aefd60b2a..1d78fd2fe 100644 --- a/dist/docs/zh-CN/VirtualHosts_Help.html +++ b/dist/docs/zh-CN/VirtualHosts_Help.html @@ -17,7 +17,7 @@

                                                                                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                              -

                                                                                                                                                                              Version 1.7  — Rev. 13

                                                                                                                                                                              +

                                                                                                                                                                              Version 1.7  — Rev. 17


                                                                                                                                                                                diff --git a/dist/docs/zh-CN/admin.html b/dist/docs/zh-CN/admin.html index 2c305f3d3..77d7b75c9 100644 --- a/dist/docs/zh-CN/admin.html +++ b/dist/docs/zh-CN/admin.html @@ -17,7 +17,7 @@

                                                                                                                                                                                OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                -

                                                                                                                                                                                Version 1.7  — Rev. 13

                                                                                                                                                                                +

                                                                                                                                                                                Version 1.7  — Rev. 17


                                                                                                                                                                                  diff --git a/dist/docs/zh-CN/config.html b/dist/docs/zh-CN/config.html index 344753498..363a9827a 100644 --- a/dist/docs/zh-CN/config.html +++ b/dist/docs/zh-CN/config.html @@ -17,7 +17,7 @@

                                                                                                                                                                                  OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                  -

                                                                                                                                                                                  Version 1.7  — Rev. 13

                                                                                                                                                                                  +

                                                                                                                                                                                  Version 1.7  — Rev. 17


                                                                                                                                                                                    diff --git a/dist/docs/zh-CN/index.html b/dist/docs/zh-CN/index.html index 3e1029be6..d64dd5b0f 100644 --- a/dist/docs/zh-CN/index.html +++ b/dist/docs/zh-CN/index.html @@ -17,7 +17,7 @@

                                                                                                                                                                                    OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                    -

                                                                                                                                                                                    Version 1.7  — Rev. 13

                                                                                                                                                                                    +

                                                                                                                                                                                    Version 1.7  — Rev. 17


                                                                                                                                                                                      @@ -102,7 +102,7 @@



                                                                                                                                                                                      Users' Manual

                                                                                                                                                                                      - — Rev. 13 + — Rev. 17


                                                                                                                                                                                      diff --git a/dist/docs/zh-CN/install.html b/dist/docs/zh-CN/install.html index fc809f2c6..7a0854e99 100644 --- a/dist/docs/zh-CN/install.html +++ b/dist/docs/zh-CN/install.html @@ -17,7 +17,7 @@

                                                                                                                                                                                      OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                      -

                                                                                                                                                                                      Version 1.7  — Rev. 13

                                                                                                                                                                                      +

                                                                                                                                                                                      Version 1.7  — Rev. 17


                                                                                                                                                                                        diff --git a/dist/docs/zh-CN/intro.html b/dist/docs/zh-CN/intro.html index 922035f1a..b1b350dbf 100644 --- a/dist/docs/zh-CN/intro.html +++ b/dist/docs/zh-CN/intro.html @@ -17,7 +17,7 @@

                                                                                                                                                                                        OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                        -

                                                                                                                                                                                        Version 1.7  — Rev. 13

                                                                                                                                                                                        +

                                                                                                                                                                                        Version 1.7  — Rev. 17


                                                                                                                                                                                          diff --git a/dist/docs/zh-CN/license.html b/dist/docs/zh-CN/license.html index bfd28aec0..e55ecc9af 100644 --- a/dist/docs/zh-CN/license.html +++ b/dist/docs/zh-CN/license.html @@ -17,7 +17,7 @@

                                                                                                                                                                                          OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                          -

                                                                                                                                                                                          Version 1.7  — Rev. 13

                                                                                                                                                                                          +

                                                                                                                                                                                          Version 1.7  — Rev. 17


                                                                                                                                                                                            diff --git a/dist/docs/zh-CN/security.html b/dist/docs/zh-CN/security.html index 5ad10df13..bd166c8b2 100644 --- a/dist/docs/zh-CN/security.html +++ b/dist/docs/zh-CN/security.html @@ -17,7 +17,7 @@

                                                                                                                                                                                            OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                            -

                                                                                                                                                                                            Version 1.7  — Rev. 13

                                                                                                                                                                                            +

                                                                                                                                                                                            Version 1.7  — Rev. 17


                                                                                                                                                                                              diff --git a/dist/docs/zh-CN/webconsole.html b/dist/docs/zh-CN/webconsole.html index b9efba9f8..7a763ab19 100644 --- a/dist/docs/zh-CN/webconsole.html +++ b/dist/docs/zh-CN/webconsole.html @@ -17,7 +17,7 @@

                                                                                                                                                                                              OpenLiteSpeed Web Server Users' Manual

                                                                                                                                                                                              -

                                                                                                                                                                                              Version 1.7  — Rev. 13

                                                                                                                                                                                              +

                                                                                                                                                                                              Version 1.7  — Rev. 17


                                                                                                                                                                                                diff --git a/dist/share/autoindex/default.php b/dist/share/autoindex/default.php index 93cdaaa4e..3349db2b0 100644 --- a/dist/share/autoindex/default.php +++ b/dist/share/autoindex/default.php @@ -184,12 +184,12 @@ function readDirList( $path, &$excludes, &$map ) function printOneEntry( $base, $name, $fileStat, $setting ) { - $encoded = str_replace(array('%2F', '%26amp%3B'), array('/', '%26'), + $encoded = str_replace(array('%2F', '%26amp%3B'), array('/', '%26'), rawurlencode( $base . $fileStat->name )); if ( isset($_SERVER['LS_FI_OFF'])&& $_SERVER['LS_FI_OFF'] ) { $buf = '
                                                                                                                                                                                              • ' . '' . sprintf( $setting->nameFormat, htmlspecialchars($name)."
                                                                                                                                                                                              • \n"); + $fileStat->isdir.'">' . sprintf( $setting->nameFormat, htmlspecialchars($name, ENT_SUBSTITUTE)."\n"); } else { @@ -199,7 +199,7 @@ function printOneEntry( $base, $name, $fileStat, $setting ) { $name = substr( $name, 0, $setting->nameWidth - 3 ). '...'; } - $buf .= sprintf( $setting->nameFormat, htmlspecialchars($name).""); + $buf .= sprintf( $setting->nameFormat, htmlspecialchars($name, ENT_SUBSTITUTE).""); if ( $fileStat->mtime != -1 ) $buf .= date($setting->Time_Format, $fileStat->mtime); else @@ -222,7 +222,7 @@ function printIncludes( $path, $name ) { $filename = $path . $n; - if ( file_exists($filename) ) + if ( file_exists($filename) && !is_link($filename)) { $content = file_get_contents($filename); if ( $n == $name ) @@ -307,9 +307,8 @@ function cmpDD( $a, $b ) } +ini_set('open_basedir', $_SERVER['DOCUMENT_ROOT']); - -//phpinfo(); $pos = strpos( $_SERVER['REQUEST_URI'], '?' ); if ( $pos === FALSE ) { @@ -374,10 +373,11 @@ function cmpDD( $a, $b ) } -echo " +echo " - + + Index of ", $uri, "

                                                                                                                                                                                                Index of ", $uri, "

                                                                                                                                                                                                "; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd1466f9a..055d9d8b8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -148,13 +148,13 @@ add_executable(ls_shmhashstat SET( litespeedlib cache modgzip lsiapi main http spdy ssi registry cgi fcgi jk extensions lsapi proxy - socket sslpp lsshm thread log4cxx adns + socket sslpp lsshm thread log4cxx adns quic h2 lsquic -Wl,--whole-archive util lsr -Wl,--no-whole-archive ${MMDB_LIB} edio libssl.a libcrypto.a ${BSSL_ADD_LIB} ${libUnitTest} libz.a libpcre.a libexpat.a libxml2.a ${IP2LOC_ADD_LIB} ${BROTLI_ADD_LIB} udns -nodefaultlibs pthread rt stdc++ - ${CMAKE_DL_LIBS} crypt m gcc_eh c c_nonshared gcc + ${CMAKE_DL_LIBS} crypt bcrypt m gcc_eh c c_nonshared gcc ) target_link_libraries(openlitespeed ${litespeedlib} ) diff --git a/src/Makefile.am b/src/Makefile.am index 0304653bc..28d72bd07 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -113,7 +113,7 @@ openlitespeed_LDADD = ./main/libmain.a ./http/libhttp.a \ ./quic/libquic.a ./liblsquic/liblsquic.a ./spdy/libspdy.a \ $(LIBBROTLI) $(LIBMMDB) $(EXTRA_LIBS) \ $(AM_OPENSSL_LIBS) $(EXPAT_LIBS) $(PCRE_LIBS) ${IP2LOCATION_LIBS} \ - -ludns -lz -lexpat -lpthread $(DL_LIB_OPTION) $(RT_LIB_OPTION) + -ludns -lcrypt -lbcrypt -lz -lexpat -lpthread $(DL_LIB_OPTION) $(RT_LIB_OPTION) AM_LDFLAGS = $(OPENSSL_LDFLAGS) -L/usr/lib -L/usr/local/lib -L/usr/lib64 AM_CPPFLAGS = -std=c++0x -I$(top_srcdir)/ssl/include/ -I$(top_srcdir)/src/lshpack -I$(top_srcdir)/src/liblsquic/ls-qpack -I$(top_srcdir)/include -I$(top_srcdir)/src $(PCRE_CFLAGS) $(EXPAT_CFLAGS) diff --git a/src/Makefile.in b/src/Makefile.in index 230ce9253..c6b982f20 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -569,7 +569,7 @@ openlitespeed_LDADD = ./main/libmain.a ./http/libhttp.a \ ./quic/libquic.a ./liblsquic/liblsquic.a ./spdy/libspdy.a \ $(LIBBROTLI) $(LIBMMDB) $(EXTRA_LIBS) \ $(AM_OPENSSL_LIBS) $(EXPAT_LIBS) $(PCRE_LIBS) ${IP2LOCATION_LIBS} \ - -ludns -lz -lexpat -lpthread $(DL_LIB_OPTION) $(RT_LIB_OPTION) + -ludns -lcrypt -lbcrypt -lz -lexpat -lpthread $(DL_LIB_OPTION) $(RT_LIB_OPTION) AM_LDFLAGS = $(OPENSSL_LDFLAGS) -L/usr/lib -L/usr/local/lib -L/usr/lib64 AM_CPPFLAGS = -std=c++0x -I$(top_srcdir)/ssl/include/ -I$(top_srcdir)/src/lshpack -I$(top_srcdir)/src/liblsquic/ls-qpack -I$(top_srcdir)/include -I$(top_srcdir)/src $(PCRE_CFLAGS) $(EXPAT_CFLAGS) diff --git a/src/config.h.cmake b/src/config.h.cmake index c6e22d5c1..4d8326b0a 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -5,6 +5,6 @@ #define DEFAULT_TMP_DIR "/tmp/lshttpd" #define PID_FILE "/tmp/lshttpd/openlitespeed.pid" -#define PACKAGE_VERSION "1.7.3" +#define PACKAGE_VERSION "1.7.4" #define LS_MODULE_VERSION_INFO "\tmodgzip 1.1\n\tcache 1.62\n\tmodinspector 1.1\n\tuploadprogress 1.1\n\tmod_security 1.3\n" #endif diff --git a/src/edio/streamstat.h b/src/edio/streamstat.h index 10f244316..eb7a0788c 100644 --- a/src/edio/streamstat.h +++ b/src/edio/streamstat.h @@ -3,29 +3,68 @@ #ifndef STREAMSTAT_H #define STREAMSTAT_H -enum StreamState +enum stream_state { SS_DISCONNECTED, SS_CONNECTING, SS_CONNECTED, SS_CLOSING, SS_SHUTDOWN, - SS_RESET + SS_RESET, + SS_ABORT, + SS_ERROR }; +enum stream_protocol +{ + HIOS_PROTO_HTTP = 0, + HIOS_PROTO_SPDY2 = 1, + HIOS_PROTO_SPDY3 = 2, + HIOS_PROTO_SPDY31 = 3, + HIOS_PROTO_HTTP2 = 4, + HIOS_PROTO_QUIC = 5, + HIOS_PROTO_HTTP3 = 6, + HIOS_PROTO_MAX +}; + +enum stream_flag +{ + SS_FLAG_NONE = 0, + SS_FLAG_PEER_SHUTDOWN = (1<<0), + SS_FLAG_LOCAL_SHUTDOWN = (1<<1), + SS_FLAG_WANT_READ = (1<<2), + SS_FLAG_WANT_WRITE = (1<<3), + SS_FLAG_ABORT = (1<<4), + SS_FLAG_PEER_RESET = (1<<5), + SS_FLAG_HANDLER_RELEASE = (1<<6), + SS_FLAG_PAUSE_WRITE = (1<<7), + SS_EVENT_PROCESSING = (1<<8), + SS_FLAG_DELAY_FLUSH = (1<<9), + SS_FLAG_WRITE_BUFFER = (1<<10), + SS_FLAG_WANT_EVENT_PROCESS = (1<<11), + SS_FLAG_FROM_LOCAL = (1<<12), + SS_FLAG_PUSH_CAPABLE = (1<<13), + SS_FLAG_INIT_SESS = (1<<14), + SS_FLAG_IS_PUSH = (1<<15), + SS_FLAG_PASS_THROUGH = (1<<16), + SS_FLAG_SENDFILE = (1<<17), + SS_FLAG_FLOWCTRL = (1<<18), + SS_FLAG_PRI_SET = (1<<19), + SS_FLAG_ALTSVC_SENT = (1<<20), + SS_FLAG_PASS_SETCOOKIE = (1<<21), + SS_FLAG_RESP_HEADER_SENT = (1<<22), + SS_FLAG_BLACK_HOLE = (1<<23), -#define SS_FLAG_PEER_SHUTDOWN (1<<0) -#define SS_FLAG_LOCAL_SHUTDOWN (1<<1) -#define SS_FLAG_WANT_READ (1<<2) -#define SS_FLAG_WANT_WRITE (1<<3) -#define SS_FLAG_ABORT (1<<4) -#define SS_FLAG_PEER_RESET (1<<5) -#define SS_FLAG_HANDLER_RELEASE (1<<6) -#define SS_FLAG_PAUSE_WRITE (1<<7) -#define SS_EVENT_PROCESSING (1<<8) -#define SS_FLAG_DELAY_FLUSH (1<<9) -#define SS_FLAG_WRITE_BUFFER (1<<10) +}; +inline enum stream_flag operator|(enum stream_flag a, enum stream_flag b) +{ + return static_cast(static_cast(a) | static_cast(b)); +} +inline enum stream_flag operator~(enum stream_flag a) +{ + return static_cast(~static_cast(a)); +} class StreamStat { @@ -39,18 +78,20 @@ class StreamStat { LS_ZERO_FILL(m_lBytesRecv, m_iPriority); } - void setFlag(uint32_t flagbit, int val) - { m_iFlag = (val) ? (m_iFlag | flagbit) : (m_iFlag & ~flagbit); } - uint32_t getFlag(uint32_t flagbit) const { return flagbit & m_iFlag; } - uint32_t getFlag() const { return m_iFlag; } + void setFlag(enum stream_flag flagbit, int val) + { m_iFlag = (val) ? (enum stream_flag)(m_iFlag | flagbit) + : (enum stream_flag)(m_iFlag & ~flagbit); } + uint32_t getFlag(enum stream_flag flagbit) const + { return flagbit & m_iFlag; } + enum stream_flag getFlag() const { return m_iFlag; } - void bytesRecv(int n) { m_lBytesRecv += n; } - void bytesSent(int n) { m_lBytesSent += n; } + void bytesRecv(int n) { m_lBytesRecv += n; } + void bytesSent(int n) { m_lBytesSent += n; } - off_t getBytesRecv() const { return m_lBytesRecv; } - off_t getBytesSent() const { return m_lBytesSent; } - off_t getBytesTotal() const { return m_lBytesRecv + m_lBytesSent; } + uint64_t getBytesRecv() const { return m_lBytesRecv; } + uint64_t getBytesSent() const { return m_lBytesSent; } + uint64_t getBytesTotal() const { return m_lBytesRecv + m_lBytesSent; } void resetBytesCount() { @@ -63,10 +104,11 @@ class StreamStat uint32_t getActiveTime() const { return m_tmLastActive; } - char getProtocol() const { return m_iProtocol; } - void setProtocol(int p) { m_iProtocol = p; } - char getState() const { return m_iState; } - void setState(int st) { m_iState = st; } + enum stream_protocol getProtocol() const { return m_protocol; } + void setProtocol(enum stream_protocol p) { m_protocol = p; } + + enum stream_state getState() const { return m_state; } + void setState(enum stream_state st) { m_state = st; } short getPriority() const { return m_iPriority; } void setPriority(int pri) { m_iPriority = pri; } @@ -84,13 +126,13 @@ class StreamStat void handlerReadyToRelease(){ setFlag(SS_FLAG_HANDLER_RELEASE, 1); } private: - off_t m_lBytesRecv; - off_t m_lBytesSent; - uint32_t m_iFlag; - uint32_t m_tmLastActive; - char m_iState; - char m_iProtocol; - short m_iPriority; + uint64_t m_lBytesRecv; + uint64_t m_lBytesSent; + uint32_t m_tmLastActive; + enum stream_flag m_iFlag; + enum stream_state m_state:8; + enum stream_protocol m_protocol:8; + short m_iPriority; }; diff --git a/src/extensions/cgi/cgidworker.cpp b/src/extensions/cgi/cgidworker.cpp index 47699a514..ba358b129 100644 --- a/src/extensions/cgi/cgidworker.cpp +++ b/src/extensions/cgi/cgidworker.cpp @@ -365,6 +365,11 @@ int CgidWorker::config(const XmlNode *pNode1) "cgroups", 0, 2, 0) == ServerProcessConfig::CGROUP_CONFIG_DEFAULT_ON); #endif + + if (MainServerConfig::getInstance().getConfTestMode()) + return 0; + + CgidWorker::setCgidWorkerPid( start(MainServerConfig::getInstance().getServerRoot(), psChroot, procConfig.getUid(), procConfig.getGid(), diff --git a/src/extensions/lsapi/lsapiconn.cpp b/src/extensions/lsapi/lsapiconn.cpp index 7647086d3..3b21c081a 100644 --- a/src/extensions/lsapi/lsapiconn.cpp +++ b/src/extensions/lsapi/lsapiconn.cpp @@ -700,12 +700,15 @@ int LsapiConn::processRespHeader(char *pEnd, int &status) swapIntEndian(&m_respInfo.m_cntHeaders); swapIntEndian(&m_respInfo.m_status); } - if (m_respInfo.m_status) + if (m_respInfo.m_status && m_respInfo.m_status != 200) { int code; code = HttpStatusCode::getInstance().codeToIndex(m_respInfo.m_status); if (code != -1) + { getConnector()->getHttpSession()->getReq()->updateNoRespBodyByStatus(code); + LS_DBG_M(this, "set status: %d", m_respInfo.m_status); + } } } else @@ -742,23 +745,54 @@ int LsapiConn::processRespHeader(char *pEnd, int &status) int len = *p; if (len > 0) { - if (m_pRespHeaderProcess + len <= pEnd) + int partialHeaderLen = getConnector()->getPartialHeaderLen(); + if (partialHeaderLen > 0) { - char *pHeaderEnd = m_pRespHeaderProcess + len - 1; - *pHeaderEnd = 0; - if (HttpCgiTool::processHeaderLine( - getConnector(), - m_pRespHeaderProcess, pHeaderEnd) == -1) - return LS_FAIL; - m_pRespHeaderProcess += len; + if (m_pRespHeaderProcess + len - partialHeaderLen <= pEnd) + { + char *pHeaderEnd = m_pRespHeaderProcess + len - partialHeaderLen - 1; + *pHeaderEnd++ = 0; + getConnector()->appendPartialHeader( + m_pRespHeaderProcess, pHeaderEnd - m_pRespHeaderProcess); + m_pRespHeaderProcess = pHeaderEnd; + if (getConnector()->processCompleteRespHeader() == -1) + return -1; + } + else + { + getConnector()->appendPartialHeader( + m_pRespHeaderProcess, pEnd - m_pRespHeaderProcess); + m_pRespHeaderProcess = pEnd; + return 0; + } } else - return 0; + { + if (m_pRespHeaderProcess + len <= pEnd) + { + char *pHeaderEnd = m_pRespHeaderProcess + len - 1; + *pHeaderEnd = 0; + if (HttpCgiTool::processHeaderLine( + getConnector(), + m_pRespHeaderProcess, pHeaderEnd) == -1) + return -1; + m_pRespHeaderProcess += len; + } + else + { + getConnector()->appendPartialHeader( + m_pRespHeaderProcess, pEnd - m_pRespHeaderProcess); + m_pRespHeaderProcess = pEnd; + return 0; + } + } } ++m_iCurRespHeader; } status |= HttpReq::HEADER_OK; - getConnector()->respHeaderDone(); + int ret = getConnector()->respHeaderDone(); + if (ret != 0 && ret != LSI_SUSPEND) + return -1; } ++m_respState; } @@ -778,8 +812,16 @@ int LsapiConn::processRespHeader() { while (m_iPacketLeft > 0) { - len = ExtConn::read(m_pRespHeader, m_pRespHeaderBufEnd - m_pRespHeader); - LS_DBG_M(this, "Process response header %d bytes", len); + int headerLeft = m_pRespHeaderBufEnd - m_pRespHeader; + /*** + * 7/16/2020 David added the following 2 lines to avodi try to read(buf, 0). + */ + if (headerLeft <= 0) + break; + + len = ExtConn::read(m_pRespHeader, headerLeft); + LS_DBG_M(this, "Process response header (packetLeft %d) headerLeft %d, return %d", + m_iPacketLeft, headerLeft, len); if (len > 0) { m_iPacketLeft -= len; diff --git a/src/extensions/lsapi/lsapiconn.h b/src/extensions/lsapi/lsapiconn.h index 72384a162..af013ec3e 100644 --- a/src/extensions/lsapi/lsapiconn.h +++ b/src/extensions/lsapi/lsapiconn.h @@ -53,7 +53,7 @@ class LsapiConn: public ExtConn char *m_pRespHeaderProcess; struct lsapi_packet_header m_respHeader; struct lsapi_resp_info m_respInfo; - char m_respBuf[4096]; + char m_respBuf[8192]; int processPacketHeader(char *pBuf, int len); diff --git a/src/h2/h2connbase.cpp b/src/h2/h2connbase.cpp index 624bdb76b..b3e8243a9 100644 --- a/src/h2/h2connbase.cpp +++ b/src/h2/h2connbase.cpp @@ -109,7 +109,7 @@ int H2ConnBase::verifyClientPreface() " got [%.24s], close.", sPreface); return LS_FAIL; } - m_h2_flag |= H2_CONN_FLAG_PREFACE; + set_h2flag(H2_CONN_FLAG_PREFACE); return 0; } @@ -139,7 +139,7 @@ int H2ConnBase::parseFrame() //if (m_curH2Header.getType() != H2_FRAME_DATA) // m_inputState = ST_CONTROL_FRAME; } - if (!(m_h2_flag & H2_CONN_FLAG_SETTING_RCVD)) + if (!(m_h2flag & H2_CONN_FLAG_SETTING_RCVD)) { if (m_curH2Header.getType() != H2_FRAME_SETTINGS) { @@ -150,7 +150,7 @@ int H2ConnBase::parseFrame() } } - if ((m_h2_flag & H2_CONN_HEADERS_START) == H2_CONN_HEADERS_START + if ((m_h2flag & H2_CONN_HEADERS_START) == H2_CONN_HEADERS_START && m_curH2Header.getType() != H2_FRAME_CONTINUATION) return LS_FAIL; @@ -216,7 +216,7 @@ void H2ConnBase::updateWindow() int H2ConnBase::processInput() { int ret; - if (!(m_h2_flag & H2_CONN_FLAG_PREFACE)) + if (!(m_h2flag & H2_CONN_FLAG_PREFACE)) { if (m_bufInput.size() < H2_CLIENT_PREFACE_LEN) return 0; @@ -294,7 +294,7 @@ int H2ConnBase::onReadEx2() { if (getBuf()->size() >= MAX_OUT_BUF_SIZE) { - m_h2_flag |= H2_CONN_FLAG_PAUSE_READ; + set_h2flag(H2_CONN_FLAG_PAUSE_READ); suspendRead(); } if (m_bufInput.empty() && m_bufInput.capacity() > 4096) @@ -448,9 +448,9 @@ int H2ConnBase::processSettingFrame(H2FrameHeader *pHeader) iEntries); return LS_FAIL; } - if (m_h2_flag & H2_CONN_FLAG_SETTING_SENT) + if (m_h2flag & H2_CONN_FLAG_SETTING_SENT) { - m_h2_flag |= H2_CONN_FLAG_CONFIRMED; + set_h2flag(H2_CONN_FLAG_CONFIRMED); return 0; } else @@ -513,7 +513,7 @@ int H2ConnBase::processSettingFrame(H2FrameHeader *pHeader) case H2_SETTINGS_MAX_CONCURRENT_STREAMS: m_iMaxPushStreams = iEntryValue ; if (m_iMaxPushStreams == 0) - m_h2_flag |= H2_CONN_FLAG_NO_PUSH; + set_h2flag(H2_CONN_FLAG_NO_PUSH); break; case H2_SETTINGS_MAX_HEADER_LIST_SIZE: break; @@ -523,7 +523,7 @@ int H2ConnBase::processSettingFrame(H2FrameHeader *pHeader) if (!iEntryValue) { m_iMaxPushStreams = 0; - m_h2_flag |= H2_CONN_FLAG_NO_PUSH; + set_h2flag(H2_CONN_FLAG_NO_PUSH); } break; default: @@ -531,7 +531,7 @@ int H2ConnBase::processSettingFrame(H2FrameHeader *pHeader) } } m_iCurrentFrameRemain = 0; - m_h2_flag |= H2_CONN_FLAG_SETTING_RCVD; + set_h2flag(H2_CONN_FLAG_SETTING_RCVD); if (++m_iControlFrames > MAX_CONTROL_FRAMES_RATE) { @@ -557,7 +557,7 @@ int H2ConnBase::processSettingFrame(H2FrameHeader *pHeader) int H2ConnBase::sendSettingsFrame(bool disable_push) { - if (m_h2_flag & H2_CONN_FLAG_SETTING_SENT) + if (m_h2flag & H2_CONN_FLAG_SETTING_SENT) return 0; static char s_settings[][6] = @@ -578,7 +578,7 @@ int H2ConnBase::sendSettingsFrame(bool disable_push) LS_DBG_H(getLogSession(), "send SETTING frame, MAX_CONCURRENT_STREAMS: %d," " INITIAL_WINDOW_SIZE: %d", m_iServerMaxStreams, m_iStreamInInitWindowSize); - m_h2_flag |= H2_CONN_FLAG_SETTING_SENT; + set_h2flag(H2_CONN_FLAG_SETTING_SENT); H2FrameHeader wu_header(4, H2_FRAME_WINDOW_UPDATE, 0, 0); memcpy(&buf[settings_payload_size + 9], &wu_header, 9); @@ -977,18 +977,18 @@ int H2ConnBase::processDataFramePadding(H2FrameHeader *pHeader) int H2ConnBase::processContinuationFrame(H2FrameHeader *pHeader) { - if (m_h2_flag & H2_CONN_FLAG_GOAWAY) + if (m_h2flag & H2_CONN_FLAG_GOAWAY) return 0; uint32_t id = pHeader->getStreamId(); if ((id != m_uiLastStreamId) - || (m_h2_flag & H2_CONN_HEADERS_START) == 0) + || (m_h2flag & H2_CONN_HEADERS_START) == 0) { LS_DBG_L(getLogSession(), "received unexpected CONTINUATION frame, expect id: %d, " - " connection flag: %d", m_uiLastStreamId, m_h2_flag); + " connection flag: %d", m_uiLastStreamId, m_h2flag); return LS_FAIL; } if (pHeader->getFlags() & H2_FLAG_END_HEADERS) - m_h2_flag &= ~H2_CONN_HEADERS_START; + clr_h2flag(H2_CONN_HEADERS_START); return processHeaderIn(id, pHeader->getFlags()); } @@ -1092,7 +1092,7 @@ int H2ConnBase::processPriority(uint32_t id) int H2ConnBase::processHeadersFrame(H2FrameHeader *pHeader) { uint32_t id = pHeader->getStreamId(); - if (m_h2_flag & H2_CONN_FLAG_GOAWAY) + if (m_h2flag & H2_CONN_FLAG_GOAWAY) return 0; if (verifyStreamId(id) == LS_FAIL) @@ -1123,7 +1123,7 @@ int H2ConnBase::processHeadersFrame(H2FrameHeader *pHeader) memset(&m_priority, 0, sizeof(m_priority)); if ((iHeaderFlag & H2_FLAG_END_HEADERS) == 0) - m_h2_flag |= H2_CONN_HEADERS_START; + set_h2flag(H2_CONN_HEADERS_START); m_bufInflate.clear(); return processHeaderIn(id, iHeaderFlag); @@ -1325,13 +1325,13 @@ H2StreamBase *H2ConnBase::findStream(uint32_t uiStreamID) int H2ConnBase::processGoAwayFrame(H2FrameHeader *pHeader) { - if (!(m_h2_flag & H2_CONN_FLAG_GOAWAY)) + if (!(m_h2flag & H2_CONN_FLAG_GOAWAY)) { doGoAway((pHeader->getStreamId() != 0)? H2_ERROR_PROTOCOL_ERROR: H2_ERROR_NO_ERROR); } - m_h2_flag |= (short)H2_CONN_FLAG_GOAWAY; + set_h2flag(H2_CONN_FLAG_GOAWAY); onCloseEx(); return LS_OK; @@ -1494,8 +1494,8 @@ void H2ConnBase::add2PriorityQue(H2StreamBase *stream) stream->getPriority()); m_priQue[stream->getPriority()].append(stream); - m_h2_flag |= H2_CONN_FLAG_WAIT_PROCESS; - if ((m_h2_flag & H2_CONN_FLAG_IN_EVENT) == 0 && m_iCurDataOutWindow > 0) + set_h2flag(H2_CONN_FLAG_WAIT_PROCESS); + if ((m_h2flag & H2_CONN_FLAG_IN_EVENT) == 0 && m_iCurDataOutWindow > 0) continueWrite(); } @@ -1706,7 +1706,7 @@ int H2ConnBase::processPendingStreams() } //if (getBuf()->size() > 0) - if (m_h2_flag & H2_CONN_FLAG_WANT_FLUSH) + if (m_h2flag & H2_CONN_FLAG_WANT_FLUSH) flush(); return wantWrite; } @@ -1768,7 +1768,7 @@ int H2ConnBase::processQueue() } //if (getBuf()->size() > 0) - if (m_h2_flag & H2_CONN_FLAG_WANT_FLUSH) + if (m_h2flag & H2_CONN_FLAG_WANT_FLUSH) flush(); return wantWrite; } diff --git a/src/h2/h2connbase.h b/src/h2/h2connbase.h index 68721d730..158bfbae5 100644 --- a/src/h2/h2connbase.h +++ b/src/h2/h2connbase.h @@ -33,22 +33,34 @@ #include "lshpack.h" +enum h2flag +{ + H2_CONN_FLAG_GOAWAY = (1<<0), + H2_CONN_FLAG_PREFACE = (1<<1), + H2_CONN_FLAG_SETTING_RCVD = (1<<2), + H2_CONN_FLAG_SETTING_SENT = (1<<3), + H2_CONN_FLAG_CONFIRMED = (1<<4), + H2_CONN_FLAG_FLOW_CTRL = (1<<5), + H2_CONN_HEADERS_START = (1<<6), + H2_CONN_FLAG_WAIT_PROCESS = (1<<7), + H2_CONN_FLAG_NO_PUSH = (1<<8), + H2_CONN_FLAG_WANT_FLUSH = (1<<9), + H2_CONN_FLAG_IN_EVENT = (1<<10), + H2_CONN_FLAG_PAUSE_READ = (1<<11), + H2_CONN_FLAG_DIRECT_BUF = (1<<12), + H2_CONN_FLAG_AUTO_RECYCLE = (1<<13), + H2_CONN_FLAG_PENDING_STREAM = (1<<14), +}; + +inline enum h2flag operator|(enum h2flag a, enum h2flag b) +{ + return static_cast((uint)a | (uint)b); +} +inline enum h2flag operator~(enum h2flag a) +{ + return static_cast(~(uint)a); +} -#define H2_CONN_FLAG_GOAWAY (1<<0) -#define H2_CONN_FLAG_PREFACE (1<<1) -#define H2_CONN_FLAG_SETTING_RCVD (1<<2) -#define H2_CONN_FLAG_SETTING_SENT (1<<3) -#define H2_CONN_FLAG_CONFIRMED (1<<4) -#define H2_CONN_FLAG_FLOW_CTRL (1<<5) -#define H2_CONN_HEADERS_START (1<<6) -#define H2_CONN_FLAG_WAIT_PROCESS (1<<7) -#define H2_CONN_FLAG_NO_PUSH (1<<8) -#define H2_CONN_FLAG_WANT_FLUSH (1<<9) -#define H2_CONN_FLAG_IN_EVENT (1<<10) -#define H2_CONN_FLAG_PAUSE_READ (1<<11) -#define H2_CONN_FLAG_DIRECT_BUF (1<<12) -#define H2_CONN_FLAG_AUTO_RECYCLE (1<<13) -#define H2_CONN_FLAG_PENDING_STREAM (1<<14) #define H2_STREAM_PRIORITYS (8) @@ -112,13 +124,13 @@ class H2ConnBase: public BufferedOS void needWriteEvent() { - if ((m_h2_flag & H2_CONN_FLAG_IN_EVENT) == 0) + if ((m_h2flag & H2_CONN_FLAG_IN_EVENT) == 0) { if (isEmpty()) continueWrite(); } else - m_h2_flag |= H2_CONN_FLAG_WAIT_PROCESS; + set_h2flag(H2_CONN_FLAG_WAIT_PROCESS); } virtual int onWriteEx2() = 0; @@ -126,18 +138,25 @@ class H2ConnBase: public BufferedOS virtual int decodeHeaders(uint32_t id, unsigned char *src, int length, unsigned char iHeaderFlag) = 0; + void set_h2flag(h2flag flag) + { + m_h2flag = m_h2flag | flag; } + void clr_h2flag(h2flag flag) + { + m_h2flag = (enum h2flag)(m_h2flag & (~flag)); } + void wantFlush() { - if ((m_h2_flag & H2_CONN_FLAG_IN_EVENT)) - m_h2_flag |= H2_CONN_FLAG_WANT_FLUSH; + if ((m_h2flag & H2_CONN_FLAG_IN_EVENT)) + set_h2flag(H2_CONN_FLAG_WANT_FLUSH); else continueWrite(); } void wantFlush2() { - if ((m_h2_flag & H2_CONN_FLAG_IN_EVENT)) - m_h2_flag |= H2_CONN_FLAG_WANT_FLUSH; + if ((m_h2flag & H2_CONN_FLAG_IN_EVENT)) + set_h2flag(H2_CONN_FLAG_WANT_FLUSH); else if (getBuf()->empty()) continueWrite(); } @@ -175,9 +194,9 @@ class H2ConnBase: public BufferedOS { return m_iPeerMaxFrameSize; } - int sendHeaderContFrame(uint32_t uiStreamID, uint8_t flag, + int sendHeaderContFrame(uint32_t uiStreamID, uint8_t flag, H2FrameType type, const char *pBuf, int size); - + int sendWindowUpdateFrame(uint32_t id, int32_t delta) { return sendFrame4Bytes(H2_FRAME_WINDOW_UPDATE, id, delta, true); } @@ -216,7 +235,7 @@ class H2ConnBase: public BufferedOS int getWeightedPriority(H2StreamBase* s); bool isDirectBuffer() const - { return m_h2_flag & H2_CONN_FLAG_DIRECT_BUF; } + { return m_h2flag & H2_CONN_FLAG_DIRECT_BUF; } virtual ssize_t directBuffer(const char *data, size_t size) { return -1; } @@ -326,10 +345,10 @@ class H2ConnBase: public BufferedOS int32_t m_tmIdleBegin; uint32_t m_pendingStreamId; + enum h2flag m_h2flag; uint16_t m_pendingOutSize; uint16_t m_pendingUsed; short m_iControlFrames; - short m_h2_flag; char m_inputState; uint8_t m_padLen; H2FrameHeader m_curH2Header; diff --git a/src/h2/h2connection.cpp b/src/h2/h2connection.cpp index dcdd9a140..6937a1fcb 100644 --- a/src/h2/h2connection.cpp +++ b/src/h2/h2connection.cpp @@ -79,7 +79,7 @@ HioHandler *H2Connection::get() int H2Connection::onInitConnected() { if (getStream()->isWriteBuffer()) - m_h2_flag |= H2_CONN_FLAG_DIRECT_BUF; + set_h2flag(H2_CONN_FLAG_DIRECT_BUF); setOS(getStream()); getStream()->continueRead(); return 0; @@ -94,16 +94,16 @@ H2Connection::~H2Connection() int H2Connection::onReadEx() { int ret; - m_h2_flag &= ~(H2_CONN_FLAG_WAIT_PROCESS | H2_CONN_FLAG_PENDING_STREAM); - m_h2_flag |= H2_CONN_FLAG_IN_EVENT; + clr_h2flag(H2_CONN_FLAG_WAIT_PROCESS | H2_CONN_FLAG_PENDING_STREAM); + set_h2flag(H2_CONN_FLAG_IN_EVENT); ret = onReadEx2(); - if (isPauseWrite() && (m_h2_flag & H2_CONN_FLAG_PENDING_STREAM)) + if (isPauseWrite() && (m_h2flag & H2_CONN_FLAG_PENDING_STREAM)) processPendingStreams(); - if ((m_h2_flag & H2_CONN_FLAG_WAIT_PROCESS) != 0) + if ((m_h2flag & H2_CONN_FLAG_WAIT_PROCESS) != 0) onWriteEx2(); - m_h2_flag &= ~H2_CONN_FLAG_IN_EVENT; + clr_h2flag(H2_CONN_FLAG_IN_EVENT); //if (getBuf()->size() > 0) - if (m_h2_flag & H2_CONN_FLAG_WANT_FLUSH) + if (m_h2flag & H2_CONN_FLAG_WANT_FLUSH) flush(); return ret; } @@ -141,7 +141,7 @@ int H2Connection::decodeHeaders(uint32_t id, unsigned char *pSrc, int length, pStream->setFlag(HIO_FLAG_INIT_SESS, 1); add2PriorityQue(pStream); - m_h2_flag |= H2_CONN_FLAG_PENDING_STREAM; + set_h2flag(H2_CONN_FLAG_PENDING_STREAM); //pStream->onInitConnected(NULL, 0); //if (pStream->getState() != HIOS_CONNECTED) // recycleStream(pStream->getStreamID()); @@ -205,12 +205,12 @@ H2StreamBase *H2Connection::getNewStream(uint8_t ubH2_Flags) m_mapStream.insert(pStream); if (m_tmIdleBegin) m_tmIdleBegin = 0; - uint32_t flag = (ubH2_Flags & H2_CTRL_FLAG_FIN) | HIO_FLAG_FLOWCTRL - | HIO_FLAG_SENDFILE | HIO_FLAG_WRITE_BUFFER; - if (!(m_h2_flag & H2_CONN_FLAG_NO_PUSH)) - flag |= HIO_FLAG_PUSH_CAPABLE; + enum stream_flag flag = (enum stream_flag)(ubH2_Flags & H2_CTRL_FLAG_FIN) + | HIO_FLAG_FLOWCTRL | HIO_FLAG_SENDFILE | HIO_FLAG_WRITE_BUFFER; + if (!(m_h2flag & H2_CONN_FLAG_NO_PUSH)) + flag = flag | HIO_FLAG_PUSH_CAPABLE; if (getStream()->getFlag(HIO_FLAG_ALTSVC_SENT)) - flag |= HIO_FLAG_ALTSVC_SENT; + flag = flag | HIO_FLAG_ALTSVC_SENT; pStream->setFlag(flag, 1); pStream->init(this, &m_priority); pStream->setConnInfo(getStream()->getConnInfo()); @@ -235,11 +235,11 @@ int H2Connection::h2cUpgrade(HioHandler *pSession, const char * pBuf, int size) pStream->set_key(1); //Through upgrade h2c, it is 1. m_mapStream.insert(pStream); - uint32_t flag = HIO_FLAG_FLOWCTRL | HIO_FLAG_WRITE_BUFFER; - if (!(m_h2_flag & H2_CONN_FLAG_NO_PUSH)) - flag |= HIO_FLAG_PUSH_CAPABLE; + enum stream_flag flag = HIO_FLAG_FLOWCTRL | HIO_FLAG_WRITE_BUFFER; + if (!(m_h2flag & H2_CONN_FLAG_NO_PUSH)) + flag = flag | HIO_FLAG_PUSH_CAPABLE; if (getStream()->getFlag(HIO_FLAG_ALTSVC_SENT)) - flag |= HIO_FLAG_ALTSVC_SENT; + flag = flag | HIO_FLAG_ALTSVC_SENT; pStream->setFlag(flag, 1); pStream->init(this, NULL); onInitConnected(); @@ -283,7 +283,7 @@ int H2Connection::flush() getStream()->setFlag(HIO_FLAG_PAUSE_WRITE, 1); } else - m_h2_flag &= ~H2_CONN_FLAG_WANT_FLUSH; + clr_h2flag(H2_CONN_FLAG_WANT_FLUSH); return getStream()->flush(); } @@ -304,7 +304,7 @@ int H2Connection::onCloseEx() int H2Connection::onTimerEx() { int result = 0; - if (m_h2_flag & H2_CONN_FLAG_GOAWAY) + if (m_h2flag & H2_CONN_FLAG_GOAWAY) { result = releaseAllStream(); getStream()->handlerReadyToRelease(); @@ -330,7 +330,7 @@ int H2Connection::doGoAway(H2ErrorCode status) sendGoAwayFrame(status); getStream()->handlerReadyToRelease(); getStream()->tobeClosed(); - if ((m_h2_flag & H2_CONN_FLAG_IN_EVENT) == 0) + if ((m_h2flag & H2_CONN_FLAG_IN_EVENT) == 0) getStream()->continueWrite(); return 0; } @@ -387,7 +387,7 @@ H2StreamBase* H2Connection::createPushStream(uint32_t pushStreamId, m_mapStream.insert(pStream); if (m_tmIdleBegin) m_tmIdleBegin = 0; - uint32_t flag = HIO_FLAG_PEER_SHUTDOWN | HIO_FLAG_FLOWCTRL + enum stream_flag flag = HIO_FLAG_PEER_SHUTDOWN | HIO_FLAG_FLOWCTRL | HIO_FLAG_INIT_SESS | HIO_FLAG_IS_PUSH | HIO_FLAG_WRITE_BUFFER | HIO_FLAG_WANT_WRITE | HIO_FLAG_ALTSVC_SENT; @@ -458,7 +458,7 @@ int H2Connection::onWriteEx2() return 1; } else - m_h2_flag |= H2_CONN_FLAG_WANT_FLUSH; + set_h2flag(H2_CONN_FLAG_WANT_FLUSH); } if (getStream()->isPauseWrite()) { @@ -476,16 +476,16 @@ int H2Connection::onWriteEx2() int H2Connection::onWriteEx() { - m_h2_flag |= H2_CONN_FLAG_IN_EVENT; + set_h2flag(H2_CONN_FLAG_IN_EVENT); int wantWrite = onWriteEx2(); - m_h2_flag &= ~H2_CONN_FLAG_IN_EVENT; + clr_h2flag(H2_CONN_FLAG_IN_EVENT); if ((wantWrite == 0 || m_iCurDataOutWindow <= 0) && isEmpty()) { getStream()->suspendWrite(); - if (m_h2_flag & H2_CONN_FLAG_PAUSE_READ) + if (m_h2flag & H2_CONN_FLAG_PAUSE_READ) { - m_h2_flag &= ~H2_CONN_FLAG_PAUSE_READ; + clr_h2flag(H2_CONN_FLAG_PAUSE_READ); getStream()->continueRead(); } } diff --git a/src/h2/unpackedheaders.cpp b/src/h2/unpackedheaders.cpp index 44c4d3bc8..897f66b26 100644 --- a/src/h2/unpackedheaders.cpp +++ b/src/h2/unpackedheaders.cpp @@ -1503,7 +1503,8 @@ lsxpack_header_t *UpkdHdrBuilder::prepareDecode(lsxpack_header_t *hdr, if ((size_t)headers->m_buf->available() < mini_buf_size + 2) { - if (headers->m_buf->size() + mini_buf_size >= MAX_BUF_SIZE) + size_t increase_to = (mini_buf_size + 2 + 255) & (~255); + if (increase_to >= MAX_BUF_SIZE) { if (hdr && hdr == working) { @@ -1512,7 +1513,6 @@ lsxpack_header_t *UpkdHdrBuilder::prepareDecode(lsxpack_header_t *hdr, } return NULL; } - size_t increase_to = (mini_buf_size + 2 + 255) & (~255); if (headers->m_buf->guarantee(increase_to) == -1) return NULL; assert((size_t)headers->m_buf->available() >= mini_buf_size + 2); diff --git a/src/http/authuser.cpp b/src/http/authuser.cpp index ac7a38e5a..167de5a1f 100644 --- a/src/http/authuser.cpp +++ b/src/http/authuser.cpp @@ -83,12 +83,13 @@ int AuthUser::addGroup(const char *pGroup) void AuthUser::updatePasswdEncMethod() { - if (strncmp(m_passwd.c_str(), "$apr1$", 6) == 0) + const char *pass = m_passwd.c_str(); + if (strncmp(pass, "$apr1$", 6) == 0) setEncMethod(ENCRYPT_APMD5); - else if (strncasecmp(m_passwd.c_str(), "{sha}", 5) == 0) + else if (strncasecmp(pass, "{sha}", 5) == 0) { char buf[128]; - const char *p = m_passwd.c_str() + 5; + const char *p = pass + 5; int len = ls_base64_decode(p, strlen(p), buf); if (len == 20) { @@ -96,6 +97,10 @@ void AuthUser::updatePasswdEncMethod() setEncMethod(ENCRYPT_SHA); } } + else if (pass[0] == '$' && pass[1] == '2' && pass[3] == '$' + && (pass[2] == 'y' || pass[2] == 'a')) + setEncMethod(ENCRYPT_BCRYPT); + } diff --git a/src/http/authuser.h b/src/http/authuser.h index a291e36dd..4782ff796 100644 --- a/src/http/authuser.h +++ b/src/http/authuser.h @@ -26,7 +26,7 @@ class StringList; -enum +enum htpss_enc_type { ENCRYPT_UNKNOWN, ENCRYPT_PLAIN, @@ -35,14 +35,15 @@ enum ENCRYPT_APMD5, ENCRYPT_SHA, ENCRYPT_SMD5, - ENCRYPT_SSHA + ENCRYPT_SSHA, + ENCRYPT_BCRYPT, }; class AuthData : public KeyData { - long m_lTimestamp; - short m_exist; - short m_encMethod; + long m_lTimestamp; + short m_exist; + htpss_enc_type m_encMethod:16; public: AuthData() : m_lTimestamp(0) @@ -53,13 +54,13 @@ class AuthData : public KeyData long getTimestamp() const { return m_lTimestamp; } - void setTimestamp(long stamp) { m_lTimestamp = stamp; } + void setTimestamp(long stamp) { m_lTimestamp = stamp; } short isExist() const { return m_exist; } - void setExist(short exist) { m_exist = exist; } + void setExist(short exist) { m_exist = exist; } short getEncMethod() const { return m_encMethod; } - void setEncMethod(short m) { m_encMethod = m; } + void setEncMethod(htpss_enc_type m) { m_encMethod = m; } LS_NO_COPY_ASSIGN(AuthData); }; diff --git a/src/http/contexttree.cpp b/src/http/contexttree.cpp index 18c2a6b7f..370243950 100644 --- a/src/http/contexttree.cpp +++ b/src/http/contexttree.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -82,7 +83,13 @@ int ContextTree::add(HttpContext *pContext) const HttpContext *ContextTree::bestMatch(const char *pURI, int iUriLen) const { - return (HttpContext *)m_pURITree->bestMatch(pURI, iUriLen); + const HttpContext *pContext = (HttpContext *)m_pURITree->bestMatch(pURI, iUriLen); + if (!pContext) + { + LS_DBG("ContextTree::bestMatch %.*s return NULL (m_iFlags_NoContext %d)", + iUriLen, pURI, m_pURITree->getNoContext()); + } + return pContext; } diff --git a/src/http/hiostream.h b/src/http/hiostream.h index 596aec305..818ea0a3b 100644 --- a/src/http/hiostream.h +++ b/src/http/hiostream.h @@ -44,17 +44,7 @@ class UnpackedHeaders; #define HIOS_SHUTDOWN SS_SHUTDOWN #define HIOS_RESET SS_RESET -enum HiosProtocol -{ - HIOS_PROTO_HTTP = 0, - HIOS_PROTO_SPDY2 = 1, - HIOS_PROTO_SPDY3 = 2, - HIOS_PROTO_SPDY31 = 3, - HIOS_PROTO_HTTP2 = 4, - HIOS_PROTO_QUIC = 5, - HIOS_PROTO_HTTP3 = 6, - HIOS_PROTO_MAX -}; +#define HiosProtocol stream_protocol #define HIO_FLAG_PEER_SHUTDOWN SS_FLAG_PEER_SHUTDOWN #define HIO_FLAG_LOCAL_SHUTDOWN SS_FLAG_LOCAL_SHUTDOWN @@ -67,18 +57,18 @@ enum HiosProtocol #define HIO_EVENT_PROCESSING SS_EVENT_PROCESSING #define HIO_FLAG_DELAY_FLUSH SS_FLAG_DELAY_FLUSH #define HIO_FLAG_WRITE_BUFFER SS_FLAG_WRITE_BUFFER -#define HIO_FLAG_BLACK_HOLE (1<<11) -#define HIO_FLAG_FROM_LOCAL (1<<12) -#define HIO_FLAG_PUSH_CAPABLE (1<<13) -#define HIO_FLAG_INIT_SESS (1<<14) -#define HIO_FLAG_IS_PUSH (1<<15) -#define HIO_FLAG_PASS_THROUGH (1<<16) -#define HIO_FLAG_SENDFILE (1<<17) -#define HIO_FLAG_FLOWCTRL (1<<18) -#define HIO_FLAG_PRI_SET (1<<19) -#define HIO_FLAG_ALTSVC_SENT (1<<20) -#define HIO_FLAG_PASS_SETCOOKIE (1<<21) -#define HIO_FLAG_RESP_HEADER_SENT (1<<22) +#define HIO_FLAG_BLACK_HOLE SS_FLAG_BLACK_HOLE +#define HIO_FLAG_FROM_LOCAL SS_FLAG_FROM_LOCAL +#define HIO_FLAG_PUSH_CAPABLE SS_FLAG_PUSH_CAPABLE +#define HIO_FLAG_INIT_SESS SS_FLAG_INIT_SESS +#define HIO_FLAG_IS_PUSH SS_FLAG_IS_PUSH +#define HIO_FLAG_PASS_THROUGH SS_FLAG_PASS_THROUGH +#define HIO_FLAG_SENDFILE SS_FLAG_SENDFILE +#define HIO_FLAG_FLOWCTRL SS_FLAG_FLOWCTRL +#define HIO_FLAG_PRI_SET SS_FLAG_PRI_SET +#define HIO_FLAG_ALTSVC_SENT SS_FLAG_ALTSVC_SENT +#define HIO_FLAG_PASS_SETCOOKIE SS_FLAG_PASS_SETCOOKIE +#define HIO_FLAG_RESP_HEADER_SENT SS_FLAG_RESP_HEADER_SENT #define HIO_EOR 1 @@ -231,7 +221,7 @@ class HioStream : virtual public LogSession } const ls_str_t *getProtocolName() const - { return getProtocolName((HiosProtocol)getProtocol()); } + { return getProtocolName(getProtocol()); } static const ls_str_t *getProtocolName(HiosProtocol proto); diff --git a/src/http/httpdefs.h b/src/http/httpdefs.h index 5ea46e55d..9c0460c8f 100644 --- a/src/http/httpdefs.h +++ b/src/http/httpdefs.h @@ -32,10 +32,10 @@ #define MAX_DYN_RESP_LEN LLONG_MAX #define MAX_DYN_RESP_HEADER_LEN 131072 -#define DEFAULT_URL_LEN 32768 -#define DEFAULT_REQ_HEADER_BUF_LEN 65536 +#define DEFAULT_URL_LEN 8192 +#define DEFAULT_REQ_HEADER_BUF_LEN 32768 #define DEFAULT_REQ_BODY_LEN (2047 * 1024 * 1024) -#define DEFAULT_DYN_RESP_HEADER_LEN 65536 +#define DEFAULT_DYN_RESP_HEADER_LEN 32768 #define DEFAULT_DYN_RESP_LEN (2047 * 1024 * 1024) #define DEFAULT_CONN_LOW_MARK 5 diff --git a/src/http/httpextconnector.cpp b/src/http/httpextconnector.cpp index 0852f26c9..7bf058055 100644 --- a/src/http/httpextconnector.cpp +++ b/src/http/httpextconnector.cpp @@ -649,6 +649,17 @@ void HttpExtConnector::suspend() getHttpSession()->suspendEventNotify(); } +int HttpExtConnector::processCompleteRespHeader() +{ + const char *pEnd = m_respHeaderBuf.end(); + while (pEnd[-1] == '\0') + --pEnd; + int ret = HttpCgiTool::processHeaderLine(this, + m_respHeaderBuf.begin(), pEnd); + m_respHeaderBuf.clear(); + return ret; + +} void HttpExtConnector::extProcessorError(int errCode) { diff --git a/src/http/httpextconnector.h b/src/http/httpextconnector.h index e173eb080..be6e4708c 100644 --- a/src/http/httpextconnector.h +++ b/src/http/httpextconnector.h @@ -134,6 +134,12 @@ class HttpExtConnector : public ReqHandler, public ExtRequest int isAlive(); void suspend(); + int appendPartialHeader(char *pBuf, int len) + { return m_respHeaderBuf.append(pBuf, len); } + int getPartialHeaderLen() const + { return m_respHeaderBuf.size(); } + int processCompleteRespHeader(); + char *getRespBuf(size_t &len); int reqHeaderDone(); diff --git a/src/http/httplog.cpp b/src/http/httplog.cpp index 66bf153c5..e3cfa3d06 100644 --- a/src/http/httplog.cpp +++ b/src/http/httplog.cpp @@ -55,6 +55,13 @@ void HttpLog::parse_error(const char *pCurLine, const char *pError) } +void HttpLog::parse_warn(const char *pCurLine, const char *pError) +{ + LS_WARN(s_pCurLogger, "[%s] rewrite: %s while parsing: %s", + s_pLogId, pError, pCurLine); +} + + void HttpLog::setCurLogger(LOG4CXX_NS::Logger *pLogger, const char *pId) { s_pCurLogger = pLogger; diff --git a/src/http/httplog.h b/src/http/httplog.h index 42ff80ae9..d78f1048a 100644 --- a/src/http/httplog.h +++ b/src/http/httplog.h @@ -107,6 +107,7 @@ class HttpLog static void perror(const char *pStr, const char *pError); static void setCurLogger(LOG4CXX_NS::Logger *pLogger, const char *pId); static void parse_error(const char *pCurLine, const char *pError); + static void parse_warn(const char *pCurLine, const char *pError); LS_NO_COPY_ASSIGN(HttpLog); }; diff --git a/src/http/httprespheaders.cpp b/src/http/httprespheaders.cpp index ba12d890f..a367148fd 100644 --- a/src/http/httprespheaders.cpp +++ b/src/http/httprespheaders.cpp @@ -380,7 +380,6 @@ int HttpRespHeaders::appendHeader(lsxpack_header *pKv, int hdr_idx, const char * pUpdKv->name_offset = m_buf.size(); pUpdKv->name_len = len; pUpdKv->app_index = hdr_idx; - pUpdKv->val_offset = pUpdKv->name_offset + nameLen + 2; if (hdr_idx != H_HEADER_END) pUpdKv->flags = (lsxpack_flag)(pUpdKv->flags | LSXPACK_APP_IDX); appendLowerCase(m_buf.end(), pName, len); @@ -394,6 +393,7 @@ int HttpRespHeaders::appendHeader(lsxpack_header *pKv, int hdr_idx, const char * m_buf.append_unsafe(','); //for append and merge case ++ pUpdKv->val_len; } + pUpdKv->val_offset = pUpdKv->name_offset + nameLen + 2; m_buf.append_unsafe(pVal, valLen); m_buf.append_unsafe('\r'); m_buf.append_unsafe('\n'); @@ -2004,14 +2004,20 @@ lsxpack_err_code UpkdRespHdrBuilder::process(lsxpack_header *hdr) HttpCgiTool::processStatusCode(connector, code); } else + { + headers->m_working = NULL; return LSXPACK_ERR_UNNEC_REQ_PSDO_HDR; + } } else { if (!regular_header) { if (!headers->getHttpCode()) + { + headers->m_working = NULL; return LSXPACK_ERR_INCOMPL_REQ_PSDO_HDR; + } regular_header = true; } if (idx == UPK_HDR_UNKNOWN) @@ -2019,9 +2025,17 @@ lsxpack_err_code UpkdRespHdrBuilder::process(lsxpack_header *hdr) idx = HttpRespHeaders::getIndex(name, hdr->name_len); for(const char *p = name; p < name + hdr->name_len; ++p) if (isupper(*p)) + { + headers->m_working = NULL; return LSXPACK_ERR_UPPERCASE_HEADER; + } if (idx == HttpRespHeaders::H_CONNECTION) - return LSXPACK_ERR_BAD_REQ_HEADER; + { + headers->m_working = NULL; + // Ignore it silently is better way to handle it. + return LSXPACK_OK; + //return LSXPACK_ERR_BAD_REQ_HEADER; + } if (idx != HttpRespHeaders::H_UNKNOWN) { hdr->app_index = idx; @@ -2030,7 +2044,10 @@ lsxpack_err_code UpkdRespHdrBuilder::process(lsxpack_header *hdr) } total_size += hdr->name_len + hdr->val_len + 4; if (total_size >= 65535) + { + headers->m_working = NULL; return LSXPACK_ERR_HEADERS_TOO_LARGE; + } if (!connector || HttpCgiTool::processHeaderLine2(connector, idx, name, hdr->name_len, val, hdr->val_len) == 1) { diff --git a/src/http/httpsession.cpp b/src/http/httpsession.cpp index 2b29c35d0..bc601e959 100644 --- a/src/http/httpsession.cpp +++ b/src/http/httpsession.cpp @@ -490,6 +490,7 @@ void HttpSession::resumeSSI() void HttpSession::nextRequest() { + LS_DBG_M(getLogSession(), "calling removeSessionCb on this %p\n", this); EvtcbQue::getInstance().removeSessionCb(this); LS_DBG_L(getLogSession(), "HttpSession::nextRequest()!"); @@ -500,9 +501,6 @@ void HttpSession::nextRequest() incReqProcessed(); } - LS_DBG_M(getLogSession(), "calling removeSessionCb on this %p\n", this); - EvtcbQue::getInstance().removeSessionCb(this); - getStream()->flush(); setState(HSS_WAITING); @@ -547,7 +545,7 @@ void HttpSession::nextRequest() m_lReqTime = DateTime::s_curTime; m_iReqTimeUs = DateTime::s_curTimeUs; - m_sendFileInfo.release(); + m_response.reset(); m_request.reset(1); releaseMtSessData(); @@ -4562,6 +4560,27 @@ void HttpSession::processServerPush() } +int HttpSession::addExpiresHeader() +{ + int ret; + const ExpiresCtrl *pExpireDefault = getReq()->shouldAddExpires(); + if (pExpireDefault && pExpireDefault->isEnabled()) + { + const MimeSetting *pMime = getReq()->getMimeType(); + if (pMime->getExpires()->getBase()) + pExpireDefault = pMime->getExpires(); + if (pExpireDefault->getBase()) + { + ret = getResp()->addExpiresHeader(m_sendFileInfo.getFileData() + ->getLastMod(), pExpireDefault); + if (ret) + return ret; + } + } + return LS_OK; +} + + int HttpSession::sendRespHeaders() { if (!getFlag(HSF_RESP_HEADER_DONE)) diff --git a/src/http/httpsession.h b/src/http/httpsession.h index 83d5afb60..b4be62303 100644 --- a/src/http/httpsession.h +++ b/src/http/httpsession.h @@ -728,6 +728,7 @@ class HttpSession void setSendFileBeginEnd(off_t start, off_t end); void prepareHeaders(); int sendRespHeaders(); + int addExpiresHeader(); void addLocationHeader(); void setAccessLogOff() { setFlag(HSF_ACCESS_LOG_OFF); } diff --git a/src/http/ntwkiolink.cpp b/src/http/ntwkiolink.cpp index b22e26bf9..53a1a8a25 100644 --- a/src/http/ntwkiolink.cpp +++ b/src/http/ntwkiolink.cpp @@ -440,6 +440,8 @@ int NtwkIOLink::handleEvents(short evt) case HIOS_SHUTDOWN: closeSocket(); break; + default: + break; } return 0; } diff --git a/src/http/rewriterule.cpp b/src/http/rewriterule.cpp index 745c2ac24..9681b1d40 100644 --- a/src/http/rewriterule.cpp +++ b/src/http/rewriterule.cpp @@ -608,6 +608,13 @@ int RewriteRule::parseRuleSubst(const char *&pRuleStr, const char *pEnd, return LS_FAIL; } + if (strncmp(argBegin, "–", argEnd - argBegin) == 0) + { + HttpLog::parse_warn(s_pCurLine, + "Detects unicode '-', repaces with ascii '-'."); + m_flag |= RULE_FLAG_NOREWRITE; + return 0; + } if (strncmp(argBegin, "-", argEnd - argBegin) == 0) { m_flag |= RULE_FLAG_NOREWRITE; diff --git a/src/http/staticfilehandler.cpp b/src/http/staticfilehandler.cpp index 1ffdbf3ce..6a38da1b9 100644 --- a/src/http/staticfilehandler.cpp +++ b/src/http/staticfilehandler.cpp @@ -131,7 +131,7 @@ static int processFlvStream(HttpSession *pSession, off_t start) { HttpResp *pResp = pSession->getResp(); pSession->resetResp(); - + pSession->addExpiresHeader(); pResp->parseAdd(pData->getFileData()->getHeaderBuf(), pData->getFileData()->getHeaderLen()); @@ -352,6 +352,8 @@ int processH264Stream(HttpSession *pSession, double start) pSession->resetResp(); + pSession->addExpiresHeader(); + off_t contentLen = 0; if (calcMoovContentLen(pSession, contentLen) == -1) { @@ -550,14 +552,7 @@ int StaticFileHandler::process(HttpSession *pSession, break; case SC_200: { - const ExpiresCtrl *pExpireDefault = pReq->shouldAddExpires(); - if (pExpireDefault) - { - ret = pResp->addExpiresHeader(pCache->getLastMod(), - pExpireDefault); - if (ret) - return ret; - } + pSession->addExpiresHeader(); if (pReq->getRedirHdrs()) { pResp->parseAdd(pReq->getRedirHdrs(), @@ -661,7 +656,7 @@ static int buildRangeHeaders(HttpSession *pSession, HttpRange &range) StaticFileCacheData *pData = pData1->getFileData(); off_t bodyLen; HttpRespHeaders &buf = pResp->getRespHeaders(); - + pSession->addExpiresHeader(); if (range.count() == 1) { const char *p = pData->getHeaderBuf(); diff --git a/src/http/userdir.cpp b/src/http/userdir.cpp index 341f4a2e3..800743079 100644 --- a/src/http/userdir.cpp +++ b/src/http/userdir.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #if !defined( __FreeBSD__ ) && \ !defined(macintosh) && !defined(__APPLE__) && !defined(__APPLE_CC__) @@ -32,7 +33,7 @@ #include #include #include - +#include UserDir::~UserDir() @@ -406,6 +407,55 @@ static int verifyApMD5(const char *pStored, const char *pPasswd) } +/* + * This is a best effort implementation. Nothing prevents a compiler from + * optimizing this function and making it vulnerable to timing attacks, but + * this method is commonly used in crypto libraries like NaCl. + * + * Return value is zero if both strings are equal and nonzero otherwise. +*/ +static int timing_safe_strcmp(const char *str1, const char *str2) +{ + const unsigned char *u1; + const unsigned char *u2; + int ret; + int i; + + int len1 = strlen(str1); + int len2 = strlen(str2); + + /* In our context both strings should always have the same length + * because they will be hashed passwords. */ + if (len1 != len2) + return 1; + + /* Force unsigned for bitwise operations. */ + u1 = (const unsigned char *)str1; + u2 = (const unsigned char *)str2; + + ret = 0; + for (i = 0; i < len1; ++i) + ret |= (u1[i] ^ u2[i]); + + return ret; +} + +extern "C" char *_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size); + +static int verifyBcrypt(const char *hash, const char *passwd) +{ + char outhash[BCRYPT_HASHSIZE]; + + char *aux; + aux = _crypt_blowfish_rn(passwd, hash, outhash, BCRYPT_HASHSIZE); + if (aux == NULL) + return -1; + + return timing_safe_strcmp(hash, outhash); +} + + int UserDir::authenticate(HttpSession *pSession, const char *pUserName, int len, const char *pPasswd, int encryptMethod, @@ -421,6 +471,9 @@ int UserDir::authenticate(HttpSession *pSession, const char *pUserName, const char *pStored = pUser->getPasswd(); // if (( encryptMethod == m_encryptMethod )|| // ( m_encryptMethod == AuthUser::ENCRYPT_UNKNOWN )) + + //LS_DBG("[UserDir::authenticate] EncMethod %d, pStored %s, passwd %s.", + // pUser->getEncMethod(), pStored, pPasswd); if (pStored) { switch (pUser->getEncMethod()) @@ -433,6 +486,7 @@ int UserDir::authenticate(HttpSession *pSession, const char *pUserName, case ENCRYPT_CRYPT: if (strcmp(pStored, crypt(pPasswd, pStored)) == 0) return 0; + LS_ERROR("[UserDir::authenticate] Failed in ENCRYPT_CRYPT type."); break; case ENCRYPT_MD5: if (verifyMD5(pStored, pPasswd, 0) == 0) @@ -454,6 +508,11 @@ int UserDir::authenticate(HttpSession *pSession, const char *pUserName, if (verifySHA(pStored, pPasswd, 1) == 0) return 0; break; + case ENCRYPT_BCRYPT: + if (verifyBcrypt(pStored, pPasswd) == 0) + return 0; + break; + } } return SC_401; diff --git a/src/main/httpserver.cpp b/src/main/httpserver.cpp index e26a254f9..e1dfc8fdb 100644 --- a/src/main/httpserver.cpp +++ b/src/main/httpserver.cpp @@ -493,8 +493,10 @@ int HttpServerImpl::authAdminReq(char *pAuth) *pEnd = 0; int ret = pRealm->authenticate(NULL, pUserName, nameLen, pPasswd, ENCRYPT_PLAIN, NULL); - if (ret != 0) + if (ret != 0) { + LS_DBG("[ADMIN] UserName %.*s, Password %s", nameLen, pUserName, pPasswd); LS_ERROR("[ADMIN] authentication failed!"); + } *pEnd = '\n'; return ret; } @@ -944,10 +946,12 @@ void HttpServerImpl::onTimerSecond() { HttpRespHeaders::updateDateHeader(); HttpLog::onTimer(); - ClientCache::getClientCache()->onTimer(); m_vhosts.onTimer(); if (m_lStartTime > 0) + { + ClientCache::getClientCache()->onTimer(); generateRTReport(); + } ServerInfo::getServerInfo()->setAdnsOp(1); Adns::getInstance().trimCache(); @@ -971,6 +975,12 @@ void HttpServerImpl::onTimer10Secs() void HttpServerImpl::onTimer30Secs() { + /*** + * When server is quiting, do nothing + */ + if (m_lStartTime <= 0) + return ; + ClientCache::getClientCache()->onTimer30Secs(); StaticFileCache::getInstance().onTimer(); m_vhosts.onTimer30Secs(); @@ -1270,11 +1280,16 @@ void HttpServerImpl::offsetChroot() void HttpServerImpl::releaseAll() { ExtAppRegistry::stopAll(); +#define TO_AVOID_EXIT_CRASH +#ifndef TO_AVOID_EXIT_CRASH StaticFileCache::getInstance().releaseAll(); +#endif m_listeners.clear(); m_oldListeners.clear(); m_toBeReleasedListeners.clear(); +#ifndef TO_AVOID_EXIT_CRASH m_vhosts.release_objects(); +#endif m_toBeReleasedVHosts.release_objects(); ::signal(SIGCHLD, SIG_DFL); ExtAppRegistry::shutdown(); diff --git a/src/main/lshttpdmain.cpp b/src/main/lshttpdmain.cpp index 7ede5d0d9..ab7dfc1dc 100644 --- a/src/main/lshttpdmain.cpp +++ b/src/main/lshttpdmain.cpp @@ -83,7 +83,7 @@ /*** * Do not change the below format, it will be set correctly while packing the code */ -#define BUILDTIME " (built: Thu Jul 9 13:51:56 UTC 2020)" +#define BUILDTIME " (built: Wed Aug 26 21:07:31 UTC 2020)" #define GlobalServerSessionHooks (LsiApiHooks::getServerSessionHooks()) @@ -1641,7 +1641,7 @@ int LshttpdMain::guardCrash() ret = ::poll(pfds, 3, 1000); if (ret > 0) { - LS_NOTICE("guardCrash poll return %d.", ret); + //LS_NOTICE("guardCrash poll return %d.", ret); if (pfds[0].revents && m_fdCmd != -1) processChildCmd(); else if (pfds[1].revents && m_fdAdmin != -1) diff --git a/src/modules/cache/cache.cpp b/src/modules/cache/cache.cpp index b9ba899ec..af7adb0c3 100644 --- a/src/modules/cache/cache.cpp +++ b/src/modules/cache/cache.cpp @@ -1725,7 +1725,7 @@ static int createEntry(lsi_param_t *rec) { clearHooks(rec->session); g_api->log(rec->session, LSI_LOG_DEBUG, - "[%s]createEntry quit, code 2.\n", ModuleNameStr); + "[%s]createEntry quit sue to internal error.\n", ModuleNameStr); return 0; } @@ -1767,7 +1767,7 @@ static int createEntry(lsi_param_t *rec) { clearHooks(rec->session); g_api->log(rec->session, LSI_LOG_DEBUG, - "[%s]createEntry abort, code 1.\n", ModuleNameStr); + "[%s]createEntry abort due to cache is set to OFF.\n", ModuleNameStr); return 0; } diff --git a/src/quic/quicengine.cpp b/src/quic/quicengine.cpp index ad7c5b2d7..2b88679ab 100644 --- a/src/quic/quicengine.cpp +++ b/src/quic/quicengine.cpp @@ -350,7 +350,10 @@ static int processUnpackedHeader(void *hdr_set, lsxpack_header_t *hdr) static void releaseUnpackedHeaders(void *hdr_set) { - delete (UpkdHdrBuilder *)hdr_set; + if ((long)hdr_set & 0x1L) + delete (UnpackedHeaders *)((long)hdr_set & ~0x1L); + else + delete (UpkdHdrBuilder *)hdr_set; } @@ -771,7 +774,7 @@ void QuicEngine::setDebugLog(int is_enable) void QuicEngine::maybeProcessConns() { int diff; - if (lsquic_engine_earliest_adv_tick(m_pEngine, &diff)) + if (lsquic_engine_earliest_adv_tick(m_pEngine, &diff) && diff <= 0) lsquic_engine_process_conns(m_pEngine); } @@ -794,3 +797,13 @@ int QuicEngine::nextEventTime() } return -1; } + +#if 0 +//test code +void testQuicEnginePointerHack() +{ + UnpackedHeaders *hdrs = new UnpackedHeaders(); + void *p = (void *)((long)hdrs | 0x1); + releaseUnpackedHeaders(p); +} +#endif diff --git a/src/quic/quicstream.cpp b/src/quic/quicstream.cpp index 6cae2882f..846363a9e 100644 --- a/src/quic/quicstream.cpp +++ b/src/quic/quicstream.cpp @@ -52,12 +52,14 @@ int QuicStream::init(lsquic_stream_t *s) else setProtocol(HIOS_PROTO_QUIC); - int flag = HIO_FLAG_FLOWCTRL; + enum stream_flag flag = HIO_FLAG_FLOWCTRL; /* Turn on the push capable flag: check it when push() is called and * unset it if necessary. */ - if (!lsquic_stream_is_pushed(m_pStream)) - flag |= HIO_FLAG_PUSH_CAPABLE; + if (lsquic_stream_is_pushed(m_pStream)) + flag = flag | HIO_FLAG_IS_PUSH; + else + flag = flag | HIO_FLAG_PUSH_CAPABLE; setFlag(flag, 1); setState(HIOS_CONNECTED); @@ -83,8 +85,8 @@ int QuicStream::processHdrSet(void *hdr_set) { UnpackedHeaders *hdrs; assert(hdr_set); - if (lsquic_stream_is_pushed(m_pStream)) - hdrs = (UnpackedHeaders *)hdr_set; + if ((long)hdr_set & 0x1L) + hdrs = (UnpackedHeaders *)((long)hdr_set & ~0x1L); else { UpkdHdrBuilder *builder = (UpkdHdrBuilder *)hdr_set; @@ -280,7 +282,8 @@ int QuicStream::push(UnpackedHeaders *hdrs) hdrs->prepareSendXpack(getProtocol() == HIOS_PROTO_HTTP3); headers.headers = (lsxpack_header *)hdrs->begin(); headers.count = hdrs->end() - hdrs->begin(); - pushed = lsquic_conn_push_stream(pConn, hdrs, m_pStream, &headers); + pushed = lsquic_conn_push_stream(pConn, (void *)((long)hdrs | 0x1L), + m_pStream, &headers); if (pushed == 0) return 0; @@ -423,6 +426,13 @@ int QuicStream::onWrite() int QuicStream::onClose() { LS_DBG_L(this, "QuicStream::onClose()"); + if (getFlag() & HIO_FLAG_IS_PUSH) + { + UnpackedHeaders *hdrs; + hdrs = (UnpackedHeaders *)lsquic_stream_get_hset(m_pStream); + if (hdrs) + delete hdrs; + } if (getHandler()) getHandler()->onCloseEx(); m_pStream = NULL; diff --git a/src/shm/lsshm.h b/src/shm/lsshm.h index e9aaf77cd..5f9d02874 100644 --- a/src/shm/lsshm.h +++ b/src/shm/lsshm.h @@ -192,6 +192,7 @@ class LsShm : public ls_shm_s LsShmOffset_t xdataOffset() const { return (LsShmOffset_t)s_iShmHdrSize; } LsShmLock *getLocks() { return &m_locks; } + ls_shmlock_t *getMainLock() { return m_pShmLock; } LsShmOffset_t allocLock() { return m_locks.allocLock(); } int freeLock(ls_shmlock_t *pLock) { return m_locks.freeLock(pLock); } diff --git a/src/shm/lsshmhash.cpp b/src/shm/lsshmhash.cpp index 86737743a..6b1aec85b 100644 --- a/src/shm/lsshmhash.cpp +++ b/src/shm/lsshmhash.cpp @@ -698,8 +698,8 @@ int LsShmHash::rehash() LsShmSize_t newSize; LsShmOffset_t newIdxOff; LsShmOffset_t newBitOff; - LsShmHIterOff *pIdxOld; - LsShmHIterOff *pIdxNew; + LsShmHIterOff *pOldTbl; + LsShmHIterOff *pNewTbl; LsShmHIterOff *opIdx; LsShmHIterOff *npIdx; iterator iter; @@ -717,25 +717,24 @@ int LsShmHash::rehash() ); #endif LsShmHTable *pTable = getHTable(); - pIdxOld = (LsShmHIterOff *)m_pPool->offset2ptr(pTable->x_iHIdx); + pOldTbl = (LsShmHIterOff *)m_pPool->offset2ptr(pTable->x_iHIdx); if (pTable->x_iHIdx != pTable->x_iHIdxNew) // rehash in progress { newSize = pTable->x_iCapacityNew; newIdxOff = pTable->x_iHIdxNew; - pIdxNew = (LsShmHIterOff *)m_pPool->offset2ptr(newIdxOff); + pNewTbl = (LsShmHIterOff *)m_pPool->offset2ptr(newIdxOff); if ((iterOff.m_iOffset = pTable->x_iWorkIterOff) != 0) // iter in progress { iter = offset2iterator(iterOff); - npIdx = pIdxNew + getIndex(iter->x_hkey, newSize); + npIdx = pNewTbl + getIndex(iter->x_hkey, newSize); if (npIdx->m_iOffset != iterOff.m_iOffset) // not there yet { - opIdx = pIdxOld + getIndex(iter->x_hkey, oldSize); + opIdx = pOldTbl + getIndex(iter->x_hkey, oldSize); if (opIdx->m_iOffset == iterOff.m_iOffset) opIdx->m_iOffset = iter->x_iNext.m_iOffset; // remove from old iter->x_iNext.m_iOffset = npIdx->m_iOffset; npIdx->m_iOffset = iterOff.m_iOffset; } - } } else @@ -749,29 +748,34 @@ int LsShmHash::rehash() uint8_t *ptr = (uint8_t *)offset2ptr(newBitOff); ::memset(ptr, 0, szTable + szBitMap); newIdxOff = newBitOff + szBitMap; - pIdxNew = (LsShmHIterOff *)(ptr + szBitMap); + pNewTbl = (LsShmHIterOff *)(ptr + szBitMap); pTable = getHTable(); pTable->x_iBitMap = newBitOff; pTable->x_iBitMapSz = szBitMap; pTable->x_iCapacityNew = newSize; pTable->x_iHIdxNew = newIdxOff; - iterOff = begin(); } - pIdxOld = (LsShmHIterOff *)m_pPool->offset2ptr(pTable->x_iHIdx); + iterOff = begin(); + pOldTbl = (LsShmHIterOff *)m_pPool->offset2ptr(pTable->x_iHIdx); while(iterOff.m_iOffset != 0) { - uint32_t hashIndx; + uint32_t new_idx; iter = offset2iterator(iterOff); + opIdx = pOldTbl + getIndex(iter->x_hkey, oldSize); iterNextOff = next(iterOff); - hashIndx = getIndex(iter->x_hkey, newSize); - npIdx = pIdxNew + hashIndx; - setBitMapEnt(hashIndx); + new_idx = getIndex(iter->x_hkey, newSize); + npIdx = pNewTbl + new_idx; + setBitMapEnt(new_idx); + pTable->x_iWorkIterOff = iterOff.m_iOffset; - (pIdxOld + getIndex(iter->x_hkey, oldSize))->m_iOffset = iter->x_iNext.m_iOffset; + assert(opIdx->m_iOffset == iterOff.m_iOffset); + opIdx->m_iOffset = iter->x_iNext.m_iOffset; + assert(npIdx->m_iOffset != iterOff.m_iOffset); iter->x_iNext.m_iOffset = npIdx->m_iOffset; npIdx->m_iOffset = iterOff.m_iOffset; iterOff = iterNextOff; + if (++count > oldSize + oldSize / 2) { fprintf(stderr, "LsShmHash::rehash() is in a infinity loop, likely due to SHM corruption. remove corrupted file."); @@ -931,6 +935,7 @@ void LsShmHash::remove(iteroffset iterOff, iterator iter) LsShmHElem *pElem; LsShmOffset_t next = iter->x_iNext.m_iOffset; // in case of remap in tid list + validateIndexSlot(hashIndx); //NOTE:race condition, two process release the object at the same time. // ShmHash was not properly locked. @@ -956,6 +961,8 @@ void LsShmHash::remove(iteroffset iterOff, iterator iter) { m_pTidMgr->eraseIterCb(iter); pIdx = getHidx(hashIndx); + + validateIndexSlot(hashIndx); } if (offset == iterOff.m_iOffset) { @@ -975,12 +982,15 @@ void LsShmHash::remove(iteroffset iterOff, iterator iter) // next offset... offset = pElem->x_iNext.m_iOffset; } + validateIndexSlot(hashIndx); + } decrTableSize(); if (m_iFlags & LSSHM_FLAG_LRU) { removeFromLru(iter); + validateIndexSlot(hashIndx); if (getLru()->n_current != getHTable()->x_iSize) { LsHashLruInfo info = *getLru(); @@ -1120,9 +1130,12 @@ void LsShmHash::insertAlloced(iteroffset iterOff, iterator iter) { uint32_t hashIndx = getIndex(iter->x_hkey, capacity()); LsShmHIterOff *pIdx = getHidx(hashIndx); + + validateIndexSlot(hashIndx); iter->x_iNext.m_iOffset = pIdx->m_iOffset; pIdx->m_iOffset = iterOff.m_iOffset; setBitMapEnt(hashIndx); + validateIndexSlot(hashIndx); #ifdef DEBUG_RUN SHM_NOTICE("LsShmHash::insert %6d %X size %d cap %d <%p> %d", @@ -1138,6 +1151,7 @@ void LsShmHash::insertAlloced(iteroffset iterOff, iterator iter) if (m_iFlags & LSSHM_FLAG_LRU) { addToLru(iter, iterOff); + validateIndexSlot(hashIndx); if (getLru()->n_current != getHTable()->x_iSize) { LsHashLruInfo info = *getLru(); @@ -1163,6 +1177,8 @@ void LsShmHash::replace(iteroffset oldIterOff, iterator oldIter, LsShmSize_t size = oldIter->x_iLen; uint32_t hashIndx = getIndex(oldIter->x_hkey, capacity()); LsShmHIterOff *pIdx = getHidx(hashIndx); + validateIndexSlot(hashIndx); + LsShmOffset_t offset = pIdx->m_iOffset; LsShmHElem *pElem; LsShmOffset_t next = oldIter->x_iNext.m_iOffset; // in case of remap in tid list @@ -1192,6 +1208,7 @@ void LsShmHash::replace(iteroffset oldIterOff, iterator oldIter, { m_pTidMgr->eraseIterCb(oldIter); pIdx = getHidx(hashIndx); + validateIndexSlot(hashIndx); } if (offset == oldIterOff.m_iOffset) @@ -1199,6 +1216,7 @@ void LsShmHash::replace(iteroffset oldIterOff, iterator oldIter, pIdx->m_iOffset = newIterOff.m_iOffset; newIter->x_iNext.m_iOffset = next; oldIter->x_iNext.m_iOffset = 0; + validateIndexSlot(hashIndx); } else { @@ -1210,6 +1228,7 @@ void LsShmHash::replace(iteroffset oldIterOff, iterator oldIter, pElem->x_iNext.m_iOffset = newIterOff.m_iOffset; newIter->x_iNext.m_iOffset = next; oldIter->x_iNext.m_iOffset = 0; + validateIndexSlot(hashIndx); break; } // next offset... @@ -1221,6 +1240,8 @@ void LsShmHash::replace(iteroffset oldIterOff, iterator oldIter, { removeFromLru(oldIter); addToLru(newIter, newIterOff); + validateIndexSlot(hashIndx); + if (getLru()->n_current != getHTable()->x_iSize) { LsHashLruInfo info = *getLru(); @@ -1260,26 +1281,31 @@ LsShmHash::iteroffset LsShmHash::iterGrowValue(iteroffset iterOff, pOld = (LsShmHElem *)m_pPool->offset2ptr(iterOff.m_iOffset); // pNew->x_iNext.m_iOffset = 0; pNew->x_hkey = pOld->x_hkey; - setIterKey(pNew, pOld->getKey()); + uint32_t hashIndx = getIndex(pNew->x_hkey, capacity()); + if (front) front = size_to_grow; ::memcpy(pNew->getVal() + front, pOld->getVal(), pOld->getValLen()); eraseIteratorHelper(iterOff); if (m_iFlags & LSSHM_FLAG_LRU) + { addToLru(pNew, offset); + validateIndexSlot(hashIndx); + } if (m_pTidMgr != NULL && isTidMaster()) { m_pTidMgr->insertIterCb(offset); pNew = offset2iterator(offset); + validateIndexSlot(hashIndx); } - uint32_t hashIndx = getIndex(pNew->x_hkey, capacity()); LsShmHIterOff *pIdx = getHidx(hashIndx); pNew->x_iNext.m_iOffset = pIdx->m_iOffset; pIdx->m_iOffset = offset.m_iOffset; setBitMapEnt(hashIndx); + validateIndexSlot(hashIndx); incrTableSize(); return offset; @@ -1938,7 +1964,7 @@ LsShmHash::iteroffset LsShmHash::tid2IterOff(uint64_t tid) const } -uint64_t LsShmHash::nextTidVal(uint64_t tidIn, void *&pSearchState, +uint64_t LsShmHash::nextTidVal(uint64_t tidIn, LsShmTidTblBlk *&pSearchState, LsShmHash::iteroffset &outOffset, uint64_t &outDelTid) const { outOffset.m_iOffset = 0; @@ -1959,6 +1985,26 @@ uint64_t LsShmHash::nextTidVal(uint64_t tidIn, void *&pSearchState, } +int LsShmHash::getTidVal(uint64_t tid, LsShmTidTblBlk **pCurBlk, + iteroffset *outOffset, uint64_t *outDelTid) const +{ + outOffset->m_iOffset = 0; + *outDelTid = 0; + if (NULL == m_pTidMgr) + return -1; + assert(m_pPool->getShm()->isLocked(m_pShmLock)); + uint64_t tid_val; + if (m_pTidMgr->getTidVal(tid, pCurBlk, &tid_val) != -1) + { + if (m_pTidMgr->isTidValIterOff(tid_val)) + outOffset->m_iOffset = m_pTidMgr->tidVal2iterOff(tid_val); + else + *outDelTid = tid_val; + } + return -1; +} + + void LsShmHash::assignTid(LsShmHash::iteroffset iterOff, uint64_t tid) { if (NULL == m_pTidMgr) @@ -2120,6 +2166,40 @@ int LsShmHash::statIdx(iteroffset iterOff, for_each_fn2 fun, void *pUdata) return numInIdx; } +#if DEBUG_SHM_HASH +int LsShmHash::validateIndexSlot(uint32_t index) +{ + LsShmHIterOff offset = *getHidx(index); + LsShmHElem *pElem; + int count = 0; + LsShmOffset_t history[4096]; + + while (offset.m_iOffset != 0) + { + history[count++] = offset.m_iOffset; + if (count >= (int)(sizeof(history) / sizeof(LsShmOffset_t))) + { + //history overflow, should not happen. + abort(); + } + else + { + for(int i = 0; i < count - 1; ++i) + { + //detect duplicate. + if (history[i] == offset.m_iOffset) + abort(); + } + } + pElem = (LsShmHElem *)m_pPool->offset2ptr(offset.m_iOffset); + //must fall into the same slot + if (pElem->x_hkey % capacity() != index) + abort(); + offset.m_iOffset = pElem->x_iNext.m_iOffset; + } + return LS_OK; +} +#endif // // @brief stat - populate the statistic of the hash table diff --git a/src/shm/lsshmhash.h b/src/shm/lsshmhash.h index 7eb3fe467..996f3d2d7 100644 --- a/src/shm/lsshmhash.h +++ b/src/shm/lsshmhash.h @@ -155,6 +155,7 @@ class LsShmHashLruAddon class AutoBuf; class LsShmTidMgr; +struct LsShmTidTblBlk; class LsShmHash : public ls_shmhash_s { public: @@ -563,8 +564,10 @@ class LsShmHash : public ls_shmhash_s // Returns the next tid with a value. outOffset and outDelTid will be zeroed. // If the tid is a 'delete', outDelTid will be set to the tid deleted. // else outOffset will be set to the offset assicated with the returned tid. - uint64_t nextTidVal(uint64_t tidIn, void *&pSearchState, + uint64_t nextTidVal(uint64_t tidIn, LsShmTidTblBlk *&pSearchState, iteroffset &outOffset, uint64_t &outDelTid) const; + int getTidVal(uint64_t tid, LsShmTidTblBlk **pCurBlk, + iteroffset *outOffset, uint64_t *outDelTid) const; void assignTid(iteroffset iterOff, uint64_t tid); void updateLastTid(uint64_t tid); @@ -703,6 +706,11 @@ class LsShmHash : public ls_shmhash_s iteroffset allocIter(int key_len, int val_len); +#if DEBUG_SHM_HASH + int validateIndexSlot(uint32_t index); +#else + int validateIndexSlot(uint32_t index) { return 0; } +#endif // // @brief eraseIterator_helper // @brief should only be called after SHM-HASH-LOCK has been acquired. diff --git a/src/shm/lsshmtidmgr.cpp b/src/shm/lsshmtidmgr.cpp index 5d9ed1183..e77b8aa0d 100644 --- a/src/shm/lsshmtidmgr.cpp +++ b/src/shm/lsshmtidmgr.cpp @@ -346,13 +346,13 @@ LsShmTidTblBlk *LsShmTidMgr::tid2tblBlk(uint64_t tid) } -uint64_t *LsShmTidMgr::nxtTidTblVal(uint64_t *pTid, void **ppBlk) +uint64_t *LsShmTidMgr::nxtTidTblVal(uint64_t *pTid, LsShmTidTblBlk **ppBlk) { uint64_t *pVal; int indx; LsShmOffset_t off; LsShmTidTblBlk *pBlk; - if ((pBlk = (LsShmTidTblBlk *)*ppBlk) == NULL) + if ((pBlk = *ppBlk) == NULL) pBlk = tid2tblBlk(*pTid); if (pBlk == NULL) return NULL; @@ -370,7 +370,7 @@ uint64_t *LsShmTidMgr::nxtTidTblVal(uint64_t *pTid, void **ppBlk) pBlk = (LsShmTidTblBlk *)m_pHash->offset2ptr(off); } *pTid = pBlk->x_tidBase + indx; - *ppBlk = (void *)pBlk; + *ppBlk = pBlk; return pVal; } diff --git a/src/shm/lsshmtidmgr.h b/src/shm/lsshmtidmgr.h index a90cba518..06d7b398e 100644 --- a/src/shm/lsshmtidmgr.h +++ b/src/shm/lsshmtidmgr.h @@ -49,7 +49,7 @@ typedef struct LsShmOffset_t x_iLockOff; } LsShmTidInfo; -typedef struct +struct LsShmTidTblBlk { uint64_t x_tidBase; int16_t x_iIterCnt; @@ -57,7 +57,7 @@ typedef struct LsShmOffset_t x_iNext; LsShmOffset_t x_iPrev; uint64_t x_iTidVals[TIDTBLBLK_MAXSZ]; -} LsShmTidTblBlk; +} ; class LsShmTidMgr { @@ -89,7 +89,7 @@ class LsShmTidMgr void clearCb(); uint64_t getTidCb(LsShmHElem *pElem); - uint64_t *nxtTidTblVal(uint64_t *pTid, void **ppBlk); + uint64_t *nxtTidTblVal(uint64_t *pTid, LsShmTidTblBlk **ppBlk); bool isTidValIterOff(uint64_t tidVal) const { return ((tidVal & TIDDEL_MAGIC_NUMBER) != 0); } @@ -100,6 +100,23 @@ class LsShmTidMgr LsShmOffset_t tidVal2iterOff(uint64_t tidVal) { return (tidVal & ~TIDDEL_MAGIC_NUMBER); } + int getTidVal(uint64_t tid, LsShmTidTblBlk **ppBlk, uint64_t *val) + { + LsShmTidTblBlk *pBlk; + if (*ppBlk && tid >= (*ppBlk)->x_tidBase + && tid < ((*ppBlk)->x_tidBase + TIDTBLBLK_MAXSZ)) + pBlk = *ppBlk; + else + { + *ppBlk = pBlk = tid2tblBlk(tid); + if (pBlk == NULL) + return -1; + } + *val = pBlk->x_iTidVals[tid % TIDTBLBLK_MAXSZ]; + return 0; + } + + LsShmHIterOff tid2iterOff(uint64_t tid, LsShmTidTblBlk **ppBlk) { LsShmHIterOff off = {0}; diff --git a/src/spdy/spdystream.cpp b/src/spdy/spdystream.cpp index 401f4a27b..638b07b29 100644 --- a/src/spdy/spdystream.cpp +++ b/src/spdy/spdystream.cpp @@ -53,7 +53,8 @@ int SpdyStream::init(uint32_t StreamID, clearLogId(); setState(HIOS_CONNECTED); - setFlag((flags & (SPDY_CTRL_FLAG_FIN | SPDY_CTRL_FLAG_UNIDIRECTIONAL)), 1); + setFlag((enum stream_flag)(flags & (HIO_FLAG_PEER_SHUTDOWN + | HIO_FLAG_LOCAL_SHUTDOWN)), 1); m_bufIn.clear(); m_uiStreamID = StreamID; @@ -91,8 +92,9 @@ int SpdyStream::appendReqData(char *pData, int len, uint8_t flags) m_iWindowIn -= len; //Note: SPDY_CTRL_FLAG_FIN is directly mapped to HIO_FLAG_PEER_SHUTDOWN // SPDY_CTRL_FLAG_UNIDIRECTIONAL is directly mapped to HIO_FLAG_LOCAL_SHUTDOWN - if (flags & (SPDY_CTRL_FLAG_FIN | SPDY_CTRL_FLAG_UNIDIRECTIONAL)) - setFlag(flags & (SPDY_CTRL_FLAG_FIN | SPDY_CTRL_FLAG_UNIDIRECTIONAL), 1); + if ((enum stream_flag)flags & (HIO_FLAG_PEER_SHUTDOWN | HIO_FLAG_LOCAL_SHUTDOWN)) + setFlag((enum stream_flag)(flags & (HIO_FLAG_PEER_SHUTDOWN + | HIO_FLAG_LOCAL_SHUTDOWN)), 1); if (isWantRead()) getHandler()->onReadEx(); diff --git a/src/sslpp/sslocspstapling.cpp b/src/sslpp/sslocspstapling.cpp index f242606ad..fb39b9ce3 100644 --- a/src/sslpp/sslocspstapling.cpp +++ b/src/sslpp/sslocspstapling.cpp @@ -168,11 +168,12 @@ SslOcspStapling::SslOcspStapling() : m_pHttpFetch(NULL) , m_pReqData(NULL) , m_iDataLen(0) - , m_pRespData(NULL) , m_iocspRespMaxAge(3600 * 24) + , m_pRespData(NULL) , m_notBefore(NULL) , m_pCtx(NULL) , m_RespTime(0) + , m_statTime(0) , m_pCertId(NULL) { } @@ -232,10 +233,10 @@ int SslOcspStapling::update() struct stat st; if (m_RespTime == UINT_MAX) return 0; - if (m_RespTime != 0 && m_RespTime + m_iocspRespMaxAge >= DateTime::s_curTime) - { + if (m_statTime != 0 && m_statTime + 60 >= DateTime::s_curTime) return 0; - } + + m_statTime = DateTime::s_curTime; if (::stat(m_sRespfile.c_str(), &st) == 0) { @@ -248,6 +249,10 @@ int SslOcspStapling::update() { if (m_RespTime == st.st_mtime) return 0; + + LS_DBG("[OCSP] %s: file timestamp updated, current: %ld, file: %ld\n", + m_sRespfile.c_str(), m_RespTime, st.st_mtime); + if (verifyRespFile(0) == LS_OK) { m_RespTime = st.st_mtime; @@ -416,7 +421,7 @@ void SslOcspStapling::releaseRespData() } -void SslOcspStapling::updateRespData(OCSP_RESPONSE *pResponse) +int SslOcspStapling::updateRespData(OCSP_RESPONSE *pResponse) { unsigned char *pOcspResp; m_iDataLen = i2d_OCSP_RESPONSE(pResponse, NULL); @@ -433,12 +438,15 @@ void SslOcspStapling::updateRespData(OCSP_RESPONSE *pResponse) if (m_iDataLen <= 0) { releaseRespData(); + return -1; } #ifdef OPENSSL_IS_BORINGSSL else if (m_pCtx) SSL_CTX_set_ocsp_response(m_pCtx->get(), m_pRespData, m_iDataLen); #endif + return 0; } + return -1; } int SslOcspStapling::certVerify(OCSP_RESPONSE *pResponse, @@ -467,14 +475,23 @@ int SslOcspStapling::certVerify(OCSP_RESPONSE *pResponse, } int find_status = OCSP_resp_find_status(pBasicResp, m_pCertId, &n, NULL, NULL, &pThisupdate, &pNextupdate); - //NOTE: get around an issue with response have wrong nextupdate time. - // do not check it for now. - pNextupdate = NULL; int validate = -100; if (find_status == 1 && n == V_OCSP_CERTSTATUS_GOOD) { int day, sec; + //NOTE: get around an issue with response have wrong nextupdate time. + // make sure it is later than thisupdate. + if (pThisupdate && pNextupdate) + { + if (ASN1_TIME_diff(&day, &sec, pThisupdate, pNextupdate) == 0 + || (day <= 0 && sec <= 0)) + { + LS_NOTICE("[OCSP] %s: Bad next_update time day: %d, sec: %d, " + "set it to NULL\n", m_sCertfile.c_str(), day, sec); + pNextupdate = NULL; + } + } if (m_notBefore && ASN1_TIME_diff(&day, &sec, m_notBefore, pThisupdate) && (day > 0 || sec > 0)) validate = OCSP_check_validity(pThisupdate, pNextupdate, 300, -1); @@ -519,12 +536,18 @@ int SslOcspStapling::verifyRespFile(int is_new_resp) const unsigned char *pCopy; size_t ulSize; X509_STORE *pXstore; + const char *file_name; if (is_new_resp) - pBio = BIO_new_file(m_sRespfileTmp.c_str(), "r"); + file_name = m_sRespfileTmp.c_str(); else - pBio = BIO_new_file(m_sRespfile.c_str(), "r"); + file_name = m_sRespfile.c_str(); + + pBio = BIO_new_file(file_name, "r"); if (pBio == NULL) + { + LS_ERROR("[OCSP] %s: Failed to open file.\n", file_name); return -1; + } #ifdef OPENSSL_IS_BORINGSSL if (1 != BIO_read_asn1(pBio, &pBuf, &ulSize, 100 * 1024)) @@ -542,6 +565,7 @@ int SslOcspStapling::verifyRespFile(int is_new_resp) #endif if (pResponse == NULL) { + LS_ERROR("[OCSP] %s: Failed to load OCSP RESPONSE.\n", file_name); return -1; } @@ -556,6 +580,8 @@ int SslOcspStapling::verifyRespFile(int is_new_resp) iResult = certVerify(pResponse, pBasicResp, pXstore); if (iResult == 0 && is_new_resp) { + LS_DBG("[OCSP] %s: Update OCSP response file\n", + m_sRespfile.c_str()); unlink(m_sRespfile.c_str()); rename(m_sRespfileTmp.c_str(), m_sRespfile.c_str()); struct stat st; @@ -566,7 +592,11 @@ int SslOcspStapling::verifyRespFile(int is_new_resp) OCSP_BASICRESP_free(pBasicResp); } if (iResult == 0) - updateRespData(pResponse); + { + iResult = updateRespData(pResponse); + LS_DBG("[OCSP] %s: Update OCSP response data: %s\n", + file_name, (iResult == 0) ? "succeed" : "fail"); + } } OCSP_RESPONSE_free(pResponse); return iResult; diff --git a/src/sslpp/sslocspstapling.h b/src/sslpp/sslocspstapling.h index c36d78b87..f3e4d0628 100644 --- a/src/sslpp/sslocspstapling.h +++ b/src/sslpp/sslocspstapling.h @@ -21,6 +21,7 @@ #define SSLOCSPSTAPLING_H #include #include +#include class SslContext; class HttpFetch; @@ -50,7 +51,7 @@ class SslOcspStapling int certVerify(OCSP_RESPONSE *pResponse, OCSP_BASICRESP *pBasicResp, X509_STORE *pXstore); void releaseRespData(); - void updateRespData(OCSP_RESPONSE *pResponse); + int updateRespData(OCSP_RESPONSE *pResponse); int getRequestData(unsigned char **pReqData); void setCertFile(const char *Certfile); @@ -67,18 +68,19 @@ class SslOcspStapling unsigned char *m_pReqData; uint32_t m_iDataLen; + int m_iocspRespMaxAge; unsigned char *m_pRespData; GSockAddr m_addrResponder; - AutoStr2 m_sCertfile; - AutoStr2 m_sCAfile; + AutoStr m_sCertfile; + AutoStr m_sCAfile; AutoStr2 m_sOcspResponder; - AutoStr2 m_sRespfile; - AutoStr2 m_sRespfileTmp; - int m_iocspRespMaxAge; + AutoStr m_sRespfile; + AutoStr m_sRespfileTmp; ASN1_TIME *m_notBefore; SslContext *m_pCtx; - uint32_t m_RespTime; + time_t m_RespTime; + time_t m_statTime; OCSP_CERTID *m_pCertId; diff --git a/src/sslpp/sslsesscache.cpp b/src/sslpp/sslsesscache.cpp index 2a8c91f69..3ecb49db7 100644 --- a/src/sslpp/sslsesscache.cpp +++ b/src/sslpp/sslsesscache.cpp @@ -398,11 +398,10 @@ int SslSessCache::stat() uint32_t SslSessCache::getSessCnt() const { - LsHashStat stat; m_pSessStore->lock(); - m_pSessStore->stat(&stat, checkStatElem, m_pSessStore); + uint32_t cnt = m_pSessStore->size(); m_pSessStore->unlock(); - return stat.num; + return cnt; } diff --git a/src/thread/pthreadmutex.cpp b/src/thread/pthreadmutex.cpp index d3349ff6c..bf36ead2e 100644 --- a/src/thread/pthreadmutex.cpp +++ b/src/thread/pthreadmutex.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see http://www.gnu.org/licenses/. * *****************************************************************************/ #include "pthreadmutex.h" -#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)) && !defined( NDEBUG ) +#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)) && !defined( NDEBUG ) && defined(PTHREAD_MUTEX_ERRORCHECK_NP) #ifndef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ diff --git a/src/thread/thread.h b/src/thread/thread.h index 8baf80e94..c924a1575 100644 --- a/src/thread/thread.h +++ b/src/thread/thread.h @@ -119,11 +119,13 @@ class Thread int timedJoin(void **pRetVal, struct timespec *timeout) { return pthread_timedjoin_np(m_thread, pRetVal, timeout); } +#if defined(__gnu_linux__) int attrSetAffinity(size_t cpusetsize, const cpu_set_t *cpuset) { return m_thread ? LS_FAIL : pthread_attr_setaffinity_np(&m_attr, cpusetsize, cpuset); } int attrGetAffinity(size_t cpusetsize, cpu_set_t *pCpuSet) { return pthread_attr_getaffinity_np(&m_attr, cpusetsize, pCpuSet); } +#endif #endif int attrSetDetachState(int detachstate) diff --git a/src/util/radixtree.cpp b/src/util/radixtree.cpp index d87758f19..1194d3298 100644 --- a/src/util/radixtree.cpp +++ b/src/util/radixtree.cpp @@ -782,13 +782,14 @@ int RadixNode::getHeader(int iFlags, ls_xpool_t *pool, const char *pLabel, ls_str_t hashMatch; int iOffset; int i, iExact = getNumExact(); + switch (getState()) { case RNSTATE_NOCHILD: break; case RNSTATE_CNODE: pTmp = m_pCHeaders; - if ((pTmp->len == iLabelLen) + if (pTmp && (pTmp->len == iLabelLen) && (rnDoCmp(iFlags, &pTmp->label[0], pLabel, pTmp->len) == 0)) { pHeader = pTmp; @@ -804,7 +805,7 @@ int RadixNode::getHeader(int iFlags, ls_xpool_t *pool, const char *pLabel, return 1; case RNSTATE_PNODE: pTmp = m_pCHeaders; - if ((pTmp->len == iLabelLen) + if (pTmp && (pTmp->len == iLabelLen) && (rnDoCmp(iFlags, &pTmp->label[0], pLabel, iLabelLen) == 0)) { pHeader = pTmp; @@ -815,7 +816,7 @@ int RadixNode::getHeader(int iFlags, ls_xpool_t *pool, const char *pLabel, pTmp = m_pCHeaders; for (i = 0; i < iExact; ++i) { - if ((iLabelLen == pTmp->len) + if (pTmp && (iLabelLen == pTmp->len) && (rnDoCmp(iFlags, &pTmp->label[0], pLabel, pTmp->len) == 0)) { pHeader = pTmp; @@ -842,7 +843,7 @@ int RadixNode::getHeader(int iFlags, ls_xpool_t *pool, const char *pLabel, for (i = 0; i < iExact; ++i) { pTmp = m_pPHeaders[i]; - if ((iLabelLen == pTmp->len) + if (pTmp && (iLabelLen == pTmp->len) && (rnDoCmp(iFlags, &pTmp->label[0], pLabel, pTmp->len) == 0)) { pHeader = pTmp; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d9e9514be..12116b2fe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -163,7 +163,7 @@ SET( unittestlib modgzip cache lsiapi main http lsiapi ssi registry cgi fcgi jk extensions lsapi proxy socket sslpp lsshm thread log4cxx GeoIP adns - quic h2 lsquic + quic h2 lsquic bcrypt -Wl,--whole-archive util lsr -Wl,--no-whole-archive edio udns pthread rt ${CMAKE_DL_LIBS} ${libUnitTest} ${BSSL_ADD_LIB} libz.a libpcre.a libexpat.a libxml2.a diff --git a/test/util/poolalloctest.cpp b/test/util/poolalloctest.cpp index f8b7c3f1d..304f8ec4f 100644 --- a/test/util/poolalloctest.cpp +++ b/test/util/poolalloctest.cpp @@ -37,6 +37,7 @@ class dummy std::string s2; }; +#if 0 class TestAllocator : public std::map< int, dummy, std::less, PoolAllocator > { @@ -66,5 +67,6 @@ TEST(PoolAllocTest_test) profile1.printTime(pStdAlloc, 100000); } } +#endif #endif