Mailing List Archive

1 2  View All
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
This thread is getting very tiresome. So, let's summarize:

- You want to request /, serve index.html
- For all other requests, proxy internally

As such, keep the ProxyPass /index.html ! for clarity and change your
existing ProxyPass directive to:

ProxyPassMatch ^/(.+) http://localhost:3000/

In short, this means that requesting / will not match, and requesting /foo
will proxy.

On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

>
>
>
>
> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>>
>>
>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>>> wrote:
>>>
>>>> Hi Frank,
>>>>
>>>> Thanks for the email response and much appreciated. I added the
>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>
>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>> <VirtualHost *:80>
>>>> ServerName phpnodejs.mydomain.com
>>>> Redirect / https://phpnodejs.mydomain.com/
>>>> </VirtualHost>
>>>> <VirtualHost *:443>
>>>> DocumentRoot /var/www/html/htmlcode
>>>> ServerName phpnodejs.mydomain.com
>>>> Header add Access-Control-Allow-Origin "*"
>>>> SSLEngine on
>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/cert.pem
>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/privkey.pem
>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/chain.pem
>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>> includeSubDomains"
>>>> ProxyPass /index.html !
>>>> ProxyPass / http://localhost:3000/
>>>> </VirtualHost>
>>>>
>>>> # apachectl configtest
>>>> Syntax OK
>>>> #apachectl -S
>>>> VirtualHost configuration:
>>>> *:80 phpnodejs.mydomain.com
>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>> *:443 phpnodejs.mydomain.com
>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>> ServerRoot: "/etc/httpd"
>>>> Main DocumentRoot: "/var/www/html"
>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>> Mutex mpm-accept: using_defaults
>>>> Mutex cache-socache: using_defaults
>>>> Mutex authdigest-opaque: using_defaults
>>>> Mutex watchdog-callback: using_defaults
>>>> Mutex proxy-balancer-shm: using_defaults
>>>> Mutex rewrite-map: using_defaults
>>>> Mutex ssl-stapling-refresh: using_defaults
>>>> Mutex authdigest-client: using_defaults
>>>> Mutex lua-ivm-shm: using_defaults
>>>> Mutex ssl-stapling: using_defaults
>>>> Mutex proxy: using_defaults
>>>> Mutex authn-socache: using_defaults
>>>> Mutex ssl-cache: using_defaults
>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>> PidFile: "/run/httpd/httpd.pid"
>>>> Define: DUMP_VHOSTS
>>>> Define: DUMP_RUN_CFG
>>>> User: name="apache" id=48
>>>> Group: name="apache" id=48
>>>> #
>>>>
>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>> the browser which is expected behaviour.
>>>>
>>>> [image: image.png]
>>>>
>>>> I am still unable to render the index.html file from the document root
>>>> in /var/www/html/htmlcode which I created a new folder for testing
>>>> purposes.
>>>>
>>>> Please suggest and guide me. Thanks in advance.
>>>>
>>>> Best Regards,
>>>>
>>>> Kaushal
>>>>
>>>
>>> Hi,
>>>
>>> I have referred to https://httpd.apache.org/docs/2.4/mod/mod_dir.html
>>> by adding DirectoryIndex index.html directive in 443 virtualhost. The issue
>>> still persists.
>>>
>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>> <VirtualHost *:80>
>>> ServerName phpnodejs.mydomain.com
>>> Redirect / https://phpnodejs.mydomain.com/
>>> </VirtualHost>
>>> <VirtualHost *:443>
>>> DocumentRoot /var/www/html/htmlcode
>>> DirectoryIndex index.html
>>> ServerName phpnodejs.mydomain.com
>>> Header add Access-Control-Allow-Origin "*"
>>> SSLEngine on
>>> SSLCertificateFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/cert.pem
>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/privkey.pem
>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/chain.pem
>>> Header always set Strict-Transport-Security "max-age=63072000;
>>> includeSubDomains"
>>> ProxyPass /index.html !
>>> ProxyPass / http://localhost:3000/
>>> </VirtualHost>
>>>
>>> Please suggest further and guide me. Thanks in advance.
>>>
>>> Best Regards,
>>>
>>> Kaushal
>>>
>>
>>
>> Further to the earlier email, I am sharing the log files.
>>
>> #cd /var/log/httpd/
>> #pwd
>> /var/log/httpd
>> # cat access_log
>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200 11 "-"
>> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>> Firefox/114.0"
>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET /nodejssl/server.js
>> HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15;
>> rv:109.0) Gecko/20100101 Firefox/114.0"
>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200 11 "-"
>> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>> Firefox/114.0"
>> # cat error_log
>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid 31795]
>> AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>> determines how things are processed in your server. HTTP/2 has more demands
>> in this regard and the currently selected mpm will just not do. This is an
>> advisory warning. Your server will continue to work, but the HTTP/2
>> protocol will be inactive.
>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid 31795:tid
>> 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips configured --
>> resuming normal operations
>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid 31795]
>> AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>> #
>>
>> Best Regards,
>>
>> Kaushal
>>
>
> Hi,
>
> I have enabled debug logging by adding LogLevel debug in 443 virtualhost.
>
> #cat /etc/httpd/conf.d/phpnodejs.conf
> <VirtualHost *:80>
> ServerName phpnodejs.mydomain.com
> Redirect / https://phpnodejs.mydomain.com/
> </VirtualHost>
> <VirtualHost *:443>
> DocumentRoot /var/www/html/htmlcode
> DirectoryIndex index.html
> ServerName phpnodejs.mydomain.com
> Header add Access-Control-Allow-Origin "*"
> LogLevel debug
> SSLEngine on
> SSLCertificateFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/privkey.pem
> SSLCertificateChainFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/chain.pem
> Header always set Strict-Transport-Security "max-age=63072000;
> includeSubDomains"
> ProxyPass /index.html !
> ProxyPass / http://localhost:3000/
> </VirtualHost>
>
> debug apache error log file -> http://sprunge.us/kndkvL
>
> Please suggest further and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Hi Frank,

Thanks a lot. It worked perfectly. I have a follow up question for /demo
path (as part of node.js code so /demo has all nodejs code) just as an
improvement . I modified the ProxyPassMatch directive as per the below
example and it returned http 404.

ProxyPassMatch ^/demo(.+) http://localhost:3000/

Am I missing anything? Apologies for bugging you.

Please guide me. Thanks in advance.

Best Regards,

Kaushal


On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org> wrote:

