[ QApache 2.4.39 + PHP 7.2.29 ] WebServer with PHP and PECL

This is the best place for community developers to publish their genius work. Your Apps enrich the QNAP Turbo NAS.
Post Reply
raidforsaving
Easy as a breeze
Posts: 279
Joined: Mon Jul 14, 2014 9:14 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by raidforsaving »

QNAP_Stephane wrote: HTTP = port 88
HTTPS = port 448
I think the choice of these ports is poor. 88 is well known for kerberos, and the other is also with the reserved port range (1-1024).

Do they need to run in this port range (1-1024)? I think this is a root user process concern.

If not, I would suggest using some other ports above 1024. Not critical, but just a good idea.

At the very least I'd like to change them myself. Where is the config for this app stored?
Model name: TS-653D
Firmware version: 4.5.3.1697 build 20210611
Volumes: EXT4, Encrypted volume
Previous: TS-651 dead by CPU bug
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by QNAP_Stephane »

Inside the httpd.conf in /opt/Qapache/etc or you can do it also within my selfmade webui management
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
DJCMBear
Starting out
Posts: 26
Joined: Mon Apr 14, 2014 3:42 pm

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by DJCMBear »

I have been doing some more looking into the nghttp2 situation and found you have already packaged up the libnghttp2.so file with Qapache (thanks for that lol), I also some how managed to compile my own version of the .so file (not sure how but it compiled), both the Qapache version and my own for some reason return a segmentation fault, so not sure what is going on but it looks like they are not working.

Curl both via the terminal and via PHP work with HTTP/2 but for what ever reason apache doesn't seem to be playing ball with the nghttp2 library, maybe if a future release of Qapache it will end up working but for now I can't seem to locate where the issue is or how to resolve it, overall Qapache is amazing and handles my web server much better than QNAP's own apache service so thanks for your work :)

Lastly, where would I find the apache access and error logs via the terminal, your web UI was perfect however since setting up the apache config to use my public_html folder as the server root I am unable to access that.

EDIT: just a little information with how to package apache with http2 options, the guys second post was that he also like me needed to install the nghttp2 package... https://www.apachelounge.com/viewtopic.php?p=32833
Server: TVS-871-i7-16G 32TB RAID-6 QTS 4.3.3 2017/07/27
Network: ASUS RT-AC5300 5334Mbps internal network with AC wireless (Twin 5Ghz and a 2.4Ghz both with a range of 5,000 square feet), CAT7 ethernet cables with true gigabit ports, 300Mb/s super fast vivid fibre optic with unlimited bandwidth.
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by QNAP_Stephane »

you experience segmentation fault because you need compiling with right toolchain (according to the right libc version of the NAS should be < or = )

for nghttp2 i have no idea how configure this within the httpd.conf

the logs are in /opt/Qapache/var/logs basically, but you can modify this behavior inside the httpd.conf

i may be miss a flag during compilation, i will check on next version 2.4.24+
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
DJCMBear
Starting out
Posts: 26
Joined: Mon Apr 14, 2014 3:42 pm

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by DJCMBear »

QNAP_Stephane wrote:you experience segmentation fault because you need compiling with right toolchain (according to the right libc version of the NAS should be < or = )
Have to be honest I am lost with compiling packages so all I know is I have a TVS-871 (currently using the legacy storage and not the new storage pools, not sure if that makes any difference).
I did have a look at my server info and it came back with this.

Code: Select all

Linux version 3.12.6 (root@NasX86-13) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Thu Sep 1 01:05:45 CST 2016
QNAP_Stephane wrote:for nghttp2 i have no idea how configure this within the httpd.conf
This is pretty simple all you need for a basic setup is to load the module mod_http2.

If you want to you could also add this at the bottom of the main .conf file, or you could leave this out of the default config and just let the developer add it in, as long as the mod_http2 module works that is all you need.

Code: Select all

