1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
|
--- openlitespeed-1.4.24/src/util/gsendfile.h.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/util/gsendfile.h 2017-02-11 15:37:19.976655229 +0000
@@ -83,7 +83,7 @@
#endif
#if defined(linux) || defined(__linux) || defined(__linux__) || \
- defined(__gnu_linux__)
+ defined(__gnu_linux__) || defined(__midipix__)
#include <sys/sendfile.h>
#define gsendfile ::sendfile
#endif
--- openlitespeed-1.4.24/src/util/pcutil.h.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/util/pcutil.h 2017-02-11 15:39:02.736901419 +0000
@@ -18,7 +18,7 @@
#ifndef PCUTIL_H
#define PCUTIL_H
-#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) || defined(__midipix__)
#include <sched.h>
# define SET_AFFINITY(pid, size, mask) sched_setaffinity(0, size, mask)
# define GET_AFFINITY(pid, size, mask) sched_getaffinity(0, size, mask)
--- openlitespeed-1.4.24/src/main/lshttpdmain.cpp.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/main/lshttpdmain.cpp 2017-02-11 15:50:52.882605886 +0000
@@ -45,7 +45,9 @@
#include <util/stringlist.h>
#include <util/signalutil.h>
#include <util/vmembuf.h>
+#ifndef __midipix__
#include <sys/sysctl.h>
+#endif
#include <extensions/cgi/cgidworker.h>
#include <extensions/registry/extappregistry.h>
@@ -1428,7 +1430,7 @@
#ifdef LSWS_NO_SET_AFFINITY
return 2;
#else
-#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) || defined(__midipix__)
return sysconf(_SC_NPROCESSORS_ONLN);
#else
int nm[2];
--- openlitespeed-1.4.24/configure.orig 2016-12-02 19:52:25.745807731 +0000
+++ openlitespeed-1.4.24/configure 2017-02-11 21:11:39.234979798 +0000
@@ -11292,7 +11292,7 @@
;;
# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | midipix)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
@@ -15863,16 +15863,8 @@
if test "$OPENLSWS_BSSL" = no ; then
- if test "$OSNAME" = Darwin ; then
- usedynossl=yes
- CPPFLAGS="$CPPFLAGS -I../../src -I../../include -I/usr/local/include -I/usr/local -I/usr -I/usr/pkg "
- else
- usedynossl=no
- CPPFLAGS="$CPPFLAGS -I../../ssl/include -I../../src -I../../include -I/usr/local/include -I/usr/local -I/usr -I/usr/pkg "
- echo "Will build latest stable openssl libraries for you, this may take several minutes ..."
- OSSL=`. $srcdir/dlossl.sh`
- echo "Finsihed building openssl."
- fi
+ usedynossl=yes
+ CPPFLAGS="$CPPFLAGS -I../../src -I../../include "
echo "Openssl: use_dyn_ossl = $usedynossl"
else
#### Not provide location, use default location, will not copy files
@@ -15982,12 +15974,6 @@
fi
-ZLIB_HOME=/usr/local
-if test ! -f "${ZLIB_HOME}/include/zlib.h"
-then
- ZLIB_HOME=/usr
-fi
-
#
# Locate zlib, if wanted
#
@@ -16131,7 +16117,6 @@
-if test "$OSNAME" = Darwin ; then
# Check whether --with-openssl was given.
@@ -16259,8 +16244,6 @@
-fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lib pcre" >&5
$as_echo_n "checking lib pcre... " >&6; }
PCRE_LDFLAGS=
--- openlitespeed-1.4.24/src/util/pcutil.cpp.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/util/pcutil.cpp 2017-02-12 20:09:45.817635783 +0000
@@ -21,6 +21,8 @@
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
+#include <pthread.h>
#ifdef __linux
#include <sched.h>
@@ -72,7 +74,7 @@
if (s_nCpu > 0)
return s_nCpu;
-#if defined(linux) || defined(__linux) || defined(__linux__)
+#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__midipix__)
s_nCpu = sysconf(_SC_NPROCESSORS_ONLN);
#else
int mib[2];
@@ -116,7 +118,7 @@
#ifdef __FreeBSD__
return cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
sizeof(cpu_set_t), mask);
-#elif defined(linux) || defined(__linux) || defined(__linux__)
+#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__midipix__)
return pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), mask);
//return sched_setaffinity(0, sizeof(cpu_set_t), mask);
#endif
--- openlitespeed-1.4.24/src/util/sysinfo/partitioninfo.cpp.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/util/sysinfo/partitioninfo.cpp 2017-02-12 20:11:21.637846476 +0000
@@ -17,6 +17,9 @@
*****************************************************************************/
#include "partitioninfo.h"
#include <lsdef.h>
+#ifdef __midipix__
+#include <sys/statfs.h>
+#endif
PartitionInfo::PartitionInfo()
{
@@ -33,7 +36,7 @@
int PartitionInfo::getPartitionInfo(const char *path, uint64_t *outTotal,
uint64_t *outFree)
{
-#if defined(__linux) || defined(sun)
+#if defined(__linux) || defined(sun) || defined(__midipix__)
struct statvfs st;
if (statvfs(path, &st) != 0)
{
--- openlitespeed-1.4.24/src/util/sysinfo/siocglif_nicdetect.cpp.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/src/util/sysinfo/siocglif_nicdetect.cpp 2017-02-12 20:14:43.894291205 +0000
@@ -18,6 +18,9 @@
struct ifi_info *
NICDetect::get_ifi_info(int family, int doaliases)
{
+#ifdef __midipix__
+ return NULL;
+#else
struct ifi_info *ifi, *ifihead, **ifipnext;
int sockfd, len, lastlen, flags, myflags;
char *buf, lastname[IFNAMSIZ], *cptr;
@@ -163,5 +166,6 @@
close(sockfd);
free(buf);
return (ifihead); /* pointer to first structure in linked list */
+#endif
}
--- openlitespeed-1.4.24/src/modules/Makefile.in.orig 2016-12-02 19:52:23.711814564 +0000
+++ openlitespeed-1.4.24/src/modules/Makefile.in 2017-02-12 20:16:36.002537713 +0000
@@ -185,7 +185,7 @@
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-DIST_SUBDIRS = cache uploadprogress modinspector lua
+DIST_SUBDIRS = lua
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
@@ -361,8 +361,8 @@
AM_CPPFLAGS = -I$(top_srcdir)/openssl/include/ -I$(top_srcdir)/include -I$(top_srcdir)/src
libmodules_a_METASOURCES = AUTO
libmodules_a_SOURCES = modgzip/modgzip.cpp
-@HAVE_LIBLUA_FALSE@SUBDIRS = cache uploadprogress modinspector
-@HAVE_LIBLUA_TRUE@SUBDIRS = cache uploadprogress lua modinspector
+@HAVE_LIBLUA_FALSE@SUBDIRS =
+@HAVE_LIBLUA_TRUE@SUBDIRS = lua
all: all-recursive
.SUFFIXES:
--- openlitespeed-1.4.24/dist/install.sh.orig 2016-12-02 19:51:11.000000000 +0000
+++ openlitespeed-1.4.24/dist/install.sh 2017-02-12 20:39:56.309734680 +0000
@@ -1,84 +1,5 @@
#!/bin/sh
-inst_admin_php()
-{
- # detect download method
- OS=`uname -s`
- OSTYPE=`uname -m`
-
- DLCMD="wget -nv -O"
- if [ "x$OS" = "xFreeBSD" ] ; then
- DL=`which fetch`
- DLCMD="$DL -o"
- fi
- if [ "x$DLCMD" = "x" ] ; then
- DL=`which wget`
- DLCMD="$DL -nv -O"
- fi
- if [ "x$DLCMD" = "x" ] ; then
- DL=`which curl`
- DLCMD="$DL -L -o"
- fi
-
- echo "DLCMD is $DLCMD"
- echo
-
- HASADMINPHP=n
- if [ -f "$LSWS_HOME/admin/fcgi-bin/admin_php" ] ; then
- mv "$LSWS_HOME/admin/fcgi-bin/admin_php" "$LSWS_HOME/admin/fcgi-bin/admin_php.bak"
- echo "admin_php found and mv to admin_php.bak"
- fi
-
- if [ ! -d "$LSWS_HOME/admin/fcgi-bin/" ] ; then
- mkdir -p "$LSWS_HOME/admin/fcgi-bin/"
- echo "Mkdir $LSWS_HOME/admin/fcgi-bin/ for installing admni_php"
- fi
-
- if [ "x$OS" = "xLinux" ] ; then
- if [ "x$OSTYPE" != "xx86_64" ] ; then
- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/i386/lsphp5
- else
- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/x86_64/lsphp5
- fi
-
- if [ $? = 0 ] ; then
- HASADMINPHP=y
- echo "admin_php downloaded."
- fi
-
-# if [ -f "$LSWS_HOME/admin/fcgi-bin/admin_php" ] ; then
-# HASADMINPHP=y
-# fi
-
- elif [ "x$OS" = "xFreeBSD" ] ; then
- if [ "x$OSTYPE" != "xamd64" ] ; then
- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/i386-freebsd/lsphp5
- else
- $DLCMD $LSWS_HOME/admin/fcgi-bin/admin_php http://www.litespeedtech.com/packages/lsphp5_bin/x86_64-freebsd/lsphp5
- fi
-
- if [ $? = 0 ] ; then
- HASADMINPHP=y
- echo "admin_php downloaded."
- fi
- fi
-
- if [ "x$HASADMINPHP" = "xn" ] ; then
- echo -e "\033[38;5;148mStart to build php, this may take several minutes, please waiting ...\033[39m"
- $LSWS_HOME/admin/misc/build_admin_php.sh
- else
- chmod "$EXEC_MOD" "$LSWS_HOME/admin/fcgi-bin/admin_php"
- fi
-
- #final checking of existence of admin_php
- if [ ! -f "$LSWS_HOME/admin/fcgi-bin/admin_php" ] ; then
- echo -e "\033[38;5;148mFinal checking found admin_php not exists, installation abort.\033[39m"
- exit 1
- fi
-}
-
-
-
#script start here
cd `dirname "$0"`
source ./functions.sh 2>/dev/null
@@ -169,7 +90,6 @@
echo
echo -e "\033[38;5;148m$LSWS_HOME/conf/httpd_config.xml exists, will be converted to $LSWS_HOME/conf/httpd_config.conf!\033[39m"
- inst_admin_php
PHP_INSTALLED=y
if [ -e "$LSWS_HOME/conf/httpd_config.conf" ] ; then
@@ -238,9 +158,6 @@
buildConfigFiles
installation
-if [ "x$PHP_INSTALLED" = "xn" ] ; then
- inst_admin_php
-fi
rm $LSWS_HOME/bin/lshttpd
ln -sf ./openlitespeed $LSWS_HOME/bin/lshttpd
|