> This thread is getting very tiresome. So, let's summarize:
>
> - You want to request /, serve index.html
> - For all other requests, proxy internally
>
> As such, keep the ProxyPass /index.html ! for clarity and change your
> existing ProxyPass directive to:
>
> ProxyPassMatch ^/(.+) http://localhost:3000/
>
> In short, this means that requesting / will not match, and requesting /foo
> will proxy.
>
> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>>
>>
>>
>>
>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>> kaushalshriyan@gmail.com> wrote:
>>>>
>>>>> Hi Frank,
>>>>>
>>>>> Thanks for the email response and much appreciated. I added the
>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>
>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>> <VirtualHost *:80>
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>> </VirtualHost>
>>>>> <VirtualHost *:443>
>>>>> DocumentRoot /var/www/html/htmlcode
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Header add Access-Control-Allow-Origin "*"
>>>>> SSLEngine on
>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/cert.pem
>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/chain.pem
>>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>>> includeSubDomains"
>>>>> ProxyPass /index.html !
>>>>> ProxyPass / http://localhost:3000/
>>>>> </VirtualHost>
>>>>>
>>>>> # apachectl configtest
>>>>> Syntax OK
>>>>> #apachectl -S
>>>>> VirtualHost configuration:
>>>>> *:80 phpnodejs.mydomain.com
>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>> *:443 phpnodejs.mydomain.com
>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>> ServerRoot: "/etc/httpd"
>>>>> Main DocumentRoot: "/var/www/html"
>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>> Mutex mpm-accept: using_defaults
>>>>> Mutex cache-socache: using_defaults
>>>>> Mutex authdigest-opaque: using_defaults
>>>>> Mutex watchdog-callback: using_defaults
>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>> Mutex rewrite-map: using_defaults
>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>> Mutex authdigest-client: using_defaults
>>>>> Mutex lua-ivm-shm: using_defaults
>>>>> Mutex ssl-stapling: using_defaults
>>>>> Mutex proxy: using_defaults
>>>>> Mutex authn-socache: using_defaults
>>>>> Mutex ssl-cache: using_defaults
>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>> Define: DUMP_VHOSTS
>>>>> Define: DUMP_RUN_CFG
>>>>> User: name="apache" id=48
>>>>> Group: name="apache" id=48
>>>>> #
>>>>>
>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>> the browser which is expected behaviour.
>>>>>
>>>>> [image: image.png]
>>>>>
>>>>> I am still unable to render the index.html file from the document root
>>>>> in /var/www/html/htmlcode which I created a new folder for testing
>>>>> purposes.
>>>>>
>>>>> Please suggest and guide me. Thanks in advance.
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Kaushal
>>>>>
>>>>
>>>> Hi,
>>>>
>>>> I have referred to https://httpd.apache.org/docs/2.4/mod/mod_dir.html
>>>> by adding DirectoryIndex index.html directive in 443 virtualhost. The issue
>>>> still persists.
>>>>
>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>> <VirtualHost *:80>
>>>> ServerName phpnodejs.mydomain.com
>>>> Redirect / https://phpnodejs.mydomain.com/
>>>> </VirtualHost>
>>>> <VirtualHost *:443>
>>>> DocumentRoot /var/www/html/htmlcode
>>>> DirectoryIndex index.html
>>>> ServerName phpnodejs.mydomain.com
>>>> Header add Access-Control-Allow-Origin "*"
>>>> SSLEngine on
>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/cert.pem
>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/privkey.pem
>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/chain.pem
>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>> includeSubDomains"
>>>> ProxyPass /index.html !
>>>> ProxyPass / http://localhost:3000/
>>>> </VirtualHost>
>>>>
>>>> Please suggest further and guide me. Thanks in advance.
>>>>
>>>> Best Regards,
>>>>
>>>> Kaushal
>>>>
>>>
>>>
>>> Further to the earlier email, I am sharing the log files.
>>>
>>> #cd /var/log/httpd/
>>> #pwd
>>> /var/log/httpd
>>> # cat access_log
>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200 11
>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>> Firefox/114.0"
>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET /nodejssl/server.js
>>> HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15;
>>> rv:109.0) Gecko/20100101 Firefox/114.0"
>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200 11
>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>> Firefox/114.0"
>>> # cat error_log
>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid 31795]
>>> AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>>> determines how things are processed in your server. HTTP/2 has more demands
>>> in this regard and the currently selected mpm will just not do. This is an
>>> advisory warning. Your server will continue to work, but the HTTP/2
>>> protocol will be inactive.
>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid 31795:tid
>>> 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips configured --
>>> resuming normal operations
>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid 31795]
>>> AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>> #
>>>
>>> Best Regards,
>>>
>>> Kaushal
>>>
>>
>> Hi,
>>
>> I have enabled debug logging by adding LogLevel debug in 443 virtualhost.
>>
>> #cat /etc/httpd/conf.d/phpnodejs.conf
>> <VirtualHost *:80>
>> ServerName phpnodejs.mydomain.com
>> Redirect / https://phpnodejs.mydomain.com/
>> </VirtualHost>
>> <VirtualHost *:443>
>> DocumentRoot /var/www/html/htmlcode
>> DirectoryIndex index.html
>> ServerName phpnodejs.mydomain.com
>> Header add Access-Control-Allow-Origin "*"
>> LogLevel debug
>> SSLEngine on
>> SSLCertificateFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/cert.pem
>> SSLCertificateKeyFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/privkey.pem
>> SSLCertificateChainFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/chain.pem
>> Header always set Strict-Transport-Security "max-age=63072000;
>> includeSubDomains"
>> ProxyPass /index.html !
>> ProxyPass / http://localhost:3000/
>> </VirtualHost>
>>
>> debug apache error log file -> http://sprunge.us/kndkvL
>>
>> Please suggest further and guide me. Thanks in advance.
>>
>> Best Regards,
>>
>> Kaushal
>>
>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
^/(.+) will already match /demo, why are you changing the expression?

On Sun, Jul 2, 2023 at 10:42?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

> Hi Frank,
>
> Thanks a lot. It worked perfectly. I have a follow up question for /demo
> path (as part of node.js code so /demo has all nodejs code) just as an
> improvement . I modified the ProxyPassMatch directive as per the below
> example and it returned http 404.
>
> ProxyPassMatch ^/demo(.+) http://localhost:3000/
>
> Am I missing anything? Apologies for bugging you.
>
> Please guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
>
> On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org> wrote:
>
>> This thread is getting very tiresome. So, let's summarize:
>>
>> - You want to request /, serve index.html
>> - For all other requests, proxy internally
>>
>> As such, keep the ProxyPass /index.html ! for clarity and change your
>> existing ProxyPass directive to:
>>
>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>
>> In short, this means that requesting / will not match, and requesting
>> /foo will proxy.
>>
>> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
>> wrote:
>>
>>>
>>>
>>>
>>>
>>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <
>>>> kaushalshriyan@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>
>>>>>> Hi Frank,
>>>>>>
>>>>>> Thanks for the email response and much appreciated. I added the
>>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>>
>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>> <VirtualHost *:80>
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>> </VirtualHost>
>>>>>> <VirtualHost *:443>
>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>> SSLEngine on
>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>> Header always set Strict-Transport-Security
>>>>>> "max-age=63072000; includeSubDomains"
>>>>>> ProxyPass /index.html !
>>>>>> ProxyPass / http://localhost:3000/
>>>>>> </VirtualHost>
>>>>>>
>>>>>> # apachectl configtest
>>>>>> Syntax OK
>>>>>> #apachectl -S
>>>>>> VirtualHost configuration:
>>>>>> *:80 phpnodejs.mydomain.com
>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>>> *:443 phpnodejs.mydomain.com
>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>>> ServerRoot: "/etc/httpd"
>>>>>> Main DocumentRoot: "/var/www/html"
>>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>>> Mutex mpm-accept: using_defaults
>>>>>> Mutex cache-socache: using_defaults
>>>>>> Mutex authdigest-opaque: using_defaults
>>>>>> Mutex watchdog-callback: using_defaults
>>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>>> Mutex rewrite-map: using_defaults
>>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>>> Mutex authdigest-client: using_defaults
>>>>>> Mutex lua-ivm-shm: using_defaults
>>>>>> Mutex ssl-stapling: using_defaults
>>>>>> Mutex proxy: using_defaults
>>>>>> Mutex authn-socache: using_defaults
>>>>>> Mutex ssl-cache: using_defaults
>>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>>> Define: DUMP_VHOSTS
>>>>>> Define: DUMP_RUN_CFG
>>>>>> User: name="apache" id=48
>>>>>> Group: name="apache" id=48
>>>>>> #
>>>>>>
>>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>>> the browser which is expected behaviour.
>>>>>>
>>>>>> [image: image.png]
>>>>>>
>>>>>> I am still unable to render the index.html file from the document
>>>>>> root in /var/www/html/htmlcode which I created a new folder for testing
>>>>>> purposes.
>>>>>>
>>>>>> Please suggest and guide me. Thanks in advance.
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Kaushal
>>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have referred to https://httpd.apache.org/docs/2.4/mod/mod_dir.html
>>>>> by adding DirectoryIndex index.html directive in 443 virtualhost. The issue
>>>>> still persists.
>>>>>
>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>> <VirtualHost *:80>
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>> </VirtualHost>
>>>>> <VirtualHost *:443>
>>>>> DocumentRoot /var/www/html/htmlcode
>>>>> DirectoryIndex index.html
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Header add Access-Control-Allow-Origin "*"
>>>>> SSLEngine on
>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/cert.pem
>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/chain.pem
>>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>>> includeSubDomains"
>>>>> ProxyPass /index.html !
>>>>> ProxyPass / http://localhost:3000/
>>>>> </VirtualHost>
>>>>>
>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Kaushal
>>>>>
>>>>
>>>>
>>>> Further to the earlier email, I am sharing the log files.
>>>>
>>>> #cd /var/log/httpd/
>>>> #pwd
>>>> /var/log/httpd
>>>> # cat access_log
>>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200 11
>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>> Firefox/114.0"
>>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET /nodejssl/server.js
>>>> HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15;
>>>> rv:109.0) Gecko/20100101 Firefox/114.0"
>>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200 11
>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>> Firefox/114.0"
>>>> # cat error_log
>>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid 31795]
>>>> AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>>>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>>>> determines how things are processed in your server. HTTP/2 has more demands
>>>> in this regard and the currently selected mpm will just not do. This is an
>>>> advisory warning. Your server will continue to work, but the HTTP/2
>>>> protocol will be inactive.
>>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid 31795:tid
>>>> 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips configured --
>>>> resuming normal operations
>>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid 31795]
>>>> AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>>> #
>>>>
>>>> Best Regards,
>>>>
>>>> Kaushal
>>>>
>>>
>>> Hi,
>>>
>>> I have enabled debug logging by adding LogLevel debug in 443
>>> virtualhost.
>>>
>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>> <VirtualHost *:80>
>>> ServerName phpnodejs.mydomain.com
>>> Redirect / https://phpnodejs.mydomain.com/
>>> </VirtualHost>
>>> <VirtualHost *:443>
>>> DocumentRoot /var/www/html/htmlcode
>>> DirectoryIndex index.html
>>> ServerName phpnodejs.mydomain.com
>>> Header add Access-Control-Allow-Origin "*"
>>> LogLevel debug
>>> SSLEngine on
>>> SSLCertificateFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/cert.pem
>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/privkey.pem
>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/chain.pem
>>> Header always set Strict-Transport-Security "max-age=63072000;
>>> includeSubDomains"
>>> ProxyPass /index.html !
>>> ProxyPass / http://localhost:3000/
>>> </VirtualHost>
>>>
>>> debug apache error log file -> http://sprunge.us/kndkvL
>>>
>>> Please suggest further and guide me. Thanks in advance.
>>>
>>> Best Regards,
>>>
>>> Kaushal
>>>
>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Hi Frank,

