Mailing List Archive

node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.
Hi,

I am running node.js application on port 8000 and Apache HTTP server on
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
#

*httpd.conf file configuration*
#cat /etc/httpd/conf.d/nodejsnodejsssl.conf
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
ServerName nodejs.mydomain.com
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
<Location />
ProxyPass http://localhost:8000/
</Location>
</VirtualHost>

When I am trying to access the URL
https://nodejs.mydomain.com:8000/demo/index.html, I am encountering the
below error on the browser.

This site can’t provide a secure connection
nodejs.mydomain.com sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

Please comment if the above httpd conf file is incorrect or If i am missing
anything. 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 ]
Have you tried browsing to https://nodejs.mydomain.com/demo/index.html The proxy configuration in Apache will direct the connection to nodejs over port 8000.

Darryl Baker, GSEC, GCLD (he/him/his)
Sr. System Administrator
Distributed Application Platform Services
Northwestern University
4th Floor
2020 Ridge Avenue
Evanston, IL 60208-0801
darryl.baker@northwestern.edu<mailto:darryl.baker@northwestern.edu>
(847) 467-6674<tel:+18474676674>

From: Kaushal Shriyan <kaushalshriyan@gmail.com>
Reply-To: Apache httpd Users <users@httpd.apache.org>
Date: Wednesday, June 21, 2023 at 11:58 AM
To: Apache httpd Users <users@httpd.apache.org>
Subject: [users@httpd] node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.

Hi,

I am running node.js application on port 8000 and Apache HTTP server on 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
#

httpd.conf file configuration
#cat /etc/httpd/conf.d/nodejsnodejsssl.conf
<VirtualHost *:443>
SSLEngine On
SSLProxyEngine On
ServerName nodejs.mydomain.com<https://urldefense.com/v3/__http:/nodejs.mydomain.com__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2BlwWSOR1BA$>
SSLCertificateFile /etc/letsencrypt/live/nodejs.mydomain.com/cert.pem<https://urldefense.com/v3/__http:/nodejs.mydomain.com/cert.pem__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2Blwljjv0qA$>
SSLCertificateKeyFile /etc/letsencrypt/live/nodejs.mydomain.com/privkey.pem<https://urldefense.com/v3/__http:/nodejs.mydomain.com/privkey.pem__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2Blx2A5_VMg$>
SSLCertificateChainFile /etc/letsencrypt/live/nodejs.mydomain.com/chain.pem<https://urldefense.com/v3/__http:/nodejs.mydomain.com/chain.pem__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2BlxTYFdN1g$>
<Location />
ProxyPass http://localhost:8000/<https://urldefense.com/v3/__http:/localhost:8000/__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2BlyR-o3OPw$>
</Location>
</VirtualHost>

When I am trying to access the URL https://nodejs.mydomain.com:8000/demo/index.html<https://urldefense.com/v3/__https:/nodejs.mydomain.com:8000/demo/index.html__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2BlwxyTdWyQ$>, I am encountering the below error on the browser.

This site can’t provide a secure connection
nodejs.mydomain.com<https://urldefense.com/v3/__http:/nodejs.mydomain.com__;!!Dq0X2DkFhyF93HkjWTBQKhk!WYdO5ODHp0xIDZWNHki_OiUjJPTc3gEWggbB4kUa2MPDKfnlTEguMJRbRkrx-kqMHMF14hAw_uha7GeWGSbPY7A2BlwWSOR1BA$> sent an invalid response.
ERR_SSL_PROTOCOL_ERROR

Please comment if the above httpd conf file is incorrect or If i am missing anything. 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 ]
On Wed, Jun 21, 2023 at 10:35?PM Darryl Baker <darryl.baker@northwestern.edu>
wrote:

> Have you tried browsing to https://nodejs.mydomain.com/demo/index.html
> The proxy configuration in Apache will direct the connection to nodejs over
> port 8000.
>

Hi Darryl,

When I am trying to access the URL
https://nodejs.mydomain.com/demo/index.html, I am seeing the below
information in Apache HTTP server access logs.

