From 697944e918209436306cbe430747936ffe8af33b Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 27 Sep 2024 16:42:29 +0300 Subject: [PATCH 01/16] Rebuild For MSVSphere --- .gitignore | 2 + .openlitespeed.metadata | 2 + SPECS/openlitespeed.spec | 242 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 246 insertions(+) create mode 100644 .gitignore create mode 100644 .openlitespeed.metadata create mode 100644 SPECS/openlitespeed.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfbc67f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/openlitespeed.tar.xz +SOURCES/third-party.tar.xz diff --git a/.openlitespeed.metadata b/.openlitespeed.metadata new file mode 100644 index 0000000..bc993ac --- /dev/null +++ b/.openlitespeed.metadata @@ -0,0 +1,2 @@ +c01524a8749eb18dff566966389c8a33eb8c443a SOURCES/openlitespeed.tar.xz +63ea80ec5e804e3b06cbe1d88ee300d08208719b SOURCES/third-party.tar.xz diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec new file mode 100644 index 0000000..54a891e --- /dev/null +++ b/SPECS/openlitespeed.spec @@ -0,0 +1,242 @@ +Name: openlitespeed +Version: 1.8.2 +Release: 1%{?dist} +Summary: OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. +License: GNU General Public License v3.0 +Url: https://github.com/litespeedtech/openlitespeed + +Source0: %{name}.tar.xz +Source1: third-party.tar.xz + +BuildRequires: gcc +BuildRequires: g++ +BuildRequires: make +BuildRequires: cmake +BuildRequires: clang +BuildRequires: expat-devel +BuildRequires: libcap-devel +BuildRequires: libtool +BuildRequires: autoconf +BuildRequires: go +BuildRequires: libaio-devel +BuildRequires: doxygen +BuildRequires: docbook2X + +%description +OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. + +%package -n ols-lua +Group: Application/WebServer +Summary: Lua +Requires: openlitespeed == %{version} + +%description -n ols-lua +Mod Lua module for openlitespeed webserver. + +%package -n ols-pagespeed +Group: Application/WebServer +Summary: Pagespeed +Requires: openlitespeed == %{version} + +%description -n ols-pagespeed +Pagespeed module for openlitespeed webserver. + +%package -n ols-modsecurity +Group: Application/WebServer +Summary: Mod Security +Requires: openlitespeed == %{version} + +%description -n ols-modsecurity +Mod Security for openlitespeed webserver. + +%prep +tar -xpaf %{_sourcedir}/openlitespeed.tar.xz -C %{_builddir} +#mv %{_builddir}/openlitespeed-1.8.2-1/openlitespeed/ %{_builddir} +#rm -rf %{_builddir}/openlitespeed-1.8.2-1 +tar -xpaf %{_sourcedir}/third-party.tar.xz -C %{_builddir} + +%build +sh -xe %{_builddir}/openlitespeed/build.sh + +%install +install -m 755 -d %{buildroot}/usr/lsws +rm -rf %{_builddir}/openlitespeed/dist/ols.conf +buildroot_path=$(rpm --eval "%{buildroot}") +sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' %{_builddir}/openlitespeed/dist/install.sh +sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" %{_builddir}/openlitespeed/dist/install.sh +sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' %{_builddir}/openlitespeed/dist/install.sh +sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' %{_builddir}/openlitespeed/dist/_in.sh +sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' %{_builddir}/openlitespeed/dist/install.sh +sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' %{_builddir}/openlitespeed/dist/functions.sh +%{_builddir}/openlitespeed/dist/install.sh +rm -f %{buildroot}/usr/lsws/admin/conf/admin_config.conf +cp -pr %{_builddir}/openlitespeed/dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf +sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf +sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf +install -m 755 -d %{buildroot}/etc/init.d +chmod u+w %{buildroot}/usr/lsws/admin/misc/lsws.rc +sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc +sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws +chmod 0755 %{buildroot}/etc/init.d/lsws +sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}/usr/lsws/conf/httpd_config.conf +echo 'RPM' > %{buildroot}/usr/lsws/PLAT +chmod 755 %{buildroot}/usr/lsws/bin/unmount_ns +chmod 755 %{buildroot}/usr/lsws/lsrecaptcha/_recaptcha +chmod 755 %{buildroot}/usr/lsws/admin/fcgi-bin/admin_php +chmod 755 %{buildroot}/usr/lsws/fcgi-bin/lsphp5 +chmod 755 %{buildroot}/usr/lsws/admin/fcgi-bin/admin_php +rm %{buildroot}/usr/lsws/fcgi-bin/lsphp +rm %{buildroot}/usr/lsws/admin/misc/lsws.rc.gentoo + + +%clean +%pre +getent group lsadm > /dev/null || groupadd -r lsadm +lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1 +getent passwd lsadm > /dev/null || useradd -g $lsadm_gid -d / -r -s /sbin/nologin -c "lsadm" lsadm >/dev/null 2>&1 +usermod -G lsadm,nobody lsadm >/dev/null 2>&1 +exit 0 + +%post +DEFAULT_USER="nobody" +DEFAULT_GROUP="nobody" +WS_USER=$DEFAULT_USER +WS_GROUP=$DEFAULT_GROUP +ADMIN_USER="lsadm" +LSWS_HOME="/usr/lsws" +OLD_USER=$DEFAULT_USER +OLD_GROUP=$DEFAULT_GROUP + +grep -q nobody: "/etc/group" + +if [ $? != 0 ] ; then + DEFAULT_GROUP="nogroup" +fi +if [ "$WS_GROUP" = "nobody" ] ; then + WS_GROUP=$DEFAULT_GROUP +fi +if [ -f "$LSWS_HOME/conf/httpd_config.xml" ] ; then + OLD_USER_CONF=`grep "" "$LSWS_HOME/conf/httpd_config.xml"` + OLD_GROUP_CONF=`grep "" "$LSWS_HOME/conf/httpd_config.xml"` + OLD_USER=`expr "$OLD_USER_CONF" : '.*\(.*\).*'` + OLD_GROUP=`expr "$OLD_GROUP_CONF" : '.*\(.*\).*'` +fi +if [ -f "$LSWS_HOME/conf/httpd_config.conf" ] ; then + #Now check if the user and group match with the conf file + OLD_USER_CONF=`grep "user" "$LSWS_HOME/conf/httpd_config.conf"` + OLD_GROUP_CONF=`grep "group" "$LSWS_HOME/conf/httpd_config.conf"` + OLD_USER=`expr "$OLD_USER_CONF" : '\s*user\s*\(\S*\)'` + OLD_GROUP=`expr "$OLD_GROUP_CONF" : '\s*group\s*\(\S*\)'` +fi +WS_USER=$OLD_USER +WS_GROUP=$OLD_GROUP +DIR_OWN=$WS_USER:$WS_GROUP +CONF_OWN=$WS_USER:$WS_GROUP +LOGDIR_OWN="root:$WS_GROUP" +grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1 +if [ $? -eq 0 ]; then + CONF_OWN="lsadm:lsadm" +fi +SDIR_OWN="root:root" +chown $SDIR_OWN $LSWS_HOME >/dev/null 2>&1 +chown "$CONF_OWN" -R /usr/lsws/conf >/dev/null 2>&1 +chown "$CONF_OWN" -R /usr/lsws/phpbuild >/dev/null 2>&1 +if [ -d "/usr/lsws/autoupdate" ]; then + chown "$CONF_OWN" -R /usr/lsws/autoupdate >/dev/null 2>&1 +fi +if [ -d "/usr/lsws/DEFAULT/conf" ]; then + chown "$CONF_OWN" -R /usr/lsws/DEFAULT/conf >/dev/null 2>&1 +fi +if [ -d "/usr/lsws/Example/conf" ]; then + chown "$CONF_OWN" -R /usr/lsws/Example/conf >/dev/null 2>&1 +fi +chown "$CONF_OWN" -R /usr/lsws/admin/conf >/dev/null 2>&1 +chown "$CONF_OWN" -R /usr/lsws/admin/tmp >/dev/null 2>&1 +chgrp $WS_GROUP /usr/lsws/admin/cgid >/dev/null 2>&1 +chgrp $WS_GROUP /usr/lsws/admin/tmp >/dev/null 2>&1 +chown "$CONF_OWN" $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 +chown "$DIR_OWN" $LSWS_HOME/cachedata >/dev/null 2>&1 +chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 +chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 +chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 +chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 +chown "$CONF_OWN" "$LSWS_HOME/admin/conf/htpasswd" >/dev/null 2>&1 +chmod 0600 "$LSWS_HOME/admin/conf/htpasswd" >/dev/null 2>&1 +chown "nobody:nobody" "$LSWS_HOME/tmp" >/dev/null 2>&1 +chmod 0700 "$LSWS_HOME/tmp" >/dev/null 2>&1 +chmod 0755 "$LSWS_HOME/autoupdate" >/dev/null 2>&1 +chown "$LOGDIR_OWN" "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1 +chmod 0750 "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1 +#########this is the end of script to fix rpm build related file group and permission problem. + +SSL_COUNTRY='US' +SSL_STATE="New Jersey" +SSL_LOCALITY='Virtual' +SSL_ORG='LiteSpeedCommunity' +SSL_ORGUNIT='Testing' +SSL_HOSTNAME='webadmin' +COMMNAME='openlitespeed.host' +SSL_COUNTRY=US +SSL_STATE="New Jersey" +csr="${SSL_HOSTNAME}.csr" +key="${SSL_HOSTNAME}.key" +cert="${SSL_HOSTNAME}.crt" + +%define sslcert /usr/lsws/admin/conf/${cert} +%define sslkey /usr/lsws/admin/conf/${key} + +cat << EOF > ${csr} +[req] +prompt=no +distinguished_name=openlitespeed +[openlitespeed] +commonName = ${COMMNAME} +countryName = ${SSL_COUNTRY} +localityName = Virtual +organizationName = LiteSpeedCommunity +organizationalUnitName = Testing +stateOrProvinceName = NJ +emailAddress = mail@${COMMNAME} +name = openlitespeed +initials = CP +dnQualifier = openlitespeed +[server_exts] +extendedKeyUsage=1.3.6.1.5.5.7.3.1 +EOF + +openssl req -x509 -config $csr -extensions 'server_exts' -nodes -days 820 -newkey rsa:2048 -keyout %{sslkey} -out %{sslcert} +chown lsadm.lsadm %{sslcert}; chmod 400 %{sslcert}; +chown lsadm.lsadm %{sslkey}; chmod 400 %{sslkey}; +ln -s /usr/lsws/fcgi-bin/lsphp5 /usr/lsws/fcgi-bin/lsphp + +/usr/lsws/admin/misc/rc-inst.sh > /dev/null 2>&1 +echo "Запустите скрипт admpass.sh от лица привилегированного пользователя root, чтобы задать пароль пользователю admin. Скрипт находится в директории: /usr/lsws/admin/misc/admpass.sh. Запишите пароль, чтобы не потерять доступ к веб серверу, после создания пароля он будет храниться в зашифрованном виде." +echo "Чтобы запустить сервер openlitespeed выполните команду: systemctl restart lsws" + + +%files +%defattr(-,root,root,-) +/etc/init.d/lsws +%dir /usr/lsws +/usr/lsws/* +%config(noreplace) /usr/lsws/conf/* +%config(noreplace) /usr/lsws/admin/conf/* +%config(noreplace) /usr/lsws/fcgi-bin/* +%config(noreplace) /usr/lsws/PLAT + +%files -n ols-pagespeed +%defattr(-,root,root,-) +%attr(-,root,root) /usr/lsws/modules/modpagespeed.so + +%files -n ols-modsecurity +%defattr(-,root,root,-) +%attr(-,root,root) /usr/lsws/modules/mod_security.so + +%files -n ols-lua +%defattr(-,root,root,-) +%attr(-,root,root) /usr/lsws/modules/mod_lua.so + +%changelog +* Wed Sep 18 2024 Eduard Basov - 1.8.2 +- Rebuild for MSVSphere 9.4 + -- 2.36.5 From 5ca608071e4253668d9675ba4a92c984ba981d16 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 30 Sep 2024 15:59:34 +0300 Subject: [PATCH 02/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updating .spec --- SPECS/openlitespeed.spec | 89 ++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 54a891e..e7d1fa6 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,9 +1,9 @@ Name: openlitespeed Version: 1.8.2 Release: 1%{?dist} -Summary: OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. +Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GNU General Public License v3.0 -Url: https://github.com/litespeedtech/openlitespeed +Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: %{name}.tar.xz Source1: third-party.tar.xz @@ -25,58 +25,52 @@ BuildRequires: docbook2X %description OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. -%package -n ols-lua -Group: Application/WebServer +%package -n %{name}-lua Summary: Lua -Requires: openlitespeed == %{version} +Requires: openlitespeed = %{version}-%{release} -%description -n ols-lua +%description -n %{name}-lua Mod Lua module for openlitespeed webserver. -%package -n ols-pagespeed -Group: Application/WebServer +%package -n %{name}-pagespeed Summary: Pagespeed -Requires: openlitespeed == %{version} +Requires: openlitespeed = %{version}-%{release} -%description -n ols-pagespeed +%description -n %{name}-pagespeed Pagespeed module for openlitespeed webserver. -%package -n ols-modsecurity -Group: Application/WebServer +%package -n %{name}-modsecurity Summary: Mod Security -Requires: openlitespeed == %{version} +Requires: openlitespeed = %{version}-%{release} -%description -n ols-modsecurity +%description -n %{name}-modsecurity Mod Security for openlitespeed webserver. %prep -tar -xpaf %{_sourcedir}/openlitespeed.tar.xz -C %{_builddir} -#mv %{_builddir}/openlitespeed-1.8.2-1/openlitespeed/ %{_builddir} -#rm -rf %{_builddir}/openlitespeed-1.8.2-1 -tar -xpaf %{_sourcedir}/third-party.tar.xz -C %{_builddir} +%autosetup -n %{name} -b1 %build -sh -xe %{_builddir}/openlitespeed/build.sh +sh -e build.sh %install -install -m 755 -d %{buildroot}/usr/lsws -rm -rf %{_builddir}/openlitespeed/dist/ols.conf -buildroot_path=$(rpm --eval "%{buildroot}") -sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' %{_builddir}/openlitespeed/dist/install.sh -sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" %{_builddir}/openlitespeed/dist/install.sh -sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' %{_builddir}/openlitespeed/dist/install.sh -sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' %{_builddir}/openlitespeed/dist/_in.sh -sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' %{_builddir}/openlitespeed/dist/install.sh -sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' %{_builddir}/openlitespeed/dist/functions.sh -%{_builddir}/openlitespeed/dist/install.sh +install -dm 755 %{buildroot}/usr/lsws +rm dist/ols.conf +local buildroot_path=$(rpm --eval "%{buildroot}") +sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' dist/install.sh +sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" dist/install.sh +sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' dist/install.sh +sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' dist/_in.sh +sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' dist/install.sh +sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' dist/functions.sh +sh dist/install.sh rm -f %{buildroot}/usr/lsws/admin/conf/admin_config.conf -cp -pr %{_builddir}/openlitespeed/dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf +cp -pr dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf install -m 755 -d %{buildroot}/etc/init.d chmod u+w %{buildroot}/usr/lsws/admin/misc/lsws.rc -sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc -sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws +sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc +sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws chmod 0755 %{buildroot}/etc/init.d/lsws sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}/usr/lsws/conf/httpd_config.conf echo 'RPM' > %{buildroot}/usr/lsws/PLAT @@ -89,7 +83,6 @@ rm %{buildroot}/usr/lsws/fcgi-bin/lsphp rm %{buildroot}/usr/lsws/admin/misc/lsws.rc.gentoo -%clean %pre getent group lsadm > /dev/null || groupadd -r lsadm lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1 @@ -97,6 +90,11 @@ getent passwd lsadm > /dev/null || useradd -g $lsadm_gid -d / -r -s /sbin/nologi usermod -G lsadm,nobody lsadm >/dev/null 2>&1 exit 0 +%preun +userdel -r lsadm +groupdel lsadm +rm -rf /usr/lsws/ + %post DEFAULT_USER="nobody" DEFAULT_GROUP="nobody" @@ -157,7 +155,6 @@ chgrp $WS_GROUP /usr/lsws/admin/tmp >/dev/null 2>&1 chown "$CONF_OWN" $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 chown "$DIR_OWN" $LSWS_HOME/cachedata >/dev/null 2>&1 chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 -chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 chown "$CONF_OWN" "$LSWS_HOME/admin/conf/htpasswd" >/dev/null 2>&1 @@ -169,8 +166,8 @@ chown "$LOGDIR_OWN" "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1 chmod 0750 "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1 #########this is the end of script to fix rpm build related file group and permission problem. -SSL_COUNTRY='US' -SSL_STATE="New Jersey" +SSL_COUNTRY='RU' +SSL_STATE="Moscow" SSL_LOCALITY='Virtual' SSL_ORG='LiteSpeedCommunity' SSL_ORGUNIT='Testing' @@ -210,12 +207,11 @@ chown lsadm.lsadm %{sslkey}; chmod 400 %{sslkey}; ln -s /usr/lsws/fcgi-bin/lsphp5 /usr/lsws/fcgi-bin/lsphp /usr/lsws/admin/misc/rc-inst.sh > /dev/null 2>&1 -echo "Запустите скрипт admpass.sh от лица привилегированного пользователя root, чтобы задать пароль пользователю admin. Скрипт находится в директории: /usr/lsws/admin/misc/admpass.sh. Запишите пароль, чтобы не потерять доступ к веб серверу, после создания пароля он будет храниться в зашифрованном виде." -echo "Чтобы запустить сервер openlitespeed выполните команду: systemctl restart lsws" +echo "To change admin password run /usr/lsws/admin/misc/admpass.sh script" +echo "To start the openlitespeed server, run the command: systemctl restart lsws" %files -%defattr(-,root,root,-) /etc/init.d/lsws %dir /usr/lsws /usr/lsws/* @@ -224,17 +220,14 @@ echo "Чтобы запустить сервер openlitespeed выполнит %config(noreplace) /usr/lsws/fcgi-bin/* %config(noreplace) /usr/lsws/PLAT -%files -n ols-pagespeed -%defattr(-,root,root,-) -%attr(-,root,root) /usr/lsws/modules/modpagespeed.so +%files -n %{name}-pagespeed +/usr/lsws/modules/modpagespeed.so -%files -n ols-modsecurity -%defattr(-,root,root,-) -%attr(-,root,root) /usr/lsws/modules/mod_security.so +%files -n %{name}-modsecurity +/usr/lsws/modules/mod_security.so -%files -n ols-lua -%defattr(-,root,root,-) -%attr(-,root,root) /usr/lsws/modules/mod_lua.so +%files -n %{name}-lua +/usr/lsws/modules/mod_lua.so %changelog * Wed Sep 18 2024 Eduard Basov - 1.8.2 -- 2.36.5 From b3b3ead8966401e54a70dcf2333509e920d72495 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 30 Sep 2024 16:14:32 +0300 Subject: [PATCH 03/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index e7d1fa6..42c032c 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,7 +1,7 @@ Name: openlitespeed Version: 1.8.2 Release: 1%{?dist} -Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. +Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GNU General Public License v3.0 Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -- 2.36.5 From 4a2b556d827fc6210a74b9bc70a60f2ef895b92e Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 30 Sep 2024 16:15:45 +0300 Subject: [PATCH 04/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 42c032c..57d1204 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,7 +1,7 @@ Name: openlitespeed Version: 1.8.2 Release: 1%{?dist} -Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. +Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GNU General Public License v3.0 Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -- 2.36.5 From 26cb8c01a7fa9a69e4a64648be9e8604d2e3a1bb Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 30 Sep 2024 16:16:51 +0300 Subject: [PATCH 05/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 57d1204..b00cc18 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,7 +1,7 @@ Name: openlitespeed Version: 1.8.2 Release: 1%{?dist} -Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. +Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GNU General Public License v3.0 Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -- 2.36.5 From 5d6f0213c6205f923b1838a86396f498cc7a4557 Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 4 Oct 2024 00:23:08 +0300 Subject: [PATCH 06/16] Add other .tar.gz/xz --- .gitignore | 6 +- .openlitespeed.metadata | 6 +- SOURCES/openlitespeed.patch | 474 ++++++++++++++++++++++++++++++++++++ SPECS/openlitespeed.spec | 166 +++++++------ 4 files changed, 580 insertions(+), 72 deletions(-) create mode 100644 SOURCES/openlitespeed.patch diff --git a/.gitignore b/.gitignore index bfbc67f..785503c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ -SOURCES/openlitespeed.tar.xz +SOURCES/openlitespeed-1.8.2.tar.gz SOURCES/third-party.tar.xz +SOURCES/admin_php.tar.xz +SOURCES/ls-hpack-2.3.3.tar.gz +SOURCES/ls-qpack-2.5.4.tar.gz +SOURCES/lsquic-4.0.12.tar.gz diff --git a/.openlitespeed.metadata b/.openlitespeed.metadata index bc993ac..d38c93b 100644 --- a/.openlitespeed.metadata +++ b/.openlitespeed.metadata @@ -1,2 +1,6 @@ -c01524a8749eb18dff566966389c8a33eb8c443a SOURCES/openlitespeed.tar.xz +b737416510aafc37fc2e1cf0f64b57b66f1db854 SOURCES/admin_php.tar.xz +343f961c9b93d36b4a8874f9fbf9e3087b0e7e00 SOURCES/ls-hpack-2.3.3.tar.gz +8ad5b9c2da97e40a0efc1927def334957ea14c58 SOURCES/ls-qpack-2.5.4.tar.gz +ea49cda7da4b07fe1cfd14d3c29f2232616c461c SOURCES/lsquic-4.0.12.tar.gz +068b78e67475debd2321fed6195989dad28dad43 SOURCES/openlitespeed-1.8.2.tar.gz 63ea80ec5e804e3b06cbe1d88ee300d08208719b SOURCES/third-party.tar.xz diff --git a/SOURCES/openlitespeed.patch b/SOURCES/openlitespeed.patch new file mode 100644 index 0000000..56c97df --- /dev/null +++ b/SOURCES/openlitespeed.patch @@ -0,0 +1,474 @@ +diff --git a/dist/admin/misc/lscmctl b/dist/admin/misc/lscmctl +index ee0f595..e2372e8 100755 +--- a/dist/admin/misc/lscmctl ++++ b/dist/admin/misc/lscmctl +@@ -92,14 +92,7 @@ printHelp() + + updateMinAPIVerFile() + { +- MIN_VER=$(wget -q https://www.litespeed.sh/sub/shared/MIN_VER -O -) +- RET=$? +- +- if [ "${RET}" = "127" ] ; then +- errorExit "Required command 'wget' not found with exit code 127." +- elif [ "$RET" != "0" ] ; then +- errorExit "Failed to download latest MIN_VER file with wget exit status ${RET}." +- fi ++ MIN_VER=1.17.1.1 + + echo "${MIN_VER}" > "${SHARED_API_MIN_VER_FILE}" + } +diff --git a/build.sh b/build.sh +index 949dda5..29f77be 100755 +--- a/build.sh ++++ b/build.sh +@@ -50,21 +50,21 @@ else + exit 1 + fi + +-APP_MGR_CMD= +-for APP_MGR in ${APP_MGRS}; do +- APP_MGR_CHECK=`which ${APP_MGR} &>/dev/null` +- if [ $? -eq 0 ] ; then +- APP_MGR_CMD="${APP_MGR}" +- FULL_APP_MGR_CMD=$APP_MGR_CMD +- break +- fi +-done +- +-echo OS is ${OS}, APP_MGR_CMD is ${APP_MGR_CMD}. +-if [ "x${APP_MGR_CMD}" = "x" ] ; then +- echo 'Can not find package installation command, quit.' +- exit 1 +-fi ++#APP_MGR_CMD= ++#for APP_MGR in ${APP_MGRS}; do ++# APP_MGR_CHECK=`which ${APP_MGR} &>/dev/null` ++# if [ $? -eq 0 ] ; then ++# APP_MGR_CMD="${APP_MGR}" ++# FULL_APP_MGR_CMD=$APP_MGR_CMD ++# break ++# fi ++#done ++# ++#echo OS is ${OS}, APP_MGR_CMD is ${APP_MGR_CMD}. ++#if [ "x${APP_MGR_CMD}" = "x" ] ; then ++# echo 'Can not find package installation command, quit.' ++# exit 1 ++#fi + + + # getVersionNumber0() +@@ -229,27 +229,6 @@ installgo() + fi + } + +- +-preparelibquic() +-{ +- if [ -e lsquic ] ; then +- ls src/ | grep liblsquic +- if [ $? -eq 0 ] ; then +- echo Need to git download the submodule ... +- rm -rf lsquic +- git clone https://github.com/litespeedtech/lsquic.git +- cd lsquic +- +- LIBQUICVER=`cat ../LSQUICCOMMIT` +- echo "LIBQUICVER is ${LIBQUICVER}" +- git checkout ${LIBQUICVER} +- git submodule update --init --recursive +- cd .. +- +- fi +- fi +-} +- + prepareLinux() + { + OSTYPE=unknownlinux +@@ -486,25 +465,13 @@ updateSrcCMakelistfile() + + cpModuleSoFiles() + { +- if [ ! -d dist/modules/ ] ; then +- mkdir dist/modules/ +- fi +- +- for module in build/src/modules/*; do +- cp -f ${module}/*.so dist/modules/ +- done +- +- if [ -e build/src/modules/modsecurity-ls/mod_security.so ] ; then +- cp -f build/src/modules/modsecurity-ls/mod_security.so dist/modules/ +- fi ++ mkdir dist/modules/ ++ cp -f build/src/modules/modsecurity-ls/mod_security.so dist/modules/ + +- if [ -e build/src/modules/lua/mod_lua.so ] ; then +- cp -f build/src/modules/lua/mod_lua.so dist/modules/ +- fi ++ cp -f build/src/modules/lua/mod_lua.so dist/modules/ ++ ++ cp -f build/src/modules/pagespeed/modpagespeed.so dist/modules/ + +- if [ -e build/src/modules/pagespeed/modpagespeed.so ] ; then +- cp -f build/src/modules/pagespeed/modpagespeed.so dist/modules/ +- fi + } + + +@@ -514,9 +481,6 @@ fixshmdir() + mkdir /tmp/shm + chmod 777 /tmp/shm + sed -i -e "s/\/dev\/shm/\/tmp\/shm/g" dist/conf/httpd_config.conf.in +- if [ "${OS}" = "FreeBSD" ] ; then +- echo 'link /tmp/shm shm' >> /etc/devfs.conf +- fi + fi + } + +@@ -574,7 +538,7 @@ if [ "${OS}" = "FreeBSD" ] ; then + prepareBsd + elif [ "${OS}" = "Linux" ] ; then + ISLINUX=yes +- prepareLinux ++# prepareLinux + elif [ "${OS}" = "Darwin" ] ; then + prepareMac + fi +@@ -582,32 +546,26 @@ fi + + + cd .. +-if [ ! -d third-party ]; then +- +- git clone https://github.com/litespeedtech/third-party.git +- mkdir third-party/lib64 +- cd third-party/script/ +- +- #Remove unittest-cpp and add bcrypt +- sed -i -e "s/unittest-cpp/bcrypt/g" ./build_ols.sh +- if [ "$MOD_SECURITY" != "ON" ]; then +- sed -i -e "s/libmodsec/ /g" ./build_ols.sh +- fi +- if [ "$MOD_PAGESPEED" != "ON" ]; then +- sed -i -e "s/psol/ /g" ./build_ols.sh +- fi +- if [ "$MOD_LUA" != "ON" ]; then +- sed -i -e "s/luajit/ /g" ./build_ols.sh +- fi +- +- ./build_ols.sh ++mkdir third-party/lib64 ++cd third-party/script/ + ++#Remove unittest-cpp and add bcrypt ++sed -i -e "s/unittest-cpp/bcrypt/g" ./build_ols.sh ++if [ "$MOD_SECURITY" != "ON" ]; then ++ sed -i -e "s/libmodsec/ /g" ./build_ols.sh ++fi ++if [ "$MOD_PAGESPEED" != "ON" ]; then ++ sed -i -e "s/psol/ /g" ./build_ols.sh + fi ++if [ "$MOD_LUA" != "ON" ]; then ++ sed -i -e "s/luajit/ /g" ./build_ols.sh ++fi ++ ++./build_ols.sh + + cd ${CURDIR} + + updateSrcCMakelistfile +-preparelibquic + + + if [ "$MOD_PAGESPEED" = "ON" ]; then +@@ -625,7 +583,7 @@ fi + cd src/modules/lsrecaptcha + export GOPATH=$CUR_PATH/src/modules/lsrecaptcha + export GO111MODULE=off +-go build lsrecaptcha ++./build_lsrecaptcha.sh + cp lsrecaptcha ../../../dist/lsrecaptcha/_recaptcha + cd ../../../ + +@@ -660,9 +618,9 @@ jobs=$(nproc) + make -j${jobs} + cd .. + +-cp build/src/openlitespeed dist/bin/ ++mv build/src/openlitespeed dist/bin/ + if [ -e build/support/unmount_ns/unmount_ns ] ; then +- cp build/support/unmount_ns/unmount_ns dist/bin/ ++ mv build/support/unmount_ns/unmount_ns dist/bin/ + fi + + cpModuleSoFiles +@@ -672,11 +630,11 @@ if [ -e src/liblsquic ] ; then + freebsdFix + fi + +-cat > ./ols.conf < ./dist/ols.conf < ./install.sh < ./dist/install.sh </dev/null 2>&1 + + +@@ -796,7 +753,7 @@ fi + + END + +-chmod 777 ./install.sh ++chmod 777 ./dist/install.sh + + echo -e "\033[38;5;71mBuilding finished, please run ./install.sh for installation.\033[39m" + echo -e "\033[38;5;71mYou may want to update the ols.conf to change the settings before installation.\033[39m" +diff --git a/dist/functions.sh b/dist/functions.sh +index fb7a33c..52fb032 100755 +--- a/dist/functions.sh ++++ b/dist/functions.sh +@@ -398,11 +398,11 @@ EOF + DIR_OWN=$WS_USER:$WS_GROUP + CONF_OWN=$WS_USER:$WS_GROUP + +- if [ $INST_USER = "root" ]; then +- if [ $SUCC -eq "1" ]; then +- chown -R "$DIR_OWN" "$LSWS_HOME" +- fi +- fi ++# if [ $INST_USER = "root" ]; then ++# if [ $SUCC -eq "1" ]; then ++ # chown -R "$DIR_OWN" "$LSWS_HOME" ++ # fi ++ # fi + } + + stopLshttpd() +@@ -650,7 +650,7 @@ util_mkdir() + if [ ! -d "$LSWS_HOME/$arg" ]; then + mkdir "$LSWS_HOME/$arg" + fi +- chown "$OWNER" "$LSWS_HOME/$arg" ++ #chown "$OWNER" "$LSWS_HOME/$arg" + chmod $PERM "$LSWS_HOME/$arg" + done + +@@ -667,7 +667,7 @@ util_cpfile() + do + if [ -f "$LSINSTALL_DIR/$arg" ]; then + cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" +- chown "$OWNER" "$LSWS_HOME/$arg" ++ #chown "$OWNER" "$LSWS_HOME/$arg" + chmod $PERM "$LSWS_HOME/$arg" + fi + done +@@ -686,7 +686,7 @@ util_ccpfile() + cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" + fi + if [ -f "$LSWS_HOME/$arg" ]; then +- chown "$OWNER" "$LSWS_HOME/$arg" ++ #chown "$OWNER" "$LSWS_HOME/$arg" + chmod $PERM "$LSWS_HOME/$arg" + fi + done +@@ -702,7 +702,7 @@ util_cpdir() + for arg + do + cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/" +- chown -R "$OWNER" "$LSWS_HOME/$arg/"* ++ #chown -R "$OWNER" "$LSWS_HOME/$arg/"* + #chmod -R $PERM $LSWS_HOME/$arg/* + done + } +@@ -713,7 +713,7 @@ util_cp_htaccess() + PERM=$2 + arg=$3 + cp -R "$LSINSTALL_DIR/$arg/".htaccess "$LSWS_HOME/$arg/" +- chown -R "$OWNER" "$LSWS_HOME/$arg/".htaccess ++ #chown -R "$OWNER" "$LSWS_HOME/$arg/".htaccess + } + + +@@ -729,7 +729,7 @@ util_cpdirv() + for arg + do + cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$VERSION/" +- chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION" ++ #chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION" + $TEST_BIN -L "$LSWS_HOME/$arg" + if [ $? -eq 0 ]; then + rm -f "$LSWS_HOME/$arg" +@@ -751,7 +751,7 @@ util_cpfilev() + for arg + do + cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$VERSION" +- chown "$OWNER" "$LSWS_HOME/$arg.$VERSION" ++ #chown "$OWNER" "$LSWS_HOME/$arg.$VERSION" + chmod $PERM "$LSWS_HOME/$arg.$VERSION" + $TEST_BIN -L "$LSWS_HOME/$arg" + if [ $? -eq 0 ]; then +@@ -768,7 +768,7 @@ installation1() + umask 022 + if [ $INST_USER = "root" ]; then + SDIR_OWN="root:$ROOTGROUP" +- chown $SDIR_OWN $LSWS_HOME ++ #chown $SDIR_OWN $LSWS_HOME + else + SDIR_OWN=$DIR_OWN + fi +@@ -783,7 +783,7 @@ installation1() + if [ ! -f "$LSWS_HOME/$arg" ]; then + cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg" + fi +- chown "$OWNER" "$LSWS_HOME/$arg" ++ #chown "$OWNER" "$LSWS_HOME/$arg" + chmod $PERM "$LSWS_HOME/$arg" + done + } +@@ -798,7 +798,7 @@ util_cpdir() + for arg + do + cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/" +- chown -R "$OWNER" "$LSWS_HOME/$arg/"* ++ #chown -R "$OWNER" "$LSWS_HOME/$arg/"* + #chmod -R $PERM $LSWS_HOME/$arg/* + done + } +@@ -817,7 +817,7 @@ util_cpdirv() + do + if [ -d "$LSINSTALL_DIR/$arg" ]; then + cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$VERSION/" +- chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION" ++ #chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION" + $TEST_BIN -L "$LSWS_HOME/$arg" + if [ $? -eq 0 ]; then + rm -f "$LSWS_HOME/$arg" +@@ -842,7 +842,7 @@ util_cpfilev() + if [ -f "$LSINSTALL_DIR/$arg" ]; then + + cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$VERSION" +- chown "$OWNER" "$LSWS_HOME/$arg.$VERSION" ++ #chown "$OWNER" "$LSWS_HOME/$arg.$VERSION" + chmod $PERM "$LSWS_HOME/$arg.$VERSION" + $TEST_BIN -L "$LSWS_HOME/$arg" + if [ $? -eq 0 ]; then +@@ -914,7 +914,7 @@ installation_lscpd() + fi + SDIR_OWN="root:$ROOTGROUP" + LOGDIR_OWN="root:$WS_GROUP" +- chown $SDIR_OWN $LSWS_HOME ++ #chown $SDIR_OWN $LSWS_HOME + else + SDIR_OWN=$DIR_OWN + LOGDIR_OWN=$DIR_OWN +@@ -974,7 +974,7 @@ installation() + fi + SDIR_OWN="root:$ROOTGROUP" + LOGDIR_OWN="root:$WS_GROUP" +- chown $SDIR_OWN $LSWS_HOME ++ #chown $SDIR_OWN $LSWS_HOME + else + SDIR_OWN=$DIR_OWN + LOGDIR_OWN=$DIR_OWN +@@ -993,10 +993,10 @@ installation() + util_mkdir "$DIR_OWN" $SDIR_MOD tmp/ocspcache +- chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/cgid ++ #chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/cgid + chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/cgid +- chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 +- chown $DIR_OWN $LSWS_HOME/cachedata +- chown $DIR_OWN $LSWS_HOME/autoupdate +- chown $DIR_OWN $LSWS_HOME/tmp ++ #chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 ++ #chown $DIR_OWN $LSWS_HOME/cachedata ++ #chown $DIR_OWN $LSWS_HOME/autoupdate ++ #chown $DIR_OWN $LSWS_HOME/tmp + util_mkdir "$SDIR_OWN" $DIR_MOD Example + + find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null +@@ -1076,7 +1076,7 @@ installation() + fi + + #change conf own as lsadm:nobody permission 750 +- chown -R lsadm:$WS_GROUP "$LSWS_HOME/conf/" ++ #chown -R lsadm:$WS_GROUP "$LSWS_HOME/conf/" + chmod -R 0750 "$LSWS_HOME/conf/" + + chmod 0600 "$LSWS_HOME/conf/httpd_config.conf" +diff --git a/dist/install.sh b/dist/install.sh +index d38d958..acd4a94 100755 +--- a/dist/install.sh ++++ b/dist/install.sh +@@ -33,7 +33,7 @@ inst_admin_php() + + if [ "x$OS" = "xLinux" ] ; then + if [ "x$ARCH" = "xx86_64" ] ; then +- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/x86_64/lsphp5 ++ mv $TEMPDIR/admin/fcgi-bin/admin_php $LSWS_HOME/admin/fcgi-bin/ + elif [ "x$ARCH" = "xaarch64" ] ; then + $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp7_bin/aarch64/lsphp + else +@@ -183,6 +183,7 @@ inst_lsphp7() + + #script start here + cd `dirname "$0"` ++TEMPDIR=$(pwd) + . ./functions.sh + if [ $? != 0 ] ; then + echo "[ERROR] Can not include 'functions.sh'." +@@ -404,10 +405,9 @@ if [ "x$IS_LSCPD" != "xyes" ] ; then + $LSWS_HOME/admin/misc/create_admin_keypair.sh + fi + +- chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" ++ + chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" + +- chown "$CONF_OWN" "$LSWS_HOME/admin/conf/htpasswd" + chmod 0600 "$LSWS_HOME/admin/conf/htpasswd" + + +diff --git a/src/modules/modsecurity-ls/CMakeLists.txt b/src/modules/modsecurity-ls/CMakeLists.txt +index c091ad9..f110452 100644 +--- a/src/modules/modsecurity-ls/CMakeLists.txt ++++ b/src/modules/modsecurity-ls/CMakeLists.txt +@@ -1,6 +1,6 @@ + cmake_minimum_required(VERSION 3.0) + +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17 -Wall") + + include_directories(${PROJECT_SOURCE_DIR}/../third-party/ModSecurity/headers/) + diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index b00cc18..4064d8a 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,12 +1,20 @@ +%global _lsws_dir %{_prefix}/lsws + Name: openlitespeed Version: 1.8.2 Release: 1%{?dist} -Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. -License: GNU General Public License v3.0 +Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. +License: GPLv3+ Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source0: %{name}.tar.xz +Source0: %{name}-%{version}.tar.gz Source1: third-party.tar.xz +Source2: lsquic-4.0.12.tar.gz +Source3: ls-hpack-2.3.3.tar.gz +Source4: admin_php.tar.xz +Source5: ls-qpack-2.5.4.tar.gz + +Patch0: openlitespeed.patch BuildRequires: gcc BuildRequires: g++ @@ -25,64 +33,75 @@ BuildRequires: docbook2X %description OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. -%package -n %{name}-lua +%package lua Summary: Lua -Requires: openlitespeed = %{version}-%{release} +Requires: %{name} = %{version}-%{release} -%description -n %{name}-lua +%description lua Mod Lua module for openlitespeed webserver. -%package -n %{name}-pagespeed +%package pagespeed Summary: Pagespeed -Requires: openlitespeed = %{version}-%{release} +Requires: %{name} = %{version}-%{release} -%description -n %{name}-pagespeed +%description pagespeed Pagespeed module for openlitespeed webserver. -%package -n %{name}-modsecurity +%package modsecurity Summary: Mod Security -Requires: openlitespeed = %{version}-%{release} +Requires: %{name} = %{version}-%{release} -%description -n %{name}-modsecurity +%description modsecurity Mod Security for openlitespeed webserver. %prep -%autosetup -n %{name} -b1 +%autosetup -p1 -b1 +tar -xpaf %{SOURCE2} +tar -xpaf %{SOURCE3} +mkdir %{_builddir}/%{name}-%{version}/dist/admin/fcgi-bin +tar -xpaf %{SOURCE4} -C %{_builddir}/%{name}-%{version}/dist/admin/fcgi-bin/ +tar -xpaf %{SOURCE5} %build -sh -e build.sh +rm -rf lsquic +mv lsquic-4.0.12/ lsquic +rm -rf lsquic/src/lshpack +mv ls-hpack-2.3.3/ lsquic/src/lshpack +rm -rf lsquic/src/liblsquic/ls-qpack +mv ls-qpack-2.5.4/ lsquic/src/liblsquic/ls-qpack +sh -xe build.sh %install -install -dm 755 %{buildroot}/usr/lsws -rm dist/ols.conf -local buildroot_path=$(rpm --eval "%{buildroot}") +install -dm 755 %{buildroot}%{_lsws_dir} +rm -f dist/ols.conf +buildroot_path=$(rpm --eval "%{buildroot}") sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' dist/install.sh sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" dist/install.sh sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' dist/install.sh sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' dist/_in.sh sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' dist/install.sh sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' dist/functions.sh -sh dist/install.sh -rm -f %{buildroot}/usr/lsws/admin/conf/admin_config.conf -cp -pr dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf -sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf -sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf -install -m 755 -d %{buildroot}/etc/init.d -chmod u+w %{buildroot}/usr/lsws/admin/misc/lsws.rc -sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc -sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws -chmod 0755 %{buildroot}/etc/init.d/lsws -sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}/usr/lsws/conf/httpd_config.conf -echo 'RPM' > %{buildroot}/usr/lsws/PLAT -chmod 755 %{buildroot}/usr/lsws/bin/unmount_ns -chmod 755 %{buildroot}/usr/lsws/lsrecaptcha/_recaptcha -chmod 755 %{buildroot}/usr/lsws/admin/fcgi-bin/admin_php -chmod 755 %{buildroot}/usr/lsws/fcgi-bin/lsphp5 -chmod 755 %{buildroot}/usr/lsws/admin/fcgi-bin/admin_php -rm %{buildroot}/usr/lsws/fcgi-bin/lsphp -rm %{buildroot}/usr/lsws/admin/misc/lsws.rc.gentoo +dist/install.sh +rm -f %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf +cp -pr dist/admin/conf/admin_config_ssl.conf.in %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf +sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf +sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf +install -m 755 -d %{buildroot}/%{_sysconfdir}/systemd/system +cp %{buildroot}%{_lsws_dir}/admin/misc/lshttpd.service %{buildroot}%{_sysconfdir}/systemd/system +chmod u+w %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc +sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc +sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}%{_lsws_dir}/conf/httpd_config.conf +echo 'RPM' > %{buildroot}%{_lsws_dir}/PLAT +chmod 755 %{buildroot}%{_lsws_dir}/bin/unmount_ns +chmod 755 %{buildroot}%{_lsws_dir}/lsrecaptcha/_recaptcha +chmod 755 %{buildroot}%{_lsws_dir}/admin/fcgi-bin/admin_php +chmod 755 %{buildroot}%{_lsws_dir}/fcgi-bin/lsphp5 +chmod 755 %{buildroot}%{_lsws_dir}/admin/fcgi-bin/admin_php +rm -f %{buildroot}%{_lsws_dir}/fcgi-bin/lsphp +rm -f %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc.gentoo +%clean %pre getent group lsadm > /dev/null || groupadd -r lsadm lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1 @@ -91,9 +110,13 @@ usermod -G lsadm,nobody lsadm >/dev/null 2>&1 exit 0 %preun +%systemd_preun lsws + +%postun userdel -r lsadm groupdel lsadm -rm -rf /usr/lsws/ +rm -rf %{_lsws_dir} +%systemd_postun lsws %post DEFAULT_USER="nobody" @@ -137,24 +160,25 @@ if [ $? -eq 0 ]; then fi SDIR_OWN="root:root" chown $SDIR_OWN $LSWS_HOME >/dev/null 2>&1 -chown "$CONF_OWN" -R /usr/lsws/conf >/dev/null 2>&1 -chown "$CONF_OWN" -R /usr/lsws/phpbuild >/dev/null 2>&1 +chown "$CONF_OWN" -R %{_lsws_dir}/conf >/dev/null 2>&1 +chown "$CONF_OWN" -R %{_lsws_dir}/phpbuild >/dev/null 2>&1 if [ -d "/usr/lsws/autoupdate" ]; then - chown "$CONF_OWN" -R /usr/lsws/autoupdate >/dev/null 2>&1 + chown "$CONF_OWN" -R %{_lsws_dir}/autoupdate >/dev/null 2>&1 fi if [ -d "/usr/lsws/DEFAULT/conf" ]; then - chown "$CONF_OWN" -R /usr/lsws/DEFAULT/conf >/dev/null 2>&1 + chown "$CONF_OWN" -R %{_lsws_dir}/DEFAULT/conf >/dev/null 2>&1 fi if [ -d "/usr/lsws/Example/conf" ]; then - chown "$CONF_OWN" -R /usr/lsws/Example/conf >/dev/null 2>&1 + chown "$CONF_OWN" -R %{_lsws_dir}/Example/conf >/dev/null 2>&1 fi -chown "$CONF_OWN" -R /usr/lsws/admin/conf >/dev/null 2>&1 -chown "$CONF_OWN" -R /usr/lsws/admin/tmp >/dev/null 2>&1 -chgrp $WS_GROUP /usr/lsws/admin/cgid >/dev/null 2>&1 -chgrp $WS_GROUP /usr/lsws/admin/tmp >/dev/null 2>&1 +chown "$CONF_OWN" -R %{_lsws_dir}/admin/conf >/dev/null 2>&1 +chown "$CONF_OWN" -R %{_lsws_dir}/admin/tmp >/dev/null 2>&1 +chgrp $WS_GROUP %{_lsws_dir}/admin/cgid >/dev/null 2>&1 +chgrp $WS_GROUP %{_lsws_dir}/admin/tmp >/dev/null 2>&1 chown "$CONF_OWN" $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1 chown "$DIR_OWN" $LSWS_HOME/cachedata >/dev/null 2>&1 chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 +chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1 chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1 chown "$CONF_OWN" "$LSWS_HOME/admin/conf/htpasswd" >/dev/null 2>&1 @@ -173,14 +197,14 @@ SSL_ORG='LiteSpeedCommunity' SSL_ORGUNIT='Testing' SSL_HOSTNAME='webadmin' COMMNAME='openlitespeed.host' -SSL_COUNTRY=US -SSL_STATE="New Jersey" +SSL_COUNTRY=RU +SSL_STATE="Moscow" csr="${SSL_HOSTNAME}.csr" key="${SSL_HOSTNAME}.key" cert="${SSL_HOSTNAME}.crt" -%define sslcert /usr/lsws/admin/conf/${cert} -%define sslkey /usr/lsws/admin/conf/${key} +%define sslcert %{_lsws_dir}/admin/conf/${cert} +%define sslkey %{_lsws_dir}/admin/conf/${key} cat << EOF > ${csr} [req] @@ -192,7 +216,7 @@ countryName = ${SSL_COUNTRY} localityName = Virtual organizationName = LiteSpeedCommunity organizationalUnitName = Testing -stateOrProvinceName = NJ +stateOrProvinceName = RU emailAddress = mail@${COMMNAME} name = openlitespeed initials = CP @@ -204,30 +228,32 @@ EOF openssl req -x509 -config $csr -extensions 'server_exts' -nodes -days 820 -newkey rsa:2048 -keyout %{sslkey} -out %{sslcert} chown lsadm.lsadm %{sslcert}; chmod 400 %{sslcert}; chown lsadm.lsadm %{sslkey}; chmod 400 %{sslkey}; -ln -s /usr/lsws/fcgi-bin/lsphp5 /usr/lsws/fcgi-bin/lsphp +ln -s %{_lsws_dir}/fcgi-bin/lsphp5 %{_lsws_dir}/fcgi-bin/lsphp + +%systemd_post lsws -/usr/lsws/admin/misc/rc-inst.sh > /dev/null 2>&1 echo "To change admin password run /usr/lsws/admin/misc/admpass.sh script" -echo "To start the openlitespeed server, run the command: systemctl restart lsws" +echo "To start the openlitespeed server, run the command: systemctl start lsws" %files -/etc/init.d/lsws -%dir /usr/lsws -/usr/lsws/* -%config(noreplace) /usr/lsws/conf/* -%config(noreplace) /usr/lsws/admin/conf/* -%config(noreplace) /usr/lsws/fcgi-bin/* -%config(noreplace) /usr/lsws/PLAT - -%files -n %{name}-pagespeed -/usr/lsws/modules/modpagespeed.so - -%files -n %{name}-modsecurity -/usr/lsws/modules/mod_security.so - -%files -n %{name}-lua -/usr/lsws/modules/mod_lua.so +/etc/systemd/system/lshttpd.service +%doc README.md +%dir %{_lsws_dir} +%{_lsws_dir}/* +%config(noreplace) %{_lsws_dir}/conf/* +%config(noreplace) %{_lsws_dir}/admin/conf/* +%config(noreplace) %{_lsws_dir}/fcgi-bin/* +%config(noreplace) %{_lsws_dir}/PLAT + +%files pagespeed +%{_lsws_dir}/modules/modpagespeed.so + +%files modsecurity +%{_lsws_dir}/modules/mod_security.so + +%files lua +%{_lsws_dir}/modules/mod_lua.so %changelog * Wed Sep 18 2024 Eduard Basov - 1.8.2 -- 2.36.5 From 7c224071006dfe52ed995478a20140bbb45d5725 Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 4 Oct 2024 00:34:06 +0300 Subject: [PATCH 07/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 4064d8a..f8556a7 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -7,12 +7,12 @@ Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technolo License: GPLv3+ Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Source0: %{name}-%{version}.tar.gz +Source0: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: third-party.tar.xz -Source2: lsquic-4.0.12.tar.gz -Source3: ls-hpack-2.3.3.tar.gz +Source2: https://github.com/litespeedtech/lsquic/archive/refs/tags/v4.0.12.tar.gz#/lsquic-4.0.12.tar.gz +Source3: https://github.com/litespeedtech/ls-hpack/archive/refs/tags/v2.3.3.tar.gz#/ls-hpack-2.3.3.tar.gz Source4: admin_php.tar.xz -Source5: ls-qpack-2.5.4.tar.gz +Source5: https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz#/ls-qpack-2.5.4.tar.gz Patch0: openlitespeed.patch -- 2.36.5 From 6c0d0b4fb614182d6ca24f04c33968a5b39390cc Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 4 Oct 2024 12:33:31 +0300 Subject: [PATCH 08/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index f8556a7..9400e89 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -69,7 +69,7 @@ rm -rf lsquic/src/lshpack mv ls-hpack-2.3.3/ lsquic/src/lshpack rm -rf lsquic/src/liblsquic/ls-qpack mv ls-qpack-2.5.4/ lsquic/src/liblsquic/ls-qpack -sh -xe build.sh +sh -e build.sh %install install -dm 755 %{buildroot}%{_lsws_dir} @@ -101,7 +101,6 @@ rm -f %{buildroot}%{_lsws_dir}/fcgi-bin/lsphp rm -f %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc.gentoo -%clean %pre getent group lsadm > /dev/null || groupadd -r lsadm lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1 -- 2.36.5 From ad989f0199400d2c78be6c99336e0c8c75d965ef Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 4 Oct 2024 14:38:38 +0300 Subject: [PATCH 09/16] Rename .patch --- .../{openlitespeed.patch => fix-tarball-for-local-build.patch} | 0 SPECS/openlitespeed.spec | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename SOURCES/{openlitespeed.patch => fix-tarball-for-local-build.patch} (100%) diff --git a/SOURCES/openlitespeed.patch b/SOURCES/fix-tarball-for-local-build.patch similarity index 100% rename from SOURCES/openlitespeed.patch rename to SOURCES/fix-tarball-for-local-build.patch diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 9400e89..9398805 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -14,7 +14,7 @@ Source3: https://github.com/litespeedtech/ls-hpack/archive/refs/tags/v2.3.3.tar. Source4: admin_php.tar.xz Source5: https://github.com/litespeedtech/ls-qpack/archive/refs/tags/v2.5.4.tar.gz#/ls-qpack-2.5.4.tar.gz -Patch0: openlitespeed.patch +Patch0: fix-tarball-for-local-build.patch BuildRequires: gcc BuildRequires: g++ -- 2.36.5 From 424ac0708217882ae3f626191e960503baa1a2f3 Mon Sep 17 00:00:00 2001 From: ebasov Date: Fri, 4 Oct 2024 16:46:32 +0300 Subject: [PATCH 10/16] Add Requires --- SPECS/openlitespeed.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 9398805..ca9086a 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -30,6 +30,10 @@ BuildRequires: libaio-devel BuildRequires: doxygen BuildRequires: docbook2X +%if 0%{?systemd_requires} +Requires: systemd +%endif + %description OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. -- 2.36.5 From 87e4475ac1a782cf5ad14f1697d82fd1c3725667 Mon Sep 17 00:00:00 2001 From: ebasov Date: Sat, 5 Oct 2024 02:22:07 +0300 Subject: [PATCH 11/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index ca9086a..51eac19 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -200,8 +200,6 @@ SSL_ORG='LiteSpeedCommunity' SSL_ORGUNIT='Testing' SSL_HOSTNAME='webadmin' COMMNAME='openlitespeed.host' -SSL_COUNTRY=RU -SSL_STATE="Moscow" csr="${SSL_HOSTNAME}.csr" key="${SSL_HOSTNAME}.key" cert="${SSL_HOSTNAME}.crt" -- 2.36.5 From cd045caea29bfca749a42472374ec1eaafe87336 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 7 Oct 2024 14:32:24 +0300 Subject: [PATCH 12/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 51eac19..8857d95 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -90,8 +90,8 @@ rm -f %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf cp -pr dist/admin/conf/admin_config_ssl.conf.in %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}%{_lsws_dir}/admin/conf/admin_config.conf -install -m 755 -d %{buildroot}/%{_sysconfdir}/systemd/system -cp %{buildroot}%{_lsws_dir}/admin/misc/lshttpd.service %{buildroot}%{_sysconfdir}/systemd/system +install -m 755 -d %{buildroot}%{_unitdir} +cp %{buildroot}%{_lsws_dir}/admin/misc/lshttpd.service %{buildroot}%{_unitdir} chmod u+w %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}%{_lsws_dir}/conf/httpd_config.conf @@ -238,7 +238,7 @@ echo "To start the openlitespeed server, run the command: systemctl start lsws" %files -/etc/systemd/system/lshttpd.service +%{_unitdir}/lshttpd.service %doc README.md %dir %{_lsws_dir} %{_lsws_dir}/* @@ -257,6 +257,6 @@ echo "To start the openlitespeed server, run the command: systemctl start lsws" %{_lsws_dir}/modules/mod_lua.so %changelog -* Wed Sep 18 2024 Eduard Basov - 1.8.2 +* Wed Sep 18 2024 Eduard Basov - 1.8.2-1 - Rebuild for MSVSphere 9.4 -- 2.36.5 From 6a26ac731923ee6274ca4a03d8c4a44a7d49c693 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 7 Oct 2024 15:31:32 +0300 Subject: [PATCH 13/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 8857d95..5ce6e03 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -116,8 +116,7 @@ exit 0 %systemd_preun lsws %postun -userdel -r lsadm -groupdel lsadm +userdel lsadm rm -rf %{_lsws_dir} %systemd_postun lsws -- 2.36.5 From fc1bc250f3fba29b816c8fa45562ace182cfa803 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 7 Oct 2024 16:18:26 +0300 Subject: [PATCH 14/16] fix .patch --- SOURCES/fix-tarball-for-local-build.patch | 93 +++++++++++++---------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/SOURCES/fix-tarball-for-local-build.patch b/SOURCES/fix-tarball-for-local-build.patch index 56c97df..01a900a 100644 --- a/SOURCES/fix-tarball-for-local-build.patch +++ b/SOURCES/fix-tarball-for-local-build.patch @@ -19,7 +19,7 @@ index ee0f595..e2372e8 100755 echo "${MIN_VER}" > "${SHARED_API_MIN_VER_FILE}" } diff --git a/build.sh b/build.sh -index 949dda5..29f77be 100755 +index 949dda5..398f906 100755 --- a/build.sh +++ b/build.sh @@ -50,21 +50,21 @@ else @@ -87,38 +87,26 @@ index 949dda5..29f77be 100755 prepareLinux() { OSTYPE=unknownlinux -@@ -486,25 +465,13 @@ updateSrcCMakelistfile() - - cpModuleSoFiles() - { -- if [ ! -d dist/modules/ ] ; then -- mkdir dist/modules/ -- fi -- +@@ -490,14 +469,14 @@ cpModuleSoFiles() + mkdir dist/modules/ + fi + - for module in build/src/modules/*; do - cp -f ${module}/*.so dist/modules/ - done -- -- if [ -e build/src/modules/modsecurity-ls/mod_security.so ] ; then -- cp -f build/src/modules/modsecurity-ls/mod_security.so dist/modules/ -- fi -+ mkdir dist/modules/ -+ cp -f build/src/modules/modsecurity-ls/mod_security.so dist/modules/ - -- if [ -e build/src/modules/lua/mod_lua.so ] ; then -- cp -f build/src/modules/lua/mod_lua.so dist/modules/ -- fi -+ cp -f build/src/modules/lua/mod_lua.so dist/modules/ -+ -+ cp -f build/src/modules/pagespeed/modpagespeed.so dist/modules/ - -- if [ -e build/src/modules/pagespeed/modpagespeed.so ] ; then -- cp -f build/src/modules/pagespeed/modpagespeed.so dist/modules/ -- fi - } - - -@@ -514,9 +481,6 @@ fixshmdir() ++ #for module in build/src/modules/*; do ++ # cp -f ${module}/*.so dist/modules/ ++ #done + + if [ -e build/src/modules/modsecurity-ls/mod_security.so ] ; then + cp -f build/src/modules/modsecurity-ls/mod_security.so dist/modules/ + fi +- ++ + if [ -e build/src/modules/lua/mod_lua.so ] ; then + cp -f build/src/modules/lua/mod_lua.so dist/modules/ + fi +@@ -514,9 +493,6 @@ fixshmdir() mkdir /tmp/shm chmod 777 /tmp/shm sed -i -e "s/\/dev\/shm/\/tmp\/shm/g" dist/conf/httpd_config.conf.in @@ -128,7 +116,7 @@ index 949dda5..29f77be 100755 fi } -@@ -574,7 +538,7 @@ if [ "${OS}" = "FreeBSD" ] ; then +@@ -574,7 +550,7 @@ if [ "${OS}" = "FreeBSD" ] ; then prepareBsd elif [ "${OS}" = "Linux" ] ; then ISLINUX=yes @@ -137,7 +125,7 @@ index 949dda5..29f77be 100755 elif [ "${OS}" = "Darwin" ] ; then prepareMac fi -@@ -582,32 +546,26 @@ fi +@@ -582,32 +558,26 @@ fi cd .. @@ -184,7 +172,7 @@ index 949dda5..29f77be 100755 if [ "$MOD_PAGESPEED" = "ON" ]; then -@@ -625,7 +583,7 @@ fi +@@ -625,7 +595,7 @@ fi cd src/modules/lsrecaptcha export GOPATH=$CUR_PATH/src/modules/lsrecaptcha export GO111MODULE=off @@ -193,7 +181,7 @@ index 949dda5..29f77be 100755 cp lsrecaptcha ../../../dist/lsrecaptcha/_recaptcha cd ../../../ -@@ -660,9 +618,9 @@ jobs=$(nproc) +@@ -660,9 +630,9 @@ jobs=$(nproc) make -j${jobs} cd .. @@ -205,7 +193,7 @@ index 949dda5..29f77be 100755 fi cpModuleSoFiles -@@ -672,11 +630,11 @@ if [ -e src/liblsquic ] ; then +@@ -672,11 +642,11 @@ if [ -e src/liblsquic ] ; then freebsdFix fi @@ -219,7 +207,10 @@ index 949dda5..29f77be 100755 OPENLSWS_USER=nobody OPENLSWS_GROUP=nobody OPENLSWS_ADMIN=admin -@@ -700,7 +658,7 @@ mv dist/install.sh dist/_in.sh +@@ -697,10 +667,10 @@ END + echo Start to pack files. + mv dist/install.sh dist/_in.sh + -cat > ./install.sh < ./dist/install.sh </dev/null 2>&1 -@@ -796,7 +753,7 @@ fi +@@ -796,7 +765,7 @@ fi END @@ -255,8 +246,28 @@ index 949dda5..29f77be 100755 echo -e "\033[38;5;71mBuilding finished, please run ./install.sh for installation.\033[39m" echo -e "\033[38;5;71mYou may want to update the ols.conf to change the settings before installation.\033[39m" +diff --git a/dist/admin/misc/lscmctl b/dist/admin/misc/lscmctl +index ee0f595..e2372e8 100755 +--- a/dist/admin/misc/lscmctl ++++ b/dist/admin/misc/lscmctl +@@ -92,14 +92,7 @@ printHelp() + + updateMinAPIVerFile() + { +- MIN_VER=$(wget -q https://www.litespeed.sh/sub/shared/MIN_VER -O -) +- RET=$? +- +- if [ "${RET}" = "127" ] ; then +- errorExit "Required command 'wget' not found with exit code 127." +- elif [ "$RET" != "0" ] ; then +- errorExit "Failed to download latest MIN_VER file with wget exit status ${RET}." +- fi ++ MIN_VER=1.17.1.1 + + echo "${MIN_VER}" > "${SHARED_API_MIN_VER_FILE}" + } diff --git a/dist/functions.sh b/dist/functions.sh -index fb7a33c..52fb032 100755 +index fb7a33c..9ef9038 100755 --- a/dist/functions.sh +++ b/dist/functions.sh @@ -398,11 +398,11 @@ EOF @@ -402,7 +413,9 @@ index fb7a33c..52fb032 100755 else SDIR_OWN=$DIR_OWN LOGDIR_OWN=$DIR_OWN -@@ -993,10 +993,10 @@ installation() +@@ -991,12 +991,12 @@ installation() + util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates conf/vhosts conf/vhosts/Example admin/conf admin/tmp phpbuild + util_mkdir "$SDIR_OWN" $SDIR_MOD cgid admin/cgid admin/cgid/secret util_mkdir "$DIR_OWN" $SDIR_MOD tmp/ocspcache - chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/cgid + #chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/cgid -- 2.36.5 From c1465982da2e77c0a18571a4d16a80456a7ede6d Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 7 Oct 2024 16:19:24 +0300 Subject: [PATCH 15/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SOURCES/fix-tarball-for-local-?= =?UTF-8?q?build.patch'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SOURCES/fix-tarball-for-local-build.patch | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/SOURCES/fix-tarball-for-local-build.patch b/SOURCES/fix-tarball-for-local-build.patch index 01a900a..04bb987 100644 --- a/SOURCES/fix-tarball-for-local-build.patch +++ b/SOURCES/fix-tarball-for-local-build.patch @@ -1,23 +1,3 @@ -diff --git a/dist/admin/misc/lscmctl b/dist/admin/misc/lscmctl -index ee0f595..e2372e8 100755 ---- a/dist/admin/misc/lscmctl -+++ b/dist/admin/misc/lscmctl -@@ -92,14 +92,7 @@ printHelp() - - updateMinAPIVerFile() - { -- MIN_VER=$(wget -q https://www.litespeed.sh/sub/shared/MIN_VER -O -) -- RET=$? -- -- if [ "${RET}" = "127" ] ; then -- errorExit "Required command 'wget' not found with exit code 127." -- elif [ "$RET" != "0" ] ; then -- errorExit "Failed to download latest MIN_VER file with wget exit status ${RET}." -- fi -+ MIN_VER=1.17.1.1 - - echo "${MIN_VER}" > "${SHARED_API_MIN_VER_FILE}" - } diff --git a/build.sh b/build.sh index 949dda5..398f906 100755 --- a/build.sh -- 2.36.5 From 4d2f9fc0bb214eb0e4798618a65e8fea567dbf46 Mon Sep 17 00:00:00 2001 From: ebasov Date: Mon, 7 Oct 2024 16:24:53 +0300 Subject: [PATCH 16/16] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D0=BD=D0=B0=20'SPECS/openlitespeed.spec'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SPECS/openlitespeed.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 5ce6e03..a1cac0a 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -117,7 +117,6 @@ exit 0 %postun userdel lsadm -rm -rf %{_lsws_dir} %systemd_postun lsws %post -- 2.36.5