When I set the below in /etc/httpd/conf.d/phpnodejs.conf. When I hit
https://phpnodejs.mydomain.com which is the html content, the images are
broken and unable to load javascript, CSS etc...

ProxyPass /index.html !
ProxyPassMatch ^/(.+) http://localhost:3000/

#cat /etc/httpd/conf.d/phpnodejs.conf
<VirtualHost *:80>
ServerName phpnodejs.mydomain.com
Redirect / https://phpnodejs.mydomain.com/
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/html/htmlcode
DirectoryIndex index.html
ServerName phpnodejs.mydomain.com
Header add Access-Control-Allow-Origin "*"
LogLevel debug
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/
phpnodejs.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/
phpnodejs.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/
phpnodejs.mydomain.com/chain.pem
Header always set Strict-Transport-Security "max-age=63072000;
includeSubDomains"
ProxyPass /index.html !
ProxyPassMatch ^/(.+) http://localhost:3000/
</VirtualHost>

Please guide me. Thanks in advance.

Best Regards,

Kaushal


On Sun, Jul 2, 2023 at 8:57?PM Frank Gingras <thumbs@apache.org> wrote:

> ^/(.+) will already match /demo, why are you changing the expression?
>
> On Sun, Jul 2, 2023 at 10:42?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>> Hi Frank,
>>
>> Thanks a lot. It worked perfectly. I have a follow up question for /demo
>> path (as part of node.js code so /demo has all nodejs code) just as an
>> improvement . I modified the ProxyPassMatch directive as per the below
>> example and it returned http 404.
>>
>> ProxyPassMatch ^/demo(.+) http://localhost:3000/
>>
>> Am I missing anything? Apologies for bugging you.
>>
>> Please guide me. Thanks in advance.
>>
>> Best Regards,
>>
>> Kaushal
>>
>>
>> On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org> wrote:
>>
>>> This thread is getting very tiresome. So, let's summarize:
>>>
>>> - You want to request /, serve index.html
>>> - For all other requests, proxy internally
>>>
>>> As such, keep the ProxyPass /index.html ! for clarity and change your
>>> existing ProxyPass directive to:
>>>
>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>>
>>> In short, this means that requesting / will not match, and requesting
>>> /foo will proxy.
>>>
>>> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <
>>>> kaushalshriyan@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <
>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Frank,
>>>>>>>
>>>>>>> Thanks for the email response and much appreciated. I added the
>>>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>
>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>> <VirtualHost *:80>
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>> </VirtualHost>
>>>>>>> <VirtualHost *:443>
>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>> SSLEngine on
>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>> Header always set Strict-Transport-Security
>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>> ProxyPass /index.html !
>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>> </VirtualHost>
>>>>>>>
>>>>>>> # apachectl configtest
>>>>>>> Syntax OK
>>>>>>> #apachectl -S
>>>>>>> VirtualHost configuration:
>>>>>>> *:80 phpnodejs.mydomain.com
>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>>>> *:443 phpnodejs.mydomain.com
>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>>>> ServerRoot: "/etc/httpd"
>>>>>>> Main DocumentRoot: "/var/www/html"
>>>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>>>> Mutex mpm-accept: using_defaults
>>>>>>> Mutex cache-socache: using_defaults
>>>>>>> Mutex authdigest-opaque: using_defaults
>>>>>>> Mutex watchdog-callback: using_defaults
>>>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>>>> Mutex rewrite-map: using_defaults
>>>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>>>> Mutex authdigest-client: using_defaults
>>>>>>> Mutex lua-ivm-shm: using_defaults
>>>>>>> Mutex ssl-stapling: using_defaults
>>>>>>> Mutex proxy: using_defaults
>>>>>>> Mutex authn-socache: using_defaults
>>>>>>> Mutex ssl-cache: using_defaults
>>>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>>>> Define: DUMP_VHOSTS
>>>>>>> Define: DUMP_RUN_CFG
>>>>>>> User: name="apache" id=48
>>>>>>> Group: name="apache" id=48
>>>>>>> #
>>>>>>>
>>>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>>>> the browser which is expected behaviour.
>>>>>>>
>>>>>>> [image: image.png]
>>>>>>>
>>>>>>> I am still unable to render the index.html file from the document
>>>>>>> root in /var/www/html/htmlcode which I created a new folder for testing
>>>>>>> purposes.
>>>>>>>
>>>>>>> Please suggest and guide me. Thanks in advance.
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Kaushal
>>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have referred to https://httpd.apache.org/docs/2.4/mod/mod_dir.html
>>>>>> by adding DirectoryIndex index.html directive in 443 virtualhost. The issue
>>>>>> still persists.
>>>>>>
>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>> <VirtualHost *:80>
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>> </VirtualHost>
>>>>>> <VirtualHost *:443>
>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>> DirectoryIndex index.html
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>> SSLEngine on
>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>> Header always set Strict-Transport-Security
>>>>>> "max-age=63072000; includeSubDomains"
>>>>>> ProxyPass /index.html !
>>>>>> ProxyPass / http://localhost:3000/
>>>>>> </VirtualHost>
>>>>>>
>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Kaushal
>>>>>>
>>>>>
>>>>>
>>>>> Further to the earlier email, I am sharing the log files.
>>>>>
>>>>> #cd /var/log/httpd/
>>>>> #pwd
>>>>> /var/log/httpd
>>>>> # cat access_log
>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200 11
>>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>>> Firefox/114.0"
>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET /nodejssl/server.js
>>>>> HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15;
>>>>> rv:109.0) Gecko/20100101 Firefox/114.0"
>>>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200 11
>>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>>> Firefox/114.0"
>>>>> # cat error_log
>>>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid
>>>>> 31795] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>>>>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>>>>> determines how things are processed in your server. HTTP/2 has more demands
>>>>> in this regard and the currently selected mpm will just not do. This is an
>>>>> advisory warning. Your server will continue to work, but the HTTP/2
>>>>> protocol will be inactive.
>>>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid 31795:tid
>>>>> 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips configured --
>>>>> resuming normal operations
>>>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid 31795]
>>>>> AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>>>> #
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Kaushal
>>>>>
>>>>
>>>> Hi,
>>>>
>>>> I have enabled debug logging by adding LogLevel debug in 443
>>>> virtualhost.
>>>>
>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>> <VirtualHost *:80>
>>>> ServerName phpnodejs.mydomain.com
>>>> Redirect / https://phpnodejs.mydomain.com/
>>>> </VirtualHost>
>>>> <VirtualHost *:443>
>>>> DocumentRoot /var/www/html/htmlcode
>>>> DirectoryIndex index.html
>>>> ServerName phpnodejs.mydomain.com
>>>> Header add Access-Control-Allow-Origin "*"
>>>> LogLevel debug
>>>> SSLEngine on
>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/cert.pem
>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/privkey.pem
>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>> phpnodejs.mydomain.com/chain.pem
>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>> includeSubDomains"
>>>> ProxyPass /index.html !
>>>> ProxyPass / http://localhost:3000/
>>>> </VirtualHost>
>>>>
>>>> debug apache error log file -> http://sprunge.us/kndkvL
>>>>
>>>> Please suggest further and guide me. Thanks in advance.
>>>>
>>>> Best Regards,
>>>>
>>>> Kaushal
>>>>
>>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Try adding $1 to the target to use the captured value.