Protocols h2 h2c http/1.1
h2 is https over http/2, h2c is http over http/2 and http/1.1 is the latest http/1 protocol version.
QNAP_Stephane wrote:i may be miss a flag during compilation, i will check on next version 2.4.24+
You do need to add a flag to enable apache to use http2, I think once you compile apache with libnghttp2 it should allow it to use the mod_http2 module, it was compile in with curl which is why in phpinfo under curl is shows http2 as yes, I hope you find a way to get it working, not just for me but for everyone who uses your apache app so they can also use it, I also found that you were using nghttp2 version 1.9.2 however the current version is 1.16.0, maybe that has something to do with the issue as well but it could also be they fact it is producing a seg fault on my system.
Server: TVS-871-i7-16G 32TB RAID-6 QTS 4.3.3 2017/07/27
Network: ASUS RT-AC5300 5334Mbps internal network with AC wireless (Twin 5Ghz and a 2.4Ghz both with a range of 5,000 square feet), CAT7 ethernet cables with true gigabit ports, 300Mb/s super fast vivid fibre optic with unlimited bandwidth.
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by QNAP_Stephane »

did you try in httpd.conf something like

Code: Select all

LoadModule http2_module libexec/mod_http2.so
doesnt seems to be loaded within httpd.conf, but well compiled in lbexec

see also some stuff in https://www.tunetheweb.com/performance/http2/ to try to understand how it works
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
DJCMBear
Starting out
Posts: 26
Joined: Mon Apr 14, 2014 3:42 pm

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by DJCMBear »

QNAP_Stephane wrote:did you try in httpd.conf something like

Code: Select all

LoadModule http2_module libexec/mod_http2.so
doesnt seems to be loaded within httpd.conf, but well compiled in lbexec

see also some stuff in https://www.tunetheweb.com/performance/http2/ to try to understand how it works
I have loaded that extra module as I found it wasn't included and also added the protocols but that never worked, I did everything up to the apache segment as I didn't know how to replace yours or if I should even do that. but in that example the developer used the --enable-http2 flag when compiling apache, so everything in your Qapache might be 100% working it may just not be enabled via that flag.

EDIT: Just ran a test and it looks like mod_http2 is fully being loaded including the nghttp2 library, so my guess is as you said you may not have added that http2 flag when compiling, below is the output of the error_log, I would also suggest upgrading openssl and nghttp2 to their latest versions for version 2.4.24.

Code: Select all

[Sun Oct 30 16:12:44.549316 2016] [mpm_event:notice] [pid 2501:tid 4145240656] AH00494: SIGHUP received.  Attempting to restart
[Sun Oct 30 16:12:44.719952 2016] [auth_digest:notice] [pid 2501:tid 4145240656] AH01757: generating secret for digest authentication ...
[Sun Oct 30 16:12:44.758743 2016] [http2:info] [pid 2501:tid 4145240656] AH03090: mod_http2 (v1.5.11, feats=CHPRIO+SHA256, nghttp2 1.9.2), initializing...
[Sun Oct 30 16:12:44.760643 2016] [mpm_event:notice] [pid 2501:tid 4145240656] AH00489: Apache/2.4.23 (Unix) OpenSSL/1.0.2h SVN/1.9.3 configured -- resuming normal operations
[Sun Oct 30 16:12:44.760656 2016] [core:notice] [pid 2501:tid 4145240656] AH00094: Command line: '/share/MD0_DATA/.qpkg/Qapache/bin/httpd -f /share/MD0_DATA/.qpkg/Qapache/etc/httpd.conf'
Server: TVS-871-i7-16G 32TB RAID-6 QTS 4.3.3 2017/07/27
Network: ASUS RT-AC5300 5334Mbps internal network with AC wireless (Twin 5Ghz and a 2.4Ghz both with a range of 5,000 square feet), CAT7 ethernet cables with true gigabit ports, 300Mb/s super fast vivid fibre optic with unlimited bandwidth.
raidforsaving
Easy as a breeze
Posts: 279
Joined: Mon Jul 14, 2014 9:14 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by raidforsaving »

I'm no web admin. But I don't seem to have the SSL version of Qapache running. And when I try to set it up I get this error. Any ideas on what the correct fix is?