172.16.16.45 - drupaladmin [21/Jun/2023:23:04:07 +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 [21/Jun/2023:23:04:18 +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 [21/Jun/2023:23:04:39 +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"


Please suggest further. 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,

When I hit http://nodejs.mydomain.com:8000/demo/index.html (without ssl) it
works with port number using the below httpd config file. Is there a way to
enable SSL connections?

*httpd.conf file configuration*
#cat /etc/httpd/conf.d/nodejsnodejsssl.conf
<VirtualHost *:80>
<Location />
ProxyPass http://localhost:8000/
</Location>
</VirtualHost>

Please suggest further. Thanks in advance.


Best Regards,

Kaushal

On Wed, Jun 21, 2023 at 11:09?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

> On Wed, Jun 21, 2023 at 10:35?PM Darryl Baker <
> darryl.baker@northwestern.edu> wrote:
>
>> Have you tried browsing to https://nodejs.mydomain.com/demo/index.html
>> The proxy configuration in Apache will direct the connection to nodejs over
>> port 8000.
>>
>
> Hi Darryl,
>
> When I am trying to access the URL
> https://nodejs.mydomain.com/demo/index.html, I am seeing the below
> information in Apache HTTP server access logs.
>
> 172.16.16.45 - drupaladmin [21/Jun/2023:23:04:07 +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 [21/Jun/2023:23:04:18 +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 [21/Jun/2023:23:04:39 +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"
>
>
> Please suggest further. 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 ]
On Wed, Jun 21, 2023 at 1:45?PM Kaushal Shriyan
<kaushalshriyan@gmail.com> wrote:
>
> Hi,
>
> When I hit http://nodejs.mydomain.com:8000/demo/index.html (without ssl) it works with port number using the below httpd config file. Is there a way to enable SSL connections?
>
> httpd.conf file configuration
> #cat /etc/httpd/conf.d/nodejsnodejsssl.conf
> <VirtualHost *:80>
> <Location />
> ProxyPass http://localhost:8000/
> </Location>
> </VirtualHost>

You're not accessing Apache if you specify port 8000.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
I will be in meeting for the rest of the afternoon. Here is an anonymized version of my working configuration. Hope it helps.

The main URL is https://directory.uexample.com/search

nodejs is expacting /search

<VirtualHost *:443>
ServerName directory.example.com
ServerAlias hostnameaa.mid.example.com
ServerAlias hostnameab.mid.example.com

SSLEngine on

SSLCertificateFile /etc/httpd/certs/cert.pem
SSLCertificateKeyFile /etc/httpd/certs/cert.pem
SSLOptions +StdEnvVars

RewriteEngine On
LogLevel alert rewrite:trace6

CustomLog logs/nodejs_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

ErrorLog /var/log/httpd/nodejs_error.log
CustomLog /var/log/httpd/nodejs_access.log combined

DocumentRoot /var/www/iam-directory/dist

# RewriteRule ^/health-check-test.txt$ /public/health-check-test.txt
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

# When a request comes in, test to see if there's a matching static file in the "public" dir
RewriteCond %{DOCUMENT_ROOT}/public/%{REQUEST_URI} !-f

# If request does not include a static file, proxy it to the backend
RewriteRule ^(.*)$ http://localhost:8000$1 [P]

# Otherwise, add "public" to it (e.g., serve the file)
RewriteRule ^(.*)$ /public$1 [L]

</VirtualHost>


Darryl Baker, GSEC, GCLD (he/him/his)
Sr. System Administrator
Distributed Application Platform Services
Northwestern University
4th Floor
2020 Ridge Avenue
Evanston, IL 60208-0801
darryl.baker@northwestern.edu<mailto:darryl.baker@northwestern.edu>
(847) 467-6674<tel:+18474676674>

From: Kaushal Shriyan <kaushalshriyan@gmail.com>
Reply-To: Apache httpd Users <users@httpd.apache.org>
Date: Wednesday, June 21, 2023 at 12:40 PM
To: Apache httpd Users <users@httpd.apache.org>
Subject: Re: [users@httpd] node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.

On Wed, Jun 21, 2023 at 10:35?PM Darryl Baker <darryl.baker@northwestern.edu<mailto:darryl.baker@northwestern.edu>> wrote:
Have you tried browsing to https://nodejs.mydomain.com/demo/index.html<https://urldefense.com/v3/__https:/nodejs.mydomain.com/demo/index.html__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KSMzAkvQ$> The proxy configuration in Apache will direct the connection to nodejs over port 8000.

Hi Darryl,

When I am trying to access the URL https://nodejs.mydomain.com/demo/index.html<https://urldefense.com/v3/__https:/nodejs.mydomain.com/demo/index.html__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KSMzAkvQ$>, I am seeing the below information in Apache HTTP server access logs.

172.16.16.45 - drupaladmin [21/Jun/2023:23:04:07 +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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$> Safari/537.36"
172.16.16.45 - drupaladmin [21/Jun/2023:23:04:18 +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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$> Safari/537.36"
172.16.16.45 - drupaladmin [21/Jun/2023:23:04:39 +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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$> Safari/537.36"

Please suggest further. 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 ]
> Date: Wednesday, June 21, 2023 23:09:45 +0530
> From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>
> When I am trying to access the URL
> https://nodejs.mydomain.com/demo/index.html, I am seeing the below
> information in Apache HTTP server access logs.
>
> 172.16.16.45 - drupaladmin [21/Jun/2023:23:04:07 +0530] "GET
> /demo/index.html HTTP/1.1" *404* 25644 "-" "Mozilla/5.0

You need to look in the error log for the details the 404/not_found
error that is being returned.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
On 2023-06-21 18:57, Kaushal Shriyan wrote:
> Hi,
>
> I am running node.js application on port 8000 and Apache HTTP server on
> 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
> #
>
> _httpd.conf file configuration_
> #cat /etc/httpd/conf.d/nodejsnodejsssl.conf
> <VirtualHost *:443>
>     SSLEngine On
>     SSLProxyEngine On
>     ServerName nodejs.mydomain.com <http://nodejs.mydomain.com>
>     SSLCertificateFile
> /etc/letsencrypt/live/nodejs.mydomain.com/cert.pem
> <http://nodejs.mydomain.com/cert.pem>
>     SSLCertificateKeyFile
> /etc/letsencrypt/live/nodejs.mydomain.com/privkey.pem
> <http://nodejs.mydomain.com/privkey.pem>
>     SSLCertificateChainFile
> /etc/letsencrypt/live/nodejs.mydomain.com/chain.pem
> <http://nodejs.mydomain.com/chain.pem>
>     <Location />
>         ProxyPass http://localhost:8000/ <http://localhost:8000/>
>     </Location>
> </VirtualHost>
>
> When I am trying to access the URL
> https://nodejs.mydomain.com:8000/demo/index.html
> <https://nodejs.mydomain.com:8000/demo/index.html>, I am encountering
> the below error on the browser.
>
> This site can’t provide a secure connection
> nodejs.mydomain.com <http://nodejs.mydomain.com> sent an invalid response.
> ERR_SSL_PROTOCOL_ERROR
>
> Please comment if the above httpd conf file is incorrect or If i am
> missing anything. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>

There are inconsistencies in your configuration.
On one hand, you have "SSLProxyEngine On" which would imply that the
backend node.js application is running over TLS.
On the other hand, you are proxying to HTTP://, not HTTPS://, which is
what you would use for plain-text (not TLS) connections.

The options are mutually exclusive. Either you have TLS on node.js, and
should proxy to https://localhost:8000 or you do not, and you shouldn't
have "SSLProxyEngine On" defined.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Hi Daniel,

Please refer to the below details

$ npm start

> api-console@6.6.32 start
> node demo/index.js

Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly:
https://github.com/browserslist/update-db#readme
es-dev-server started on http://localhost:8000
Serving files from '/var/www/html/api-console'.
Opening browser on '/demo/'
Using history API fallback, redirecting route requests to
'/demo/index.html'
Using auto compatibility mode, transforming code on older browsers based
on user agent.

*httpd.conf file configuration*
#cat /etc/httpd/conf.d/nodejsnodejsssl.conf
<VirtualHost *:443>
SSLEngine On
ServerName nodejs.mydomain.com
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
<Location />
ProxyPass http://localhost:8000/
</Location>
</VirtualHost>

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"

Please suggest further. 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 ]
> 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.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
> 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
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
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
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
On Sun, Jun 25, 2023 at 7:44?AM 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
>
>
Hi,

Further to the earlier post, do i need to specify documentroot in
/etc/httpd/conf.d/nodejsbackendssl.conf file to render index.html file
based on httpd access log file /var/log/httpd/access_log ?

*cat /etc/httpd/conf.d/nodejsbackendssl.conf*
<VirtualHost *:80>
DocumentRoot /var/www/html/web/demo
<Location />
ProxyPass http://localhost:8000/
</Location>
</VirtualHost>

#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"

Please suggest 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 ]
If you proxy all requests to another host, you do not need a DocumentRoot,
no. Also, do avoid using a <Location> block to proxy requests, and instead
just use ProxyPass / http://localhost:8000/

On Sun, Jun 25, 2023 at 12:44?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

>
>
> On Sun, Jun 25, 2023 at 7:44?AM 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
>>
>>
> Hi,
>
> Further to the earlier post, do i need to specify documentroot in
> /etc/httpd/conf.d/nodejsbackendssl.conf file to render index.html file
> based on httpd access log file /var/log/httpd/access_log ?
>
> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
> <VirtualHost *:80>
> DocumentRoot /var/www/html/web/demo
> <Location />
> ProxyPass http://localhost:8000/
> </Location>
> </VirtualHost>
>
> #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"
>
> Please suggest 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 ]
On Sun, Jun 25, 2023 at 10:40?AM Frank Gingras <thumbs@apache.org> wrote:

> If you proxy all requests to another host, you do not need a DocumentRoot,
> no. Also, do avoid using a <Location> block to proxy requests, and instead
> just use ProxyPass / http://localhost:8000/
>
>
Hi Frank,

Thanks for the email response. I am still encountering 404 as per the below
http access log.

172.16.16.45 - drupaladmin [25/Jun/2023:12:17:40 +0530] "GET
/demo/element/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 [25/Jun/2023:12:18:15 +0530] "GET
/demo/element/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"

*cat /etc/httpd/conf.d/nodejsbackendssl.conf*
<VirtualHost *:80>
ProxyPass / http://localhost:8000/
</VirtualHost>
#

Please suggest and guide me. Thanks in advance.

Best Regards,

Kaushal





> On Sun, Jun 25, 2023 at 12:44?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>>
>>
>> On Sun, Jun 25, 2023 at 7:44?AM 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
>>>
>>>
>> Hi,
>>
>> Further to the earlier post, do i need to specify documentroot in
>> /etc/httpd/conf.d/nodejsbackendssl.conf file to render index.html file
>> based on httpd access log file /var/log/httpd/access_log ?
>>
>> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>> <VirtualHost *:80>
>> DocumentRoot /var/www/html/web/demo
>> <Location />
>> ProxyPass http://localhost:8000/
>> </Location>
>> </VirtualHost>
>>
>> #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"
>>
>> Please suggest 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 ]
Why did you define a vhost without a ServerName directive?

Also, those access log entries are quite useless, other than the requested
path. Increase the log level, and find the error log entries instead.

On Sun, Jun 25, 2023 at 2:54?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

>
>
> On Sun, Jun 25, 2023 at 10:40?AM Frank Gingras <thumbs@apache.org> wrote:
>
>> If you proxy all requests to another host, you do not need a
>> DocumentRoot, no. Also, do avoid using a <Location> block to proxy
>> requests, and instead just use ProxyPass / http://localhost:8000/
>>
>>
> Hi Frank,
>
> Thanks for the email response. I am still encountering 404 as per the
> below http access log.
>
> 172.16.16.45 - drupaladmin [25/Jun/2023:12:17:40 +0530] "GET
> /demo/element/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 [25/Jun/2023:12:18:15 +0530] "GET
> /demo/element/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"
>
> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
> <VirtualHost *:80>
> ProxyPass / http://localhost:8000/
> </VirtualHost>
> #
>
> Please suggest and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
>
>
>
>
>> On Sun, Jun 25, 2023 at 12:44?AM Kaushal Shriyan <
>> kaushalshriyan@gmail.com> wrote:
>>
>>>
>>>
>>> On Sun, Jun 25, 2023 at 7:44?AM 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
>>>>
>>>>
>>> Hi,
>>>
>>> Further to the earlier post, do i need to specify documentroot in
>>> /etc/httpd/conf.d/nodejsbackendssl.conf file to render index.html file
>>> based on httpd access log file /var/log/httpd/access_log ?
>>>
>>> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>>> <VirtualHost *:80>
>>> DocumentRoot /var/www/html/web/demo
>>> <Location />
>>> ProxyPass http://localhost:8000/
>>> </Location>
>>> </VirtualHost>
>>>
>>> #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"
>>>
>>> Please suggest 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,

I have modified the nodejsbackendssl.conf file located
in /etc/httpd/conf.d/ to the below configuration.

*#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
<VirtualHost *:80>
ServerName nodejs.mydomain.com
ProxyPass / http://localhost:8000/
LogLevel debug
ErrorLog /var/log/httpd/nodejssslerror.log
CustomLog /var/log/httpd/nodejssslaccess.log combined
</VirtualHost>

Below are the logs in /var/log/httpd/nodejssslerror.log

[Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:40.289261 2023] [proxy:debug] [pid 6223:tid 6223]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:40.289281 2023] [proxy:debug] [pid 6223:tid 6223]
> proxy_util.c(2247): AH00930: initialized pool in child 6223 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:41.296927 2023] [proxy:debug] [pid 6228:tid 6228]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:41.297078 2023] [proxy:debug] [pid 6228:tid 6228]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:41.297120 2023] [proxy:debug] [pid 6228:tid 6228]
> proxy_util.c(2247): AH00930: initialized pool in child 6228 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:41.300665 2023] [proxy:debug] [pid 6227:tid 6227]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:41.300826 2023] [proxy:debug] [pid 6227:tid 6227]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:41.300874 2023] [proxy:debug] [pid 6227:tid 6227]
> proxy_util.c(2247): AH00930: initialized pool in child 6227 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:42.308374 2023] [proxy:debug] [pid 6233:tid 6233]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:42.308496 2023] [proxy:debug] [pid 6233:tid 6233]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:42.308533 2023] [proxy:debug] [pid 6233:tid 6233]
> proxy_util.c(2247): AH00930: initialized pool in child 6233 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:42.315943 2023] [proxy:debug] [pid 6237:tid 6237]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:42.316046 2023] [proxy:debug] [pid 6237:tid 6237]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:42.316107 2023] [proxy:debug] [pid 6237:tid 6237]
> proxy_util.c(2247): AH00930: initialized pool in child 6237 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:42.319277 2023] [proxy:debug] [pid 6234:tid 6234]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:42.319388 2023] [proxy:debug] [pid 6234:tid 6234]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:42.319473 2023] [proxy:debug] [pid 6234:tid 6234]
> proxy_util.c(2247): AH00930: initialized pool in child 6234 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:04:42.321555 2023] [proxy:debug] [pid 6240:tid 6240]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:04:42.321774 2023] [proxy:debug] [pid 6240:tid 6240]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:04:42.321858 2023] [proxy:debug] [pid 6240:tid 6240]
> proxy_util.c(2247): AH00930: initialized pool in child 6240 for
> (localhost:8000) min=0 max=4 smax=4
> [Sun Jun 25 16:05:23.369794 2023] [proxy:debug] [pid 6247:tid 6247]
> proxy_util.c(2155): AH00925: initializing worker http://localhost:8000/
> shared
> [Sun Jun 25 16:05:23.369988 2023] [proxy:debug] [pid 6247:tid 6247]
> proxy_util.c(2215): AH00927: initializing worker http://localhost:8000/
> local
> [Sun Jun 25 16:05:23.370029 2023] [proxy:debug] [pid 6247:tid 6247]
> proxy_util.c(2247): AH00930: initialized pool in child 6247 for
> (localhost:8000) min=0 max=4 smax=4
>