Also, depending on the response from the backend, you may need a
ProxyPassReverse directive.

On Sun, Jul 2, 2023 at 11:41?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

> Hi Frank,
>
> When I set the below in /etc/httpd/conf.d/phpnodejs.conf. When I hit
> https://phpnodejs.mydomain.com which is the html content, the images are
> broken and unable to load javascript, CSS etc...
>
> ProxyPass /index.html !
> ProxyPassMatch ^/(.+) http://localhost:3000/
>
> #cat /etc/httpd/conf.d/phpnodejs.conf
> <VirtualHost *:80>
> ServerName phpnodejs.mydomain.com
> Redirect / https://phpnodejs.mydomain.com/
> </VirtualHost>
> <VirtualHost *:443>
> DocumentRoot /var/www/html/htmlcode
> DirectoryIndex index.html
> ServerName phpnodejs.mydomain.com
> Header add Access-Control-Allow-Origin "*"
> LogLevel debug
> SSLEngine on
> SSLCertificateFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/privkey.pem
> SSLCertificateChainFile /etc/letsencrypt/live/
> phpnodejs.mydomain.com/chain.pem
> Header always set Strict-Transport-Security "max-age=63072000;
> includeSubDomains"
> ProxyPass /index.html !
> ProxyPassMatch ^/(.+) http://localhost:3000/
> </VirtualHost>
>
> Please guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
>
> On Sun, Jul 2, 2023 at 8:57?PM Frank Gingras <thumbs@apache.org> wrote:
>
>> ^/(.+) will already match /demo, why are you changing the expression?
>>
>> On Sun, Jul 2, 2023 at 10:42?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>> wrote:
>>
>>> Hi Frank,
>>>
>>> Thanks a lot. It worked perfectly. I have a follow up question for /demo
>>> path (as part of node.js code so /demo has all nodejs code) just as an
>>> improvement . I modified the ProxyPassMatch directive as per the below
>>> example and it returned http 404.
>>>
>>> ProxyPassMatch ^/demo(.+) http://localhost:3000/
>>>
>>> Am I missing anything? Apologies for bugging you.
>>>
>>> Please guide me. Thanks in advance.
>>>
>>> Best Regards,
>>>
>>> Kaushal
>>>
>>>
>>> On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org> wrote:
>>>
>>>> This thread is getting very tiresome. So, let's summarize:
>>>>
>>>> - You want to request /, serve index.html
>>>> - For all other requests, proxy internally
>>>>
>>>> As such, keep the ProxyPass /index.html ! for clarity and change your
>>>> existing ProxyPass directive to:
>>>>
>>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>>>
>>>> In short, this means that requesting / will not match, and requesting
>>>> /foo will proxy.
>>>>
>>>> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <
>>>> kaushalshriyan@gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <
>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <
>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hi Frank,
>>>>>>>>
>>>>>>>> Thanks for the email response and much appreciated. I added the
>>>>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>
>>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>> <VirtualHost *:80>
>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>>> </VirtualHost>
>>>>>>>> <VirtualHost *:443>
>>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>>> SSLEngine on
>>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>>> Header always set Strict-Transport-Security
>>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>>> ProxyPass /index.html !
>>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>>> </VirtualHost>
>>>>>>>>
>>>>>>>> # apachectl configtest
>>>>>>>> Syntax OK
>>>>>>>> #apachectl -S
>>>>>>>> VirtualHost configuration:
>>>>>>>> *:80 phpnodejs.mydomain.com
>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>>>>> *:443 phpnodejs.mydomain.com
>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>>>>> ServerRoot: "/etc/httpd"
>>>>>>>> Main DocumentRoot: "/var/www/html"
>>>>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>>>>> Mutex mpm-accept: using_defaults
>>>>>>>> Mutex cache-socache: using_defaults
>>>>>>>> Mutex authdigest-opaque: using_defaults
>>>>>>>> Mutex watchdog-callback: using_defaults
>>>>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>>>>> Mutex rewrite-map: using_defaults
>>>>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>>>>> Mutex authdigest-client: using_defaults
>>>>>>>> Mutex lua-ivm-shm: using_defaults
>>>>>>>> Mutex ssl-stapling: using_defaults
>>>>>>>> Mutex proxy: using_defaults
>>>>>>>> Mutex authn-socache: using_defaults
>>>>>>>> Mutex ssl-cache: using_defaults
>>>>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>>>>> Define: DUMP_VHOSTS
>>>>>>>> Define: DUMP_RUN_CFG
>>>>>>>> User: name="apache" id=48
>>>>>>>> Group: name="apache" id=48
>>>>>>>> #
>>>>>>>>
>>>>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>>>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>>>>> the browser which is expected behaviour.
>>>>>>>>
>>>>>>>> [image: image.png]
>>>>>>>>
>>>>>>>> I am still unable to render the index.html file from the document
>>>>>>>> root in /var/www/html/htmlcode which I created a new folder for testing
>>>>>>>> purposes.
>>>>>>>>
>>>>>>>> Please suggest and guide me. Thanks in advance.
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>>
>>>>>>>> Kaushal
>>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have referred to
>>>>>>> https://httpd.apache.org/docs/2.4/mod/mod_dir.html by adding
>>>>>>> DirectoryIndex index.html directive in 443 virtualhost. The issue still
>>>>>>> persists.
>>>>>>>
>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>> <VirtualHost *:80>
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>> </VirtualHost>
>>>>>>> <VirtualHost *:443>
>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>> DirectoryIndex index.html
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>> SSLEngine on
>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>> Header always set Strict-Transport-Security
>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>> ProxyPass /index.html !
>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>> </VirtualHost>
>>>>>>>
>>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Kaushal
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Further to the earlier email, I am sharing the log files.
>>>>>>
>>>>>> #cd /var/log/httpd/
>>>>>> #pwd
>>>>>> /var/log/httpd
>>>>>> # cat access_log
>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200 11
>>>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>>>> Firefox/114.0"
>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET
>>>>>> /nodejssl/server.js HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac
>>>>>> OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0"
>>>>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200 11
>>>>>> "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101
>>>>>> Firefox/114.0"
>>>>>> # cat error_log
>>>>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid
>>>>>> 31795] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>>>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>>>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>>>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>>>>>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>>>>>> determines how things are processed in your server. HTTP/2 has more demands
>>>>>> in this regard and the currently selected mpm will just not do. This is an
>>>>>> advisory warning. Your server will continue to work, but the HTTP/2
>>>>>> protocol will be inactive.
>>>>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>>>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>>>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid 31795:tid
>>>>>> 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips configured --
>>>>>> resuming normal operations
>>>>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid 31795]
>>>>>> AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>>>>> #
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Kaushal
>>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have enabled debug logging by adding LogLevel debug in 443
>>>>> virtualhost.
>>>>>
>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>> <VirtualHost *:80>
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>> </VirtualHost>
>>>>> <VirtualHost *:443>
>>>>> DocumentRoot /var/www/html/htmlcode
>>>>> DirectoryIndex index.html
>>>>> ServerName phpnodejs.mydomain.com
>>>>> Header add Access-Control-Allow-Origin "*"
>>>>> LogLevel debug
>>>>> SSLEngine on
>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/cert.pem
>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>> phpnodejs.mydomain.com/chain.pem
>>>>> Header always set Strict-Transport-Security "max-age=63072000;
>>>>> includeSubDomains"
>>>>> ProxyPass /index.html !
>>>>> ProxyPass / http://localhost:3000/
>>>>> </VirtualHost>
>>>>>
>>>>> debug apache error log file -> http://sprunge.us/kndkvL
>>>>>
>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Kaushal
>>>>>
>>>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Hi Frank,

Thanks for the quick response. I will appreciate it if you can help me
understand by considering the below directive. I am not sure about placing
$1 to the target. Any examples which will be easy to understand?

ProxyPass /index.html !
ProxyPassMatch ^/(.+) http://localhost:3000/

Please suggest further and guide me. Thanks in advance.

Best Regards,

Kaushal

On Sun, Jul 2, 2023 at 9:31?PM Frank Gingras <thumbs@apache.org> wrote:

> Try adding $1 to the target to use the captured value.
>
> Also, depending on the response from the backend, you may need a
> ProxyPassReverse directive.
>
> On Sun, Jul 2, 2023 at 11:41?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>> Hi Frank,
>>
>> When I set the below in /etc/httpd/conf.d/phpnodejs.conf. When I hit
>> https://phpnodejs.mydomain.com which is the html content, the images are
>> broken and unable to load javascript, CSS etc...
>>
>> ProxyPass /index.html !
>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>
>> #cat /etc/httpd/conf.d/phpnodejs.conf
>> <VirtualHost *:80>
>> ServerName phpnodejs.mydomain.com
>> Redirect / https://phpnodejs.mydomain.com/
>> </VirtualHost>
>> <VirtualHost *:443>
>> DocumentRoot /var/www/html/htmlcode
>> DirectoryIndex index.html
>> ServerName phpnodejs.mydomain.com
>> Header add Access-Control-Allow-Origin "*"
>> LogLevel debug
>> SSLEngine on
>> SSLCertificateFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/cert.pem
>> SSLCertificateKeyFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/privkey.pem
>> SSLCertificateChainFile /etc/letsencrypt/live/
>> phpnodejs.mydomain.com/chain.pem
>> Header always set Strict-Transport-Security "max-age=63072000;
>> includeSubDomains"
>> ProxyPass /index.html !
>> ProxyPassMatch ^/(.+) http://localhost:3000/
>> </VirtualHost>
>>
>> Please guide me. Thanks in advance.
>>
>> Best Regards,
>>
>> Kaushal
>>
>>
>> On Sun, Jul 2, 2023 at 8:57?PM Frank Gingras <thumbs@apache.org> wrote:
>>
>>> ^/(.+) will already match /demo, why are you changing the expression?
>>>
>>> On Sun, Jul 2, 2023 at 10:42?AM Kaushal Shriyan <
>>> kaushalshriyan@gmail.com> wrote:
>>>
>>>> Hi Frank,
>>>>
>>>> Thanks a lot. It worked perfectly. I have a follow up question for
>>>> /demo path (as part of node.js code so /demo has all nodejs code) just as
>>>> an improvement . I modified the ProxyPassMatch directive as per the below
>>>> example and it returned http 404.
>>>>
>>>> ProxyPassMatch ^/demo(.+) http://localhost:3000/
>>>>
>>>> Am I missing anything? Apologies for bugging you.
>>>>
>>>> Please guide me. Thanks in advance.
>>>>
>>>> Best Regards,
>>>>
>>>> Kaushal
>>>>
>>>>
>>>> On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org> wrote:
>>>>
>>>>> This thread is getting very tiresome. So, let's summarize:
>>>>>
>>>>> - You want to request /, serve index.html
>>>>> - For all other requests, proxy internally
>>>>>
>>>>> As such, keep the ProxyPass /index.html ! for clarity and change your
>>>>> existing ProxyPass directive to:
>>>>>
>>>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>>>>
>>>>> In short, this means that requesting / will not match, and requesting
>>>>> /foo will proxy.
>>>>>
>>>>> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <
>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <
>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <
>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Frank,
>>>>>>>>>
>>>>>>>>> Thanks for the email response and much appreciated. I added the
>>>>>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>>
>>>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>> <VirtualHost *:80>
>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>>>> </VirtualHost>
>>>>>>>>> <VirtualHost *:443>
>>>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>>>> SSLEngine on
>>>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>>>> Header always set Strict-Transport-Security
>>>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>>>> ProxyPass /index.html !
>>>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>>>> </VirtualHost>
>>>>>>>>>
>>>>>>>>> # apachectl configtest
>>>>>>>>> Syntax OK
>>>>>>>>> #apachectl -S
>>>>>>>>> VirtualHost configuration:
>>>>>>>>> *:80 phpnodejs.mydomain.com
>>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>>>>>> *:443 phpnodejs.mydomain.com
>>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>>>>>> ServerRoot: "/etc/httpd"
>>>>>>>>> Main DocumentRoot: "/var/www/html"
>>>>>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>>>>>> Mutex mpm-accept: using_defaults
>>>>>>>>> Mutex cache-socache: using_defaults
>>>>>>>>> Mutex authdigest-opaque: using_defaults
>>>>>>>>> Mutex watchdog-callback: using_defaults
>>>>>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>>>>>> Mutex rewrite-map: using_defaults
>>>>>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>>>>>> Mutex authdigest-client: using_defaults
>>>>>>>>> Mutex lua-ivm-shm: using_defaults
>>>>>>>>> Mutex ssl-stapling: using_defaults
>>>>>>>>> Mutex proxy: using_defaults
>>>>>>>>> Mutex authn-socache: using_defaults
>>>>>>>>> Mutex ssl-cache: using_defaults
>>>>>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>>>>>> Define: DUMP_VHOSTS
>>>>>>>>> Define: DUMP_RUN_CFG
>>>>>>>>> User: name="apache" id=48
>>>>>>>>> Group: name="apache" id=48
>>>>>>>>> #
>>>>>>>>>
>>>>>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to the
>>>>>>>>> nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>>>>>> the browser which is expected behaviour.
>>>>>>>>>
>>>>>>>>> [image: image.png]
>>>>>>>>>
>>>>>>>>> I am still unable to render the index.html file from the document
>>>>>>>>> root in /var/www/html/htmlcode which I created a new folder for testing
>>>>>>>>> purposes.
>>>>>>>>>
>>>>>>>>> Please suggest and guide me. Thanks in advance.
>>>>>>>>>
>>>>>>>>> Best Regards,
>>>>>>>>>
>>>>>>>>> Kaushal
>>>>>>>>>
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have referred to
>>>>>>>> https://httpd.apache.org/docs/2.4/mod/mod_dir.html by adding
>>>>>>>> DirectoryIndex index.html directive in 443 virtualhost. The issue still
>>>>>>>> persists.
>>>>>>>>
>>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>> <VirtualHost *:80>
>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>>> </VirtualHost>
>>>>>>>> <VirtualHost *:443>
>>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>>> DirectoryIndex index.html
>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>>> SSLEngine on
>>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>>> Header always set Strict-Transport-Security
>>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>>> ProxyPass /index.html !
>>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>>> </VirtualHost>
>>>>>>>>
>>>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>>
>>>>>>>> Kaushal
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Further to the earlier email, I am sharing the log files.
>>>>>>>
>>>>>>> #cd /var/log/httpd/
>>>>>>> #pwd
>>>>>>> /var/log/httpd
>>>>>>> # cat access_log
>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200
>>>>>>> 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0)
>>>>>>> Gecko/20100101 Firefox/114.0"
>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET
>>>>>>> /nodejssl/server.js HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac
>>>>>>> OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0"
>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200
>>>>>>> 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0)
>>>>>>> Gecko/20100101 Firefox/114.0"
>>>>>>> # cat error_log
>>>>>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid
>>>>>>> 31795] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>>>>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>>>>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>>>>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid 31795]
>>>>>>> AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm
>>>>>>> determines how things are processed in your server. HTTP/2 has more demands
>>>>>>> in this regard and the currently selected mpm will just not do. This is an
>>>>>>> advisory warning. Your server will continue to work, but the HTTP/2
>>>>>>> protocol will be inactive.
>>>>>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>>>>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>>>>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid
>>>>>>> 31795:tid 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips
>>>>>>> configured -- resuming normal operations
>>>>>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid
>>>>>>> 31795] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>>>>>> #
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Kaushal
>>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have enabled debug logging by adding LogLevel debug in 443
>>>>>> virtualhost.
>>>>>>
>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>> <VirtualHost *:80>
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>> </VirtualHost>
>>>>>> <VirtualHost *:443>
>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>> DirectoryIndex index.html
>>>>>> ServerName phpnodejs.mydomain.com
>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>> LogLevel debug
>>>>>> SSLEngine on
>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>> Header always set Strict-Transport-Security
>>>>>> "max-age=63072000; includeSubDomains"
>>>>>> ProxyPass /index.html !
>>>>>> ProxyPass / http://localhost:3000/
>>>>>> </VirtualHost>
>>>>>>
>>>>>> debug apache error log file -> http://sprunge.us/kndkvL
>>>>>>
>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Kaushal
>>>>>>
>>>>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
I would read this page:

