Skip to content

Commit cd38806

Browse files
committed
Build php-fpm with openssl.
1 parent e604882 commit cd38806

File tree

1 file changed

+64
-66
lines changed

1 file changed

+64
-66
lines changed

src/hst_autocompile.sh

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
2424
PHP='http://de2.php.net/distributions/php-'$PHP_V'.tar.gz'
2525

2626
# Set package dependencies for compiling
27-
SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip'
27+
SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
2828

2929
# Define a timestamp function
3030
timestamp() {
@@ -80,86 +80,86 @@ fi
8080
if [ "$NGINX_B" = true ] ; then
8181
# Change to build directory
8282
cd $BUILD_DIR
83-
83+
8484
# Check if target directory exist
8585
if [ -d $BUILD_DIR/hestia-nginx_$HESTIA_V ]; then
86-
#mv $BUILD_DIR/hestia-nginx_$HESTIA_V $BUILD_DIR/hestia-nginx_$HESTIA_V-$(timestamp)
87-
rm -r $BUILD_DIR/hestia-nginx_$HESTIA_V
86+
#mv $BUILD_DIR/hestia-nginx_$HESTIA_V $BUILD_DIR/hestia-nginx_$HESTIA_V-$(timestamp)
87+
rm -r $BUILD_DIR/hestia-nginx_$HESTIA_V
8888
fi
89-
89+
9090
# Create directory
9191
mkdir $BUILD_DIR/hestia-nginx_$HESTIA_V
92-
92+
9393
# Download and unpack source files
9494
wget -qO- $NGINX | tar xz
9595
wget -qO- $OPENSSL | tar xz
9696
wget -qO- $PCRE | tar xz
9797
wget -qO- $ZLIB | tar xz
98-
98+
9999
# Change to nginx directory
100100
cd nginx-$NGINX_V
101-
101+
102102
# configure nginx
103-
./configure --prefix=/usr/local/hestia/nginx \
104-
--with-http_ssl_module \
105-
--with-openssl=../openssl-$OPENSSL_V \
106-
--with-openssl-opt=enable-ec_nistp_64_gcc_128 \
107-
--with-openssl-opt=no-nextprotoneg \
108-
--with-openssl-opt=no-weak-ssl-ciphers \
109-
--with-openssl-opt=no-ssl3 \
110-
--with-pcre=../pcre-$PCRE_V \
111-
--with-pcre-jit \
112-
--with-zlib=../zlib-$ZLIB_V
113-
103+
./configure --prefix=/usr/local/hestia/nginx \
104+
--with-http_ssl_module \
105+
--with-openssl=../openssl-$OPENSSL_V \
106+
--with-openssl-opt=enable-ec_nistp_64_gcc_128 \
107+
--with-openssl-opt=no-nextprotoneg \
108+
--with-openssl-opt=no-weak-ssl-ciphers \
109+
--with-openssl-opt=no-ssl3 \
110+
--with-pcre=../pcre-$PCRE_V \
111+
--with-pcre-jit \
112+
--with-zlib=../zlib-$ZLIB_V
113+
114114
# Check install directory and move if exists
115115
if [ -d $INSTALL_DIR ]; then
116-
#mv $INSTALL_DIR $INSTALL_DIR$(timestamp)
117-
rm -r $INSTALL_DIR
116+
#mv $INSTALL_DIR $INSTALL_DIR$(timestamp)
117+
rm -r $INSTALL_DIR
118118
fi
119-
119+
120120
# Create the files and install them
121121
make && make install
122-
122+
123123
# Cleare up unused files
124124
cd $BUILD_DIR
125125
rm -r nginx-$NGINX_V openssl-$OPENSSL_V pcre-$PCRE_V zlib-$ZLIB_V
126-
126+
127127
# Prepare Deb Package Folder Structure
128128
cd hestia-nginx_$HESTIA_V/
129129
mkdir -p usr/local/hestia etc/init.d DEBIAN
130-
130+
131131
# Download control, postinst and postrm files
132132
cd DEBIAN
133133
wget $GIT_REP/nginx/control
134134
wget $GIT_REP/nginx/copyright
135135
wget $GIT_REP/nginx/postinst
136136
wget $GIT_REP/nginx/postrm
137-
137+
138138
# Set permission
139139
chmod +x postinst postrm
140-
140+
141141
# Move nginx directory
142142
cd ..
143143
mv /usr/local/hestia/nginx usr/local/hestia/
144-
144+
145145
# Get Service File
146146
cd etc/init.d
147147
wget $GIT_REP/nginx/hestia
148148
chmod +x hestia
149-
149+
150150
# Get nginx.conf
151151
cd ../../
152152
rm usr/local/hestia/nginx/conf/nginx.conf
153153
wget $GIT_REP/nginx/nginx.conf -O usr/local/hestia/nginx/conf/nginx.conf
154-
154+
155155
# copy binary
156156
cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
157-
157+
158158
# change permission and build the package
159159
cd $BUILD_DIR
160160
chown -R root:root hestia-nginx_$HESTIA_V
161161
dpkg-deb --build hestia-nginx_$HESTIA_V
162-
162+
163163
# clear up the source folder
164164
rm -r hestia-nginx_$HESTIA_V
165165
fi
@@ -173,70 +173,68 @@ fi
173173
if [ "$PHP_B" = true ] ; then
174174
# Change to build directory
175175
cd $BUILD_DIR
176-
176+
177177
# Check if target directory exist
178178
if [ -d $BUILD_DIR/hestia-php_$HESTIA_V ]; then
179-
#mv $BUILD_DIR/hestia-php_$HESTIA_V $BUILD_DIR/hestia-php_$HESTIA_V-$(timestamp)
180-
rm -r $BUILD_DIR/hestia-php_$HESTIA_V
179+
#mv $BUILD_DIR/hestia-php_$HESTIA_V $BUILD_DIR/hestia-php_$HESTIA_V-$(timestamp)
180+
rm -r $BUILD_DIR/hestia-php_$HESTIA_V
181181
fi
182-
182+
183183
# Create directory
184184
mkdir $BUILD_DIR/hestia-php_$HESTIA_V
185-
185+
186186
# Download and unpack source files
187187
wget -qO- $PHP | tar xz
188-
wget -qO- $OPENSSL | tar xz
189-
188+
190189
# Change to php directory
191190
cd php-$PHP_V
192-
191+
193192
# Configure PHP
194-
./configure --prefix=/usr/local/hestia/php \
193+
./configure --prefix=/usr/local/hestia/php \
195194
--enable-fpm \
196195
--with-zlib \
197196
--with-fpm-user=admin \
198197
--with-fpm-group=admin \
199-
--with-openssl=../openssl-$OPENSSL_V \
200-
--with-mysql \
198+
--with-openssl \
199+
--with-libdir=lib/x86_64-linux-gnu \
201200
--with-mysqli \
202201
--with-curl \
203202
--enable-mbstring
204-
203+
205204
# Create the files and install them
206205
make && make install
207-
206+
208207
# Cleare up unused files
209208
cd $BUILD_DIR
210209
rm -r php-$PHP_V
211-
rm -r openssl-$OPENSSL_V
212-
210+
213211
# Prepare Deb Package Folder Structure
214212
cd hestia-php_$HESTIA_V/
215213
mkdir -p usr/local/hestia DEBIAN
216-
214+
217215
# Download control, postinst and postrm files
218216
cd DEBIAN
219217
wget $GIT_REP/php/control
220218
wget $GIT_REP/php/copyright
221-
219+
222220
# Move php directory
223221
cd ..
224222
mv /usr/local/hestia/php usr/local/hestia/
225-
223+
226224
# Get php-fpm.conf
227225
wget $GIT_REP/php/php-fpm.conf -O usr/local/hestia/php/etc/php-fpm.conf
228226

229227
# Get php.ini
230-
wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
228+
wget $GIT_REP/php/php.ini -O usr/local/hestia/php/lib/php.ini
231229

232230
# copy binary
233231
cp usr/local/hestia/php/sbin/php-fpm usr/local/hestia/php/sbin/hestia-php
234-
232+
235233
# change permission and build the package
236234
cd $BUILD_DIR
237235
chown -R root:root hestia-php_$HESTIA_V
238236
dpkg-deb --build hestia-php_$HESTIA_V
239-
237+
240238
# clear up the source folder
241239
rm -r hestia-php_$HESTIA_V
242240
fi
@@ -250,48 +248,48 @@ fi
250248
if [ "$HESTIA_B" = true ] ; then
251249
# Change to build directory
252250
cd $BUILD_DIR
253-
251+
254252
# Check if target directory exist
255253
if [ -d $BUILD_DIR/hestia_$HESTIA_V ]; then
256-
#mv $BUILD_DIR/hestia_$HESTIA_V $BUILD_DIR/hestia_$HESTIA_V-$(timestamp)
257-
rm -r $BUILD_DIR/hestia_$HESTIA_V
254+
#mv $BUILD_DIR/hestia_$HESTIA_V $BUILD_DIR/hestia_$HESTIA_V-$(timestamp)
255+
rm -r $BUILD_DIR/hestia_$HESTIA_V
258256
fi
259-
257+
260258
# Create directory
261259
mkdir $BUILD_DIR/hestia_$HESTIA_V
262-
260+
263261
# Download and unpack source files
264262
wget $HESTIA
265263
unzip -q master.zip
266264
rm master.zip
267-
265+
268266
# Prepare Deb Package Folder Structure
269267
cd hestia_$HESTIA_V/
270268
mkdir -p usr/local/hestia DEBIAN
271-
269+
272270
# Download control, postinst and postrm files
273271
cd DEBIAN
274272
wget $GIT_REP/hestia/control
275273
wget $GIT_REP/hestia/copyright
276274
wget $GIT_REP/hestia/postinst
277-
275+
278276
# Set permission
279277
chmod +x postinst
280-
278+
281279
# Move needed directories
282280
cd ../../hestiacp-master
283281
mv bin func install upd web ../hestia_$HESTIA_V/usr/local/hestia/
284-
282+
285283
# Set permission
286284
cd ../hestia_$HESTIA_V/usr/local/hestia/bin
287285
chmod +x *
288-
286+
289287
# change permission and build the package
290288
cd $BUILD_DIR
291289
chown -R root:root hestia_$HESTIA_V
292290
dpkg-deb --build hestia_$HESTIA_V
293-
291+
294292
# clear up the source folder
295293
rm -r hestia_$HESTIA_V
296294
rm -r hestiacp-master
297-
fi
295+
fi

0 commit comments

Comments
 (0)