Please suggest and guide me. Thanks in advance.

Best Regards,

Kaushal




On Sun, Jun 25, 2023 at 12:35?PM Frank Gingras <thumbs@apache.org> wrote:

> Why did you define a vhost without a ServerName directive?
>
> Also, those access log entries are quite useless, other than the requested
> path. Increase the log level, and find the error log entries instead.
>
> On Sun, Jun 25, 2023 at 2:54?AM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>>
>>
>> On Sun, Jun 25, 2023 at 10:40?AM Frank Gingras <thumbs@apache.org> wrote:
>>
>>> If you proxy all requests to another host, you do not need a
>>> DocumentRoot, no. Also, do avoid using a <Location> block to proxy
>>> requests, and instead just use ProxyPass / http://localhost:8000/
>>>
>>>
>> Hi Frank,
>>
>> Thanks for the email response. I am still encountering 404 as per the
>> below http access log.
>>
>> 172.16.16.45 - drupaladmin [25/Jun/2023:12:17:40 +0530] "GET
>> /demo/element/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 [25/Jun/2023:12:18:15 +0530] "GET
>> /demo/element/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"
>>
>> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>> <VirtualHost *:80>
>> ProxyPass / http://localhost:8000/
>> </VirtualHost>
>> #
>>
>> Please suggest and guide me. Thanks in advance.
>>
>> Best Regards,
>>
>> Kaushal
>>
>>
>>
>>
>>
>>> On Sun, Jun 25, 2023 at 12:44?AM Kaushal Shriyan <
>>> kaushalshriyan@gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Sun, Jun 25, 2023 at 7:44?AM 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
>>>>>
>>>>>
>>>> Hi,
>>>>
>>>> Further to the earlier post, do i need to specify documentroot in
>>>> /etc/httpd/conf.d/nodejsbackendssl.conf file to render index.html file
>>>> based on httpd access log file /var/log/httpd/access_log ?
>>>>
>>>> *cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>>>> <VirtualHost *:80>
>>>> DocumentRoot /var/www/html/web/demo
>>>> <Location />
>>>> ProxyPass http://localhost:8000/
>>>> </Location>
>>>> </VirtualHost>
>>>>
>>>> #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"
>>>>
>>>> Please suggest 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 ]
> Date: Sunday, June 25, 2023 16:09:23 +0530
> From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>
> I have modified the nodejsbackendssl.conf file located
> in /etc/httpd/conf.d/ to the below configuration.
>
> *#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
> <VirtualHost *:80>
> ServerName nodejs.mydomain.com
> ProxyPass / http://localhost:8000/
> LogLevel debug
> ErrorLog /var/log/httpd/nodejssslerror.log
> CustomLog /var/log/httpd/nodejssslaccess.log combined
> </VirtualHost>
>
> Below are the logs in /var/log/httpd/nodejssslerror.log
>
> [Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
>> proxy_util.c(2155): AH00925: initializing worker
>> http://localhost:8000/ shared

If you are still getting errors (e.g., 404s) on the front-end please
provide the relevant lines from the front-end server's error_log. The
proxy's corresponding log entries may be of value, but without the
detail from the front-end it's hard to tell.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
None of those entries point to your 404 error.

Make sure that you are reaching the proper vhost (with the scheme and
hostname) by running apachectl -S.

There is just far too much noise in the backlog of this thread to make
sense of it so far.

On Sun, Jun 25, 2023 at 11:46?AM Richard <lists-apache@listmail.innovate.net>
wrote:

>
>
>
> > Date: Sunday, June 25, 2023 16:09:23 +0530
> > From: Kaushal Shriyan <kaushalshriyan@gmail.com>
> >
> > I have modified the nodejsbackendssl.conf file located
> > in /etc/httpd/conf.d/ to the below configuration.
> >
> > *#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
> > <VirtualHost *:80>
> > ServerName nodejs.mydomain.com
> > ProxyPass / http://localhost:8000/
> > LogLevel debug
> > ErrorLog /var/log/httpd/nodejssslerror.log
> > CustomLog /var/log/httpd/nodejssslaccess.log combined
> > </VirtualHost>
> >
> > Below are the logs in /var/log/httpd/nodejssslerror.log
> >
> > [Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
> >> proxy_util.c(2155): AH00925: initializing worker
> >> http://localhost:8000/ shared
>
> If you are still getting errors (e.g., 404s) on the front-end please
> provide the relevant lines from the front-end server's error_log. The
> proxy's corresponding log entries may be of value, but without the
> detail from the front-end it's hard to tell.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
Hi,

I have set up a new server with the below details. I am running node.js
application on port 3000 and Apache HTTP server on 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
#

*Nodejs code document root -> /var/www/html/nodejssl (Node Port 3000)*
# pwd
/var/www/html/nodejssl
# ls -l
-rw-r--r-- 1 root root 336 Jun 27 09:43 server.js
#
*cat server.js*
const http = require('http');

const hostname = '0.0.0.0';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});