https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypassmatch

On Sun, Jul 2, 2023 at 1:03?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

> Hi Frank,
>
> Thanks for the quick response. I will appreciate it if you can help me
> understand by considering the below directive. I am not sure about placing
> $1 to the target. Any examples which will be easy to understand?
>
> ProxyPass /index.html !
> ProxyPassMatch ^/(.+) http://localhost:3000/
>
> Please suggest further and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
> On Sun, Jul 2, 2023 at 9:31?PM Frank Gingras <thumbs@apache.org> wrote:
>
>> Try adding $1 to the target to use the captured value.
>>
>> Also, depending on the response from the backend, you may need a
>> ProxyPassReverse directive.
>>
>> On Sun, Jul 2, 2023 at 11:41?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
>> wrote:
>>
>>> Hi Frank,
>>>
>>> When I set the below in /etc/httpd/conf.d/phpnodejs.conf. When I hit
>>> https://phpnodejs.mydomain.com which is the html content, the images
>>> are broken and unable to load javascript, CSS etc...
>>>
>>> ProxyPass /index.html !
>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>>
>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>> <VirtualHost *:80>
>>> ServerName phpnodejs.mydomain.com
>>> Redirect / https://phpnodejs.mydomain.com/
>>> </VirtualHost>
>>> <VirtualHost *:443>
>>> DocumentRoot /var/www/html/htmlcode
>>> DirectoryIndex index.html
>>> ServerName phpnodejs.mydomain.com
>>> Header add Access-Control-Allow-Origin "*"
>>> LogLevel debug
>>> SSLEngine on
>>> SSLCertificateFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/cert.pem
>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/privkey.pem
>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>> phpnodejs.mydomain.com/chain.pem
>>> Header always set Strict-Transport-Security "max-age=63072000;
>>> includeSubDomains"
>>> ProxyPass /index.html !
>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>> </VirtualHost>
>>>
>>> Please guide me. Thanks in advance.
>>>
>>> Best Regards,
>>>
>>> Kaushal
>>>
>>>
>>> On Sun, Jul 2, 2023 at 8:57?PM Frank Gingras <thumbs@apache.org> wrote:
>>>
>>>> ^/(.+) will already match /demo, why are you changing the expression?
>>>>
>>>> On Sun, Jul 2, 2023 at 10:42?AM Kaushal Shriyan <
>>>> kaushalshriyan@gmail.com> wrote:
>>>>
>>>>> Hi Frank,
>>>>>
>>>>> Thanks a lot. It worked perfectly. I have a follow up question for
>>>>> /demo path (as part of node.js code so /demo has all nodejs code) just as
>>>>> an improvement . I modified the ProxyPassMatch directive as per the below
>>>>> example and it returned http 404.
>>>>>
>>>>> ProxyPassMatch ^/demo(.+) http://localhost:3000/
>>>>>
>>>>> Am I missing anything? Apologies for bugging you.
>>>>>
>>>>> Please guide me. Thanks in advance.
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Kaushal
>>>>>
>>>>>
>>>>> On Sun, Jul 2, 2023 at 8:00?AM Frank Gingras <thumbs@apache.org>
>>>>> wrote:
>>>>>
>>>>>> This thread is getting very tiresome. So, let's summarize:
>>>>>>
>>>>>> - You want to request /, serve index.html
>>>>>> - For all other requests, proxy internally
>>>>>>
>>>>>> As such, keep the ProxyPass /index.html ! for clarity and change your
>>>>>> existing ProxyPass directive to:
>>>>>>
>>>>>> ProxyPassMatch ^/(.+) http://localhost:3000/
>>>>>>
>>>>>> In short, this means that requesting / will not match, and requesting
>>>>>> /foo will proxy.
>>>>>>
>>>>>> On Sat, Jul 1, 2023 at 9:22?PM Kaushal Shriyan <
>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Jul 2, 2023 at 6:20?AM Kaushal Shriyan <
>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, Jul 2, 2023 at 6:14?AM Kaushal Shriyan <
>>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Jul 1, 2023 at 7:50?AM Kaushal Shriyan <
>>>>>>>>> kaushalshriyan@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Frank,
>>>>>>>>>>
>>>>>>>>>> Thanks for the email response and much appreciated. I added the
>>>>>>>>>> ProxyPass /index.html ! directive in /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>>>
>>>>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>>> <VirtualHost *:80>
>>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>>>>> </VirtualHost>
>>>>>>>>>> <VirtualHost *:443>
>>>>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>>>>> SSLEngine on
>>>>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>>>>> Header always set Strict-Transport-Security
>>>>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>>>>> ProxyPass /index.html !
>>>>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>>>>> </VirtualHost>
>>>>>>>>>>
>>>>>>>>>> # apachectl configtest
>>>>>>>>>> Syntax OK
>>>>>>>>>> #apachectl -S
>>>>>>>>>> VirtualHost configuration:
>>>>>>>>>> *:80 phpnodejs.mydomain.com
>>>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:1)
>>>>>>>>>> *:443 phpnodejs.mydomain.com
>>>>>>>>>> (/etc/httpd/conf.d/phpnodejs.conf:5)
>>>>>>>>>> ServerRoot: "/etc/httpd"
>>>>>>>>>> Main DocumentRoot: "/var/www/html"
>>>>>>>>>> Main ErrorLog: "/etc/httpd/logs/error_log"
>>>>>>>>>> Mutex mpm-accept: using_defaults
>>>>>>>>>> Mutex cache-socache: using_defaults
>>>>>>>>>> Mutex authdigest-opaque: using_defaults
>>>>>>>>>> Mutex watchdog-callback: using_defaults
>>>>>>>>>> Mutex proxy-balancer-shm: using_defaults
>>>>>>>>>> Mutex rewrite-map: using_defaults
>>>>>>>>>> Mutex ssl-stapling-refresh: using_defaults
>>>>>>>>>> Mutex authdigest-client: using_defaults
>>>>>>>>>> Mutex lua-ivm-shm: using_defaults
>>>>>>>>>> Mutex ssl-stapling: using_defaults
>>>>>>>>>> Mutex proxy: using_defaults
>>>>>>>>>> Mutex authn-socache: using_defaults
>>>>>>>>>> Mutex ssl-cache: using_defaults
>>>>>>>>>> Mutex default: dir="/run/httpd/" mechanism=default
>>>>>>>>>> PidFile: "/run/httpd/httpd.pid"
>>>>>>>>>> Define: DUMP_VHOSTS
>>>>>>>>>> Define: DUMP_RUN_CFG
>>>>>>>>>> User: name="apache" id=48
>>>>>>>>>> Group: name="apache" id=48
>>>>>>>>>> #
>>>>>>>>>>
>>>>>>>>>> when I hit https://phpnodejs.mydomain.com/ it still points to
>>>>>>>>>> the nodejs server.js file located in /var/www/html/nodejssl. For testing
>>>>>>>>>> purposes, I stopped the node js code to execute. I get the below message on
>>>>>>>>>> the browser which is expected behaviour.
>>>>>>>>>>
>>>>>>>>>> [image: image.png]
>>>>>>>>>>
>>>>>>>>>> I am still unable to render the index.html file from the document
>>>>>>>>>> root in /var/www/html/htmlcode which I created a new folder for testing
>>>>>>>>>> purposes.
>>>>>>>>>>
>>>>>>>>>> Please suggest and guide me. Thanks in advance.
>>>>>>>>>>
>>>>>>>>>> Best Regards,
>>>>>>>>>>
>>>>>>>>>> Kaushal
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have referred to
>>>>>>>>> https://httpd.apache.org/docs/2.4/mod/mod_dir.html by adding
>>>>>>>>> DirectoryIndex index.html directive in 443 virtualhost. The issue still
>>>>>>>>> persists.
>>>>>>>>>
>>>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>>>> <VirtualHost *:80>
>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>>>> </VirtualHost>
>>>>>>>>> <VirtualHost *:443>
>>>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>>>> DirectoryIndex index.html
>>>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>>>> SSLEngine on
>>>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>>>> Header always set Strict-Transport-Security
>>>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>>>> ProxyPass /index.html !
>>>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>>>> </VirtualHost>
>>>>>>>>>
>>>>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>>>>
>>>>>>>>> Best Regards,
>>>>>>>>>
>>>>>>>>> Kaushal
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Further to the earlier email, I am sharing the log files.
>>>>>>>>
>>>>>>>> #cd /var/log/httpd/
>>>>>>>> #pwd
>>>>>>>> /var/log/httpd
>>>>>>>> # cat access_log
>>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:19 +0530] "GET / HTTP/1.1" 200
>>>>>>>> 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0)
>>>>>>>> Gecko/20100101 Firefox/114.0"
>>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:17:58 +0530] "GET
>>>>>>>> /nodejssl/server.js HTTP/1.1" 200 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac
>>>>>>>> OS X 10.15; rv:109.0) Gecko/20100101 Firefox/114.0"
>>>>>>>> 172.16.16.45 - - [02/Jul/2023:06:18:03 +0530] "GET / HTTP/1.1" 200
>>>>>>>> 11 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0)
>>>>>>>> Gecko/20100101 Firefox/114.0"
>>>>>>>> # cat error_log
>>>>>>>> [Sun Jul 02 06:17:14.849472 2023] [suexec:notice] [pid 31795:tid
>>>>>>>> 31795] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
>>>>>>>> [Sun Jul 02 06:17:14.880212 2023] [ssl:warn] [pid 31795:tid 31795]
>>>>>>>> AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
>>>>>>>> [Sun Jul 02 06:17:14.881405 2023] [http2:warn] [pid 31795:tid
>>>>>>>> 31795] AH10034: The mpm module (prefork.c) is not supported by mod_http2.
>>>>>>>> The mpm determines how things are processed in your server. HTTP/2 has more
>>>>>>>> demands in this regard and the currently selected mpm will just not do.
>>>>>>>> This is an advisory warning. Your server will continue to work, but the
>>>>>>>> HTTP/2 protocol will be inactive.
>>>>>>>> [Sun Jul 02 06:17:14.882256 2023] [lbmethod_heartbeat:notice] [pid
>>>>>>>> 31795:tid 31795] AH02282: No slotmem from mod_heartmonitor
>>>>>>>> [Sun Jul 02 06:17:14.887938 2023] [mpm_prefork:notice] [pid
>>>>>>>> 31795:tid 31795] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips
>>>>>>>> configured -- resuming normal operations
>>>>>>>> [Sun Jul 02 06:17:14.887993 2023] [core:notice] [pid 31795:tid
>>>>>>>> 31795] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>>>>>>>> #
>>>>>>>>
>>>>>>>> Best Regards,
>>>>>>>>
>>>>>>>> Kaushal
>>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have enabled debug logging by adding LogLevel debug in 443
>>>>>>> virtualhost.
>>>>>>>
>>>>>>> #cat /etc/httpd/conf.d/phpnodejs.conf
>>>>>>> <VirtualHost *:80>
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Redirect / https://phpnodejs.mydomain.com/
>>>>>>> </VirtualHost>
>>>>>>> <VirtualHost *:443>
>>>>>>> DocumentRoot /var/www/html/htmlcode
>>>>>>> DirectoryIndex index.html
>>>>>>> ServerName phpnodejs.mydomain.com
>>>>>>> Header add Access-Control-Allow-Origin "*"
>>>>>>> LogLevel debug
>>>>>>> SSLEngine on
>>>>>>> SSLCertificateFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/cert.pem
>>>>>>> SSLCertificateKeyFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/privkey.pem
>>>>>>> SSLCertificateChainFile /etc/letsencrypt/live/
>>>>>>> phpnodejs.mydomain.com/chain.pem
>>>>>>> Header always set Strict-Transport-Security
>>>>>>> "max-age=63072000; includeSubDomains"
>>>>>>> ProxyPass /index.html !
>>>>>>> ProxyPass / http://localhost:3000/
>>>>>>> </VirtualHost>
>>>>>>>
>>>>>>> debug apache error log file -> http://sprunge.us/kndkvL
>>>>>>>
>>>>>>> Please suggest further and guide me. Thanks in advance.
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Kaushal
>>>>>>>
>>>>>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
July 3, 2023
12:19 am est