[Sun Oct 30 17:16:42.565571 2016] [so:warn] [pid 18196:tid 4145752656] AH01574: module php7_module is already loaded, skipping
AH00526: Syntax error on line 92 of /opt/Qapache/etc/extra/httpd-ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).


UPDATE:

Ok, so I made a few changes to get SSL on port 448 working.


httpd.conf

Code: Select all

LoadModule socache_shmcb_module libexec/mod_socache_shmcb.so
httpd-ssl.conf

Code: Select all

DocumentRoot "/share/htdocs"
ServerName ${HOSTNAME}:448
Model name: TS-653D
Firmware version: 4.5.3.1697 build 20210611
Volumes: EXT4, Encrypted volume
Previous: TS-651 dead by CPU bug
raidforsaving
Easy as a breeze
Posts: 279
Joined: Mon Jul 14, 2014 9:14 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by raidforsaving »

I'm a bit concerned regarding the pairing of Apache with PHP in this qpkg. Is this "required" due to the complexities of how integrated the two need to be, or is it simply a preference?

Because from a update perspective, it seems clear that Apache and PHP are not on the same release schedule and there are already vulnerabilities in PHP that must be patched. Holding off on a qpkg update until Apache does another update seems like a huge risk.

Can someone please explain the "need vs want" of merging these two apps in a qpkg? I think I would much rather them be separate if there is no reason for them to be merged. Curious what others that have more experience with Apache/php have to say.

TIA!
Model name: TS-653D
Firmware version: 4.5.3.1697 build 20210611
Volumes: EXT4, Encrypted volume
Previous: TS-651 dead by CPU bug
ddkirk
Know my way around
Posts: 141
Joined: Thu Aug 28, 2008 8:20 am
Location: Southern California

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by ddkirk »

Well, QNAP support directed me here after I updated the system firmware because I have an app, ActiveCollab, which requires PHP 5.6, and apparently my TS-453Pro is running PHP 5.5.38.

From the original post, which file is best to install?
TS-453 Pro
Firmware 4.2.1
zwarteraaf
Starting out
Posts: 12
Joined: Mon Aug 05, 2013 5:03 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by zwarteraaf »

I installed this qpkg and apache is working. Could even get my spotweb working again after some changes.

Only I have one error :
Failed loading /opt/Qapache/lib/extensions/no-debug-zts-20151012/xdebug.so: /opt/Qapache/lib/extensions/no-debug-zts-20151012/xdebug.so: cannot open shared object file: No such file or directory

Can someone help me how to fix that error. opkg is working but xdebug is not available.

I have entware-ng 0.97 installed and Git 2.10.
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by QNAP_Stephane »

this application will be update soon with php 7.1 and Apache 2.4.25 for xdebug just put a # in front of the line in extension part inside your php.ini

dont think it is this altering your behavior with spotweb
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
raidforsaving
Easy as a breeze
Posts: 279
Joined: Mon Jul 14, 2014 9:14 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by raidforsaving »

that will stop the error for them, but it is unclear if they need it working.
Model name: TS-653D
Firmware version: 4.5.3.1697 build 20210611
Volumes: EXT4, Encrypted volume
Previous: TS-651 dead by CPU bug
User avatar
QNAP_Stephane
Experience counts
Posts: 4802
Joined: Wed Mar 27, 2013 1:00 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by QNAP_Stephane »

can you check if file exist ?

/opt/Qapache/lib/extensions/no-debug-zts-20151012/xdebug.so

it is well include in my qpkg source..
---------------------------------------------------------------------------------------------------------------------------

Find all QPKG in the MyQnap.org repository https://www.myqnap.org
join our discord server for any inquiry related to qpkg - https://discord.gg/4fPxHSWKQW

----------------------------------------------------------------------------------------------------------------------------
zwarteraaf
Starting out
Posts: 12
Joined: Mon Aug 05, 2013 5:03 am

Re: [ QApache 2.4.23 + PHP 7.0.9 ] WebServer and more

Post by zwarteraaf »

I checked if the file exist but it is not. For now i will place a # in front of the extension part inside php.ini.

No I don't need it for Spotweb but just wanted to fix the problem.
Post Reply

Return to “Community Apps”