*Website php code document root -> /var/www/html/phpcode (Port 443)*

#pwd
/var/www/html/phpcode/
# ls -l
-rw-r--r-- 1 root root 336 Jun 27 09:43 index.html
#
#cat index.html
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Hello!</title>
</head>

<body>
<h1>Hello World!</h1>
<p>This is a simple paragraph.</p>
</body>

</html>

#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/phpcode
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 / http://localhost:3000/
</VirtualHost>

When i hit https://phpnodejs.mydomain.com/nodejssl/server.js I see "Hello
World" which works as expected but when i hit
https://phpnodejs.mydomain.com/ I do not see the html code index.html file
content. Is there a way to render both index.html and node.js server.js
file? For example when i hit https://phpnodejs.mydomain.com/ it renders
index.html file content and when i hit
https://phpnodejs.mydomain.com/nodejssl/server.js it renders node.js
server.js file content.

Please suggest and guide me. Thanks in advance.

Best Regards,

Kaushal

On Sun, Jun 25, 2023 at 10:13?PM Frank Gingras <thumbs@apache.org> wrote:

> None of those entries point to your 404 error.
>
> Make sure that you are reaching the proper vhost (with the scheme and
> hostname) by running apachectl -S.
>
> There is just far too much noise in the backlog of this thread to make
> sense of it so far.
>
> On Sun, Jun 25, 2023 at 11:46?AM Richard <
> lists-apache@listmail.innovate.net> wrote:
>
>>
>>
>>
>> > Date: Sunday, June 25, 2023 16:09:23 +0530
>> > From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>> >
>> > I have modified the nodejsbackendssl.conf file located
>> > in /etc/httpd/conf.d/ to the below configuration.
>> >
>> > *#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>> > <VirtualHost *:80>
>> > ServerName nodejs.mydomain.com
>> > ProxyPass / http://localhost:8000/
>> > LogLevel debug
>> > ErrorLog /var/log/httpd/nodejssslerror.log
>> > CustomLog /var/log/httpd/nodejssslaccess.log combined
>> > </VirtualHost>
>> >
>> > Below are the logs in /var/log/httpd/nodejssslerror.log
>> >
>> > [Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
>> >> proxy_util.c(2155): AH00925: initializing worker
>> >> http://localhost:8000/ shared
>>
>> If you are still getting errors (e.g., 404s) on the front-end please
>> provide the relevant lines from the front-end server's error_log. The
>> proxy's corresponding log entries may be of value, but without the
>> detail from the front-end it's hard to tell.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
To exclude index.html from your proxying, use ProxyPass /index.html !
before the existing ProxyPass directive.

On Fri, Jun 30, 2023 at 1:24?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
wrote:

> Hi,
>
> I have set up a new server with the below details. I am running node.js
> application on port 3000 and Apache HTTP server on 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
> #
>
> *Nodejs code document root -> /var/www/html/nodejssl (Node Port 3000)*
> # pwd
> /var/www/html/nodejssl
> # ls -l
> -rw-r--r-- 1 root root 336 Jun 27 09:43 server.js
> #
> *cat server.js*
> const http = require('http');
>
> const hostname = '0.0.0.0';
> const port = 3000;
>
> const server = http.createServer((req, res) => {
> res.statusCode = 200;
> res.setHeader('Content-Type', 'text/plain');
> res.end('Hello World');
> });
>
> server.listen(port, hostname, () => {
> console.log(`Server running at http://${hostname}:${port}/`);
> });
>
>
> *Website php code document root -> /var/www/html/phpcode (Port 443)*
>
> #pwd
> /var/www/html/phpcode/
> # ls -l
> -rw-r--r-- 1 root root 336 Jun 27 09:43 index.html
> #
> #cat index.html
> <!DOCTYPE html>
> <html lang="en">
>
> <head>
> <meta charset="UTF-8">
> <title>Hello!</title>
> </head>
>
> <body>
> <h1>Hello World!</h1>
> <p>This is a simple paragraph.</p>
> </body>
>
> </html>
>
> #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/phpcode
> 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 / http://localhost:3000/
> </VirtualHost>
>
> When i hit https://phpnodejs.mydomain.com/nodejssl/server.js I see "Hello
> World" which works as expected but when i hit
> https://phpnodejs.mydomain.com/ I do not see the html code index.html
> file content. Is there a way to render both index.html and node.js
> server.js file? For example when i hit https://phpnodejs.mydomain.com/ it
> renders index.html file content and when i hit
> https://phpnodejs.mydomain.com/nodejssl/server.js it renders node.js
> server.js file content.
>
> Please suggest and guide me. Thanks in advance.
>
> Best Regards,
>
> Kaushal
>
> On Sun, Jun 25, 2023 at 10:13?PM Frank Gingras <thumbs@apache.org> wrote:
>
>> None of those entries point to your 404 error.
>>
>> Make sure that you are reaching the proper vhost (with the scheme and
>> hostname) by running apachectl -S.
>>
>> There is just far too much noise in the backlog of this thread to make
>> sense of it so far.
>>
>> On Sun, Jun 25, 2023 at 11:46?AM Richard <
>> lists-apache@listmail.innovate.net> wrote:
>>
>>>
>>>
>>>
>>> > Date: Sunday, June 25, 2023 16:09:23 +0530
>>> > From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>>> >
>>> > I have modified the nodejsbackendssl.conf file located
>>> > in /etc/httpd/conf.d/ to the below configuration.
>>> >
>>> > *#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>>> > <VirtualHost *:80>
>>> > ServerName nodejs.mydomain.com
>>> > ProxyPass / http://localhost:8000/
>>> > LogLevel debug
>>> > ErrorLog /var/log/httpd/nodejssslerror.log
>>> > CustomLog /var/log/httpd/nodejssslaccess.log combined
>>> > </VirtualHost>
>>> >
>>> > Below are the logs in /var/log/httpd/nodejssslerror.log
>>> >
>>> > [Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
>>> >> proxy_util.c(2155): AH00925: initializing worker
>>> >> http://localhost:8000/ shared
>>>
>>> If you are still getting errors (e.g., 404s) on the front-end please
>>> provide the relevant lines from the front-end server's error_log. The
>>> proxy's corresponding log entries may be of value, but without the
>>> detail from the front-end it's hard to tell.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
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 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


On Sat, Jul 1, 2023 at 2:08?AM Frank Gingras <thumbs@apache.org> wrote:

> To exclude index.html from your proxying, use ProxyPass /index.html !
> before the existing ProxyPass directive.
>
> On Fri, Jun 30, 2023 at 1:24?PM Kaushal Shriyan <kaushalshriyan@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have set up a new server with the below details. I am running node.js
>> application on port 3000 and Apache HTTP server on 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
>> #
>>
>> *Nodejs code document root -> /var/www/html/nodejssl (Node Port 3000)*
>> # pwd
>> /var/www/html/nodejssl
>> # ls -l
>> -rw-r--r-- 1 root root 336 Jun 27 09:43 server.js
>> #
>> *cat server.js*
>> const http = require('http');
>>
>> const hostname = '0.0.0.0';
>> const port = 3000;
>>
>> const server = http.createServer((req, res) => {
>> res.statusCode = 200;
>> res.setHeader('Content-Type', 'text/plain');
>> res.end('Hello World');
>> });
>>
>> server.listen(port, hostname, () => {
>> console.log(`Server running at http://${hostname}:${port}/`);
>> });
>>
>>
>> *Website php code document root -> /var/www/html/phpcode (Port 443)*
>>
>> #pwd
>> /var/www/html/phpcode/
>> # ls -l
>> -rw-r--r-- 1 root root 336 Jun 27 09:43 index.html
>> #
>> #cat index.html
>> <!DOCTYPE html>
>> <html lang="en">
>>
>> <head>
>> <meta charset="UTF-8">
>> <title>Hello!</title>
>> </head>
>>
>> <body>
>> <h1>Hello World!</h1>
>> <p>This is a simple paragraph.</p>
>> </body>
>>
>> </html>
>>
>> #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/phpcode
>> 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 / http://localhost:3000/
>> </VirtualHost>
>>
>> When i hit https://phpnodejs.mydomain.com/nodejssl/server.js I see
>> "Hello World" which works as expected but when i hit
>> https://phpnodejs.mydomain.com/ I do not see the html code index.html
>> file content. Is there a way to render both index.html and node.js
>> server.js file? For example when i hit https://phpnodejs.mydomain.com/
>> it renders index.html file content and when i hit
>> https://phpnodejs.mydomain.com/nodejssl/server.js it renders node.js
>> server.js file content.
>>
>> Please suggest and guide me. Thanks in advance.
>>
>> Best Regards,
>>
>> Kaushal
>>
>> On Sun, Jun 25, 2023 at 10:13?PM Frank Gingras <thumbs@apache.org> wrote:
>>
>>> None of those entries point to your 404 error.
>>>
>>> Make sure that you are reaching the proper vhost (with the scheme and
>>> hostname) by running apachectl -S.
>>>
>>> There is just far too much noise in the backlog of this thread to make
>>> sense of it so far.
>>>
>>> On Sun, Jun 25, 2023 at 11:46?AM Richard <
>>> lists-apache@listmail.innovate.net> wrote:
>>>
>>>>
>>>>
>>>>
>>>> > Date: Sunday, June 25, 2023 16:09:23 +0530
>>>> > From: Kaushal Shriyan <kaushalshriyan@gmail.com>
>>>> >
>>>> > I have modified the nodejsbackendssl.conf file located
>>>> > in /etc/httpd/conf.d/ to the below configuration.
>>>> >
>>>> > *#cat /etc/httpd/conf.d/nodejsbackendssl.conf*
>>>> > <VirtualHost *:80>
>>>> > ServerName nodejs.mydomain.com
>>>> > ProxyPass / http://localhost:8000/
>>>> > LogLevel debug
>>>> > ErrorLog /var/log/httpd/nodejssslerror.log
>>>> > CustomLog /var/log/httpd/nodejssslaccess.log combined
>>>> > </VirtualHost>
>>>> >
>>>> > Below are the logs in /var/log/httpd/nodejssslerror.log
>>>> >
>>>> > [Sun Jun 25 16:04:40.289171 2023] [proxy:debug] [pid 6223:tid 6223]
>>>> >> proxy_util.c(2155): AH00925: initializing worker
>>>> >> http://localhost:8000/ shared
>>>>
>>>> If you are still getting errors (e.g., 404s) on the front-end please
>>>> provide the relevant lines from the front-end server's error_log. The
>>>> proxy's corresponding log entries may be of value, but without the
>>>> detail from the front-end it's hard to tell.
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>>
>>>>
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
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
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
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
Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser. [ In reply to ]
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

1 2  View All