I am catching up to the problem. I will be testing. In the interim these
are drafts. I will make edits after the Independence Day holiday. I will
add a section specifically for node.js

http://greg.gy/ssl
http://greg.gy/machine
http://greg.gy/ssl/install
http://colorsorted.com/mg/




Greg





On Saturday, June 24, 2023, Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

>
> On Thu, Jun 22, 2023 at 5:42?AM Richard <lists-apache@listmail.
> innovate.net> wrote:
>
>>
>>
>> > Date: Wednesday, June 21, 2023 20:14:40 +0000
>> > From: Richard
>> >
>> >
>> >> Date: Thursday, June 22, 2023 00:13:34 +0530
>> >> From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>> >>
>> >> When i hit https://nodejs.mydomain.com/demo/index.html I see the
>> >> below in both httpd error and access logs
>> >>
>> >># pwd
>> >> /var/log/httpd
>> >># cat error_log
>> >> [Thu Jun 22 00:06:34.161122 2023] [suexec:notice] [pid 16995:tid
>> >> 16995] AH01232: suEXEC mechanism enabled (wrapper:
>> >> /usr/sbin/suexec) [Thu Jun 22 00:06:34.196360 2023] [http2:warn]
>> >> [pid 16995:tid 16995] AH10034: The mpm module (prefork.c) is not
>> >> supported by mod_http2. The mpm determines how things are
>> >> processed in your server. HTTP/2 has more demands in this regard
>> >> and the currently selected mpm will just not do. This is an
>> >> advisory warning. Your server will continue to work, but the
>> >> HTTP/2 protocol will be inactive.
>> >> [Thu Jun 22 00:06:34.197101 2023] [lbmethod_heartbeat:notice] [pid
>> >> 16995:tid 16995] AH02282: No slotmem from mod_heartmonitor
>> >> [Thu Jun 22 00:06:34.243545 2023] [mpm_prefork:notice] [pid
>> >> 16995:tid 16995] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips
>> >> PHP/8.1.20 configured -- resuming normal operations
>> >> [Thu Jun 22 00:06:34.243596 2023] [core:notice] [pid 16995:tid
>> >> 16995] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>> >>
>> >>
>> >># cat access_log
>> >> 172.16.16.45 - drupaladmin [22/Jun/2023:00:06:45 +0530] "GET
>> >> /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh;
>> >> Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
>> >> Chrome/114.0.0.0 Safari/537.36"
>> >> 172.16.16.45 - drupaladmin [22/Jun/2023:00:06:45 +0530] "GET
>> >> /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh;
>> >> Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
>> >> Chrome/114.0.0.0 Safari/537.36"
>> >
>> > Leaving aside other potential issues, the timestamps on your
>> > error_log entries are from:
>> >
>> > Jun 22 00:06:34
>> >
>> > while the ones with the 404 in your access_log are from:
>> >
>> > 22/Jun/2023:00:06:45
>> >
>> > ~10 minutes later. I.e., they do not appear to be for the same
>> > event.
>> >
>> > The error_log entries look like server startup error messages,
>> > rather than ones related to a browser request. Also, given the
>> > timestamp formats, I'm suspecting that they aren't even from the
>> > same apache server/machine instance.
>> >
>> > Look at the entries in the error_log that are specific to the
>> > access_log 404 errors. That will give you more detail from that side
>> > of things.
>> >
>>
>> correction ...
>>
>> > ~10 minutes later. I.e., they do not appear to be for the
>> > same event.
>>
>> should be:
>>
>> > ~10 seconds later ...
>>
>> regardless, the error_log entries aren't for the access_log 404
>> requests/events.
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
> Hi,
>
> OS :- CentOS Linux release 7.9.2009 (Core)
> # node --version
> *v16.20.0*
> # httpd -v
> Server version: *Apache/2.4.57 (IUS)*
> Server built: Apr 7 2023 14:49:47
> #
> #cd /etc/httpd/conf.d/
> #cat httpdfrontend.conf
> <VirtualHost *:80>
> ServerName nodejs.mydomain.com
> Redirect / https://nodejs.mydomain.com/
> </VirtualHost>
> <VirtualHost *:443>
> DocumentRoot /var/www/html/web
> ServerName nodejs.mydomain.com
> Header add Access-Control-Allow-Origin "*"
> SSLEngine on
> SSLCertificateFile /etc/letsencrypt/live/nodejs.
> mydomain.com/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/nodejs.
> mydomain.com/privkey.pem
> SSLCertificateChainFile /etc/letsencrypt/live/nodejs.
> mydomain.com/chain.pem
> Header always set Strict-Transport-Security "max-age=63072000;
> includeSubDomains"
>
> <Directory "/var/www/html/web">
> DirectoryIndex index.html index.php
> Options FollowSymLinks
> AllowOverride All
> Require valid-user
> AuthType Basic
> AuthName "Restricted Content"
> AuthUserFile /var/www/html/web/.htpasswd
> </Directory>
> </VirtualHost>
>
> #cd /etc/httpd/conf.d/
> # cat nodejsbackendssl.conf
> <VirtualHost *:80>
> <Location />
> ProxyPass http://localhost:8000/
> </Location>
> </VirtualHost>
>
> # netstat -anp | grep 8000
> tcp6 0 0 :::8000 :::* LISTEN
> 23679/node
> tcp6 0 0 192.168.0.116:8000 104.152.52.207:46601
> ESTABLISHED 23679/node
> tcp6 0 0 192.168.0.116:8000 172.16.16.45:50467
> ESTABLISHED 23679/node
> #
>
> https://nodejs.mydomain.com/demo/index.html -> returns 404
> http://nodejs.mydomain.com:8000/demo/index.html -> returns the content
> with Non Secure on the browser.
>
> Please suggest and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
>

--
Sent from my iPhone
node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
July 3, 2023
12:19 am est



Guys:


I am catching up to the problem, but I will be following this one closely
as I am also configuring. I will be testing. In the interim these are
drafts. I will make edits after the Independence Day holiday. I will add a
section specifically for node.js

http://greg.gy/ssl
http://greg.gy/machine
http://greg.gy/ssl/install
http://colorsorted.com/mg/




Greg





On Saturday, June 24, 2023, Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

>
> On Thu, Jun 22, 2023 at 5:42?AM Richard <lists-apache@listmail.innovat
> e.net> wrote:
>
>>
>>
>> > Date: Wednesday, June 21, 2023 20:14:40 +0000
>> > From: Richard
>> >
>> >
>> >> Date: Thursday, June 22, 2023 00:13:34 +0530
>> >> From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>> >>
>> >> When i hit https://nodejs.mydomain.com/demo/index.html I see the
>> >> below in both httpd error and access logs
>> >>
>> >># pwd
>> >> /var/log/httpd
>> >># cat error_log
>> >> [Thu Jun 22 00:06:34.161122 2023] [suexec:notice] [pid 16995:tid
>> >> 16995] AH01232: suEXEC mechanism enabled (wrapper:
>> >> /usr/sbin/suexec) [Thu Jun 22 00:06:34.196360 2023] [http2:warn]
>> >> [pid 16995:tid 16995] AH10034: The mpm module (prefork.c) is not
>> >> supported by mod_http2. The mpm determines how things are
>> >> processed in your server. HTTP/2 has more demands in this regard
>> >> and the currently selected mpm will just not do. This is an
>> >> advisory warning. Your server will continue to work, but the
>> >> HTTP/2 protocol will be inactive.
>> >> [Thu Jun 22 00:06:34.197101 2023] [lbmethod_heartbeat:notice] [pid
>> >> 16995:tid 16995] AH02282: No slotmem from mod_heartmonitor
>> >> [Thu Jun 22 00:06:34.243545 2023] [mpm_prefork:notice] [pid
>> >> 16995:tid 16995] AH00163: Apache/2.4.57 (IUS) OpenSSL/1.0.2k-fips
>> >> PHP/8.1.20 configured -- resuming normal operations
>> >> [Thu Jun 22 00:06:34.243596 2023] [core:notice] [pid 16995:tid
>> >> 16995] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
>> >>
>> >>
>> >># cat access_log
>> >> 172.16.16.45 - drupaladmin [22/Jun/2023:00:06:45 +0530] "GET
>> >> /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh;
>> >> Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
>> >> Chrome/114.0.0.0 Safari/537.36"
>> >> 172.16.16.45 - drupaladmin [22/Jun/2023:00:06:45 +0530] "GET
>> >> /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh;
>> >> Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
>> >> Chrome/114.0.0.0 Safari/537.36"
>> >
>> > Leaving aside other potential issues, the timestamps on your
>> > error_log entries are from:
>> >
>> > Jun 22 00:06:34
>> >
>> > while the ones with the 404 in your access_log are from:
>> >
>> > 22/Jun/2023:00:06:45
>> >
>> > ~10 minutes later. I.e., they do not appear to be for the same
>> > event.
>> >
>> > The error_log entries look like server startup error messages,
>> > rather than ones related to a browser request. Also, given the
>> > timestamp formats, I'm suspecting that they aren't even from the
>> > same apache server/machine instance.
>> >
>> > Look at the entries in the error_log that are specific to the
>> > access_log 404 errors. That will give you more detail from that side
>> > of things.
>> >
>>
>> correction ...
>>
>> > ~10 minutes later. I.e., they do not appear to be for the
>> > same event.
>>
>> should be:
>>
>> > ~10 seconds later ...
>>
>> regardless, the error_log entries aren't for the access_log 404
>> requests/events.
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
> Hi,
>
> OS :- CentOS Linux release 7.9.2009 (Core)
> # node --version
> *v16.20.0*
> # httpd -v
> Server version: *Apache/2.4.57 (IUS)*
> Server built: Apr 7 2023 14:49:47
> #
> #cd /etc/httpd/conf.d/
> #cat httpdfrontend.conf
> <VirtualHost *:80>
> ServerName nodejs.mydomain.com
> Redirect / https://nodejs.mydomain.com/
> </VirtualHost>
> <VirtualHost *:443>
> DocumentRoot /var/www/html/web
> ServerName nodejs.mydomain.com
> Header add Access-Control-Allow-Origin "*"
> SSLEngine on
> SSLCertificateFile /etc/letsencrypt/live/nodejs.m
> ydomain.com/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/nodejs.m
> ydomain.com/privkey.pem
> SSLCertificateChainFile /etc/letsencrypt/live/nodejs.m
> ydomain.com/chain.pem
> Header always set Strict-Transport-Security "max-age=63072000;
> includeSubDomains"
>
> <Directory "/var/www/html/web">
> DirectoryIndex index.html index.php
> Options FollowSymLinks
> AllowOverride All
> Require valid-user
> AuthType Basic
> AuthName "Restricted Content"
> AuthUserFile /var/www/html/web/.htpasswd
> </Directory>
> </VirtualHost>
>
> #cd /etc/httpd/conf.d/
> # cat nodejsbackendssl.conf
> <VirtualHost *:80>
> <Location />
> ProxyPass http://localhost:8000/
> </Location>
> </VirtualHost>
>
> # netstat -anp | grep 8000
> tcp6 0 0 :::8000 :::* LISTEN
> 23679/node
> tcp6 0 0 192.168.0.116:8000 104.152.52.207:46601
> ESTABLISHED 23679/node
> tcp6 0 0 192.168.0.116:8000 172.16.16.45:50467
> ESTABLISHED 23679/node
> #
>
> https://nodejs.mydomain.com/demo/index.html -> returns 404
> http://nodejs.mydomain.com:8000/demo/index.html -> returns the content
> with Non Secure on the browser.
>
> Please suggest and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
>

--
Sent from my iPhone

1 2  View All