apache question??

bruce badouglas at gmail.com
Wed Jul 24 10:53:40 UTC 2024


Hi Rob.

Thanks for the reply.

Have two/2 test ubuntu servers - digital ocean.

1st server contains the initial list of webapps to test.
Apps reside in /var/www/html/...
Apps have
 chown www-data:www-data
 chmod 755

The tgt app
 /var/www/html/berat

The vhosts reside
 /etc/apache2/sites-available
 berat.conf

The 2nd test srvr is a "clone" of the 1st. So the action/webapps
should run the same.

However, running into a weird issue.

The test "berat" uses a reverse proxy with a node app, to generate
content for the app.
When the node server isn't running, the app should display an err.

test srvr1

http://161.35.5.174/berat/
Index of /berat
[ICO]    Name    Last modified    Size    Description
[PARENTDIR]    Parent Directory         -
[TXT]    README.md    2024-07-21 22:20     1.0K
[DIR]    app/    2024-07-21 22:20     -
.
.
.

the dir listing, instead of the "err" statement


-from the 2nd server
http://198.211.116.12/berat
The server is temporarily unable to service your request due to
maintenance downtime or capacity problems. Please try again later.

the working srvr...

test srvr2


Initially I ran both tests from the "/var/www/html/berat" dir.

But due to the issue with having the "dir" index/listing, I started
trying to figure out why.

I copied/tested the 1st srvr to the /var/www/html2/berat, changing the
berat.conf vhost for the docroot/directory as a test process.

No diff, still get the dir ndx/listing.

At this point, took a closer look at the err log
  tail -50 /var/log/apache/error.log

And I see a diff. -- don't know why, or what it means::

tst srvr1: --err
[Wed Jul 24 07:44:05.039030 2024] [mpm_prefork:notice] [pid 192785]
AH00163: Apache/2.4.58 (Ubuntu) configured -- resuming normal
operations
[Wed Jul 24 07:44:05.039068 2024] [core:notice] [pid 192785] AH00094:
Command line: '/usr/sbin/apache2'
[Wed Jul 24 07:44:05.048560 2024] [proxy:debug] [pid 198793]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:44:05.048620 2024] [proxy:debug] [pid 198793]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:44:05.048677 2024] [proxy:debug] [pid 198793]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 198793 for (127.0.0.1:3000)
[Wed Jul 24 07:44:05.050566 2024] [proxy:debug] [pid 198794]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:44:05.050610 2024] [proxy:debug] [pid 198794]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:44:05.050665 2024] [proxy:debug] [pid 198794]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 198794 for (127.0.0.1:3000)
[Wed Jul 24 07:44:05.056574 2024] [proxy:debug] [pid 198795]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:44:05.056618 2024] [proxy:debug] [pid 198795]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:44:05.056671 2024] [proxy:debug] [pid 198795]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 198795 for (127.0.0.1:3000)
[Wed Jul 24 07:44:05.061509 2024] [proxy:debug] [pid 198796]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:44:05.061550 2024] [proxy:debug] [pid 198796]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:44:05.061593 2024] [proxy:debug] [pid 198796]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 198796 for (127.0.0.1:3000)
[Wed Jul 24 07:44:05.062739 2024] [proxy:debug] [pid 198797]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:44:05.062771 2024] [proxy:debug] [pid 198797]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:44:05.062814 2024] [proxy:debug] [pid 198797]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 198797 for (127.0.0.1:3000)
[Wed Jul 24 07:44:45.362991 2024] [authz_core:debug] [pid 198795]
mod_authz_core.c(815): [client 162.234.196.167:57200] AH01626:
authorization result of Require all granted: granted
*********<<<<<<<<
[Wed Jul 24 07:44:45.363050 2024] [authz_core:debug] [pid 198795]
mod_authz_core.c(815): [client 162.234.196.167:57200] AH01626:
authorization result of <RequireAny>: granted
[Wed Jul 24 07:44:45.363391 2024] [authz_core:debug] [pid 198795]
mod_authz_core.c(815): [client 162.234.196.167:57200] AH01626:
authorization result of Require all granted: granted
[Wed Jul 24 07:44:45.363499 2024] [authz_core:debug] [pid 198795]
mod_authz_core.c(815): [client 162.234.196.167:57200] AH01626:
authorization result of <RequireAny>: granted



tst srvr2: --working
[Wed Jul 24 07:42:58.603344 2024] [mpm_prefork:notice] [pid 91665]
AH00163: Apache/2.4.58 (Ubuntu) configured -- resuming normal
operations
[Wed Jul 24 07:42:58.603420 2024] [core:notice] [pid 91665] AH00094:
Command line: '/usr/sbin/apache2'
[Wed Jul 24 07:42:58.605463 2024] [proxy:debug] [pid 91670]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:42:58.605510 2024] [proxy:debug] [pid 91670]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:42:58.605546 2024] [proxy:debug] [pid 91670]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 91670 for (127.0.0.1:3000)
[Wed Jul 24 07:42:58.607920 2024] [proxy:debug] [pid 91671]
proxy_util.c(2154): AH00925: initializing worker
http://127.0.0.1:3000/ shared
[Wed Jul 24 07:42:58.607954 2024] [proxy:debug] [pid 91671]
proxy_util.c(2214): AH00927: initializing worker
http://127.0.0.1:3000/ local
[Wed Jul 24 07:42:58.607989 2024] [proxy:debug] [pid 91671]
proxy_util.c(2262): AH00931: initialized single connection worker in
child 91671 for (127.0.0.1:3000)
[Wed Jul 24 07:43:03.630662 2024] [authz_core:debug] [pid 91667]
mod_authz_core.c(843): [client 162.234.196.167:46026] AH01628:
authorization result: granted (no directives)  *************<<<<<<
[Wed Jul 24 07:43:03.630780 2024] [proxy:debug] [pid 91667]
mod_proxy.c(1521): [client 162.234.196.167:46026] AH01143: Running
scheme http handler (attempt 0)
[Wed Jul 24 07:43:03.630789 2024] [proxy:debug] [pid 91667]
proxy_util.c(2576): AH00942: http: has acquired connection for
(127.0.0.1:3000)
[Wed Jul 24 07:43:03.630796 2024] [proxy:debug] [pid 91667]
proxy_util.c(2641): [client 162.234.196.167:46026] AH00944: connecting
http://127.0.0.1:3000/ to 127.0.0.1:3000
[Wed Jul 24 07:43:03.630940 2024] [proxy:debug] [pid 91667]
proxy_util.c(2864): [client 162.234.196.167:46026] AH00947: connected
/ to 127.0.0.1:3000



the test vhost is
 (docroot/dir is diff based on testing in the dirs)
<VirtualHost *:80>
    ServerAdmin foo at yahoo.com
    ServerName  temp22
    ServerAlias temp
#
# as test.. run from html2
# all other apps are in html
# this is the same as the "clone" vhost
    DocumentRoot   /var/www/html2/berat

    #test for styles..
    #does order matter??? -- the actual ip is used to test..

     #ProxyPass /_next/static/   http://198.211.116.12/berat/.next/static/
     #ProxyPassReverse /_next/static   http://198.211.116.12/berat/.next/static/


#a     ProxyPass /_next/static/css
http://198.211.116.12/berat/.next/static/css/
#a     ProxyPassReverse /_next/static/css
http://198.211.116.12/berat/.next/static/css/

#a     ProxyPass /_next/static/chunks/app/
http://198.211.116.12/berat/.next/static/chunks/app/
#a     ProxyPassReverse /_next/static/chunks/app
http://198.211.116.12/berat/.next/static/chunks/app/

#a     ProxyPass /_next/static/chunks/
http://198.211.116.12/berat/.next/static/chunks/
#a     ProxyPassReverse /_next/static/chunks
http://198.211.116.12/berat/.next/static/chunks/

#a     ProxyPass /_next/static/media/
http://198.211.116.12/berat/.next/static/media/
#a     ProxyPassReverse /_next/static/media
http://198.211.116.12/berat/.next/static/media/

     #ProxyPass http://161.35.5.174/down.svg
http://161.35.5.174/berat/public/down.svg
     #ProxyPassReverse http://161.35.5.174/down.svg
http://161.35.5.174/berat/public/down.svg

#a     ProxyPass "/down.svg"   http://161.35.5.174/berat/public/down.svg
#a     ProxyPassReverse "/down.svg"   http://161.35.5.174/berat/public/down.svg

#a     ProxyPass "/logo.svg"   http://161.35.5.174/berat/public/logo.svg
#a     ProxyPassReverse "/logo.svg"  http://161.35.5.174/berat/public/logo.svg

     #ProxyPass "/_next/image"   http://161.35.5.174/berat/.next/image
     #ProxyPassReverse "/_next/image"   http://161.35.5.174/berat/.next/image


#aa     ProxyPass /_next/image/    http://161.35.5.174/berat/public/hero1
#http://161.35.5.174/berat/public
#     ProxyPassReverse /_next/image/   http://161.35.5.174/berat/public/hero1
#http://161.35.5.174/berat/public


     #ProxyPass /   http://161.35.5.174/berat/public/
     #ProxyPassReverse /   http://161.35.5.174/berat/public/


#     ProxyPass "hero.jpg&w=640&q=75"   http://161.35.5.174/berat/public/hero1
#     ProxyPassReverse "hero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero1

#     ProxyPass /_next/image?url=/hero.jpg&w=1920&q=75
http://161.35.5.174/berat/public/hero2
#     ProxyPassReverse /_next/image?url=/hero.jpg&w=1920&q=75
http://161.35.5.174/berat/public/hero2

#     ProxyPass /_next/image?url=/hero.jpg&w=1080&q=75
http://161.35.5.174/berat/public/hero2
#     ProxyPassReverse /_next/image?url=/hero.jpg&w=1080&q=75
http://161.35.5.174/berat/public/hero2

#     ProxyPass "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1
#     ProxyPassReverse "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1

#     ProxyPass /_next/image?url=/hero.jpg&w=640&q=75
http://161.35.5.174/berat/public/hero2
#     ProxyPassReverse /_next/image?url=/hero.jpg&w=640&q=75
http://161.35.5.174/berat/public/hero2

#     ProxyPass "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1
#     ProxyPassReverse "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1

#     ProxyPass "/_next/image?url=/hero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero2
#     ProxyPassReverse "/_next/image?url=/hero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero2

#     ProxyPass "/_next/image?url=%2Fhero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero1
#     ProxyPassReverse "/_next/image?url=%2Fhero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero1

#a     ProxyPass /_next/image/   http://161.35.5.174/berat/publicfoo/
#a     ProxyPassReverse /_next/image   http://161.35.5.174/berat/publicfoo/

     #ProxyPass /_next/static/media/
http://161.35.5.174/berat/.next/static/media/
     #ProxyPassReverse /_next/static/media
http://161.35.5.174/berat/.next/static/media/


#     ProxyPass "/_next/image/"   qqqqq
#     ProxyPassReverse "/_next/image/"   qqqqq



#/_next/image?url=%2Fhero.jpg&w=750&q=75
# /_next/image?url=%2Fhero.jpg&w=1920&q=75
#/_next/image?url=%2Fhero.jpg&w=1920&q=75

#/_next/image?url=%2Fhero.jpg&w=640&q=75
#/_next/image?url=%2Fhero.jpg&w=1080&q=75

#      Substitute
"s|/_next/image?url=%2Fhero.jpg&w=750&q=75|http://161.35.5.174/berat/public/hero1|i"
#      Substitute
"s|/_next/image?url=%2Fhero.jpg&w=1920&q=75|http://161.35.5.174/berat/public/hero1|i"

#      ProxyHTMLEnable on

#      AddOutputFilterByType SUBSTITUTE text/html text/xml
text/javascript application/json
#a      Substitute "s|1920|77777|i"
#a      Substitute "s|648|64888|i"

#      Substitute "s|Ideal Experience|BBBBBBBBBBBB|i"


      #Substitute
"s|/_next/image?url=%2Fhero.jpg&w=640&q=75|http://161.35.5.174/berat/public/hero2|i"
      #Substitute
"s|/_next/image?url=\%2Fhero.jpg\&w=640\&q=75|http://161.35.5.174/berat/public/hero2|i"

#      Substitute
"s|/_next/image?url=%2Fhero.jpg&w=1080&q=75|http://161.35.5.174/berat/public/hero2|i"

      #Substitute "s|http://uat.site.co.jp/|http://jp.uat.site2uk.co.uk/|i"

#a      AddOutputFilterByType SUBSTITUTE text/html text/xml
text/javascript application/json

#test
 RewriteEngine On
#a RewriteCond %{HTTP:Connection} Upgrade [NC]
#a RewriteCond %{HTTP:Upgrade} websocket [NC]
#a RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]

#a      Substitute "s|1920|77777|i"
#a      Substitute "s|648|64888|i"


    #test for styles..

#ww     ProxyPass /berat http://127.0.0.1:3000/
#ww     ProxyPassReverse /berat http://127.0.0.1:3000/

##--- leave this alone.. it works jul22/24
## gets the 200 code for the content..
     ProxyPass /berat http://127.0.0.1:3000/
     ProxyPassReverse /berat http://127.0.0.1:3000/

#     ProxyPass /_next/static/chunks/
http://198.211.116.12/berat/.next/static/chunks/
#     ProxyPassReverse /_next/static/chunks
http://198.211.116.12/berat/.next/static/chunks/

#test

#ttest substitute below
 RewriteEngine On
    SetOutputFilter INFLATE;proxy-html;SUBSTITUTE;DEFLATE;
    ProxyHTMLInterp On
    ProxyHTMLExtended Off


      AddOutputFilterByType SUBSTITUTE text/html
#text/xml text/javascript application/json
      #Substitute "s|Ideal Experience|zz zz BBBBBBBBBBBB|"
      Substitute "s|/_next/static/|\.\./\.next/static/|"

     #Substitute "s|/_next/static/chunks|\.\./\.next/static/chunks|"
     #ProxyPass /_next/static/   http://198.211.116.12/berat/.next/static/

     #Substitute
"s|/_next/image?url=%2Fhero.jpg&w=640&q=75|http://161.35.5.174/berat/public/hero2|i"
#     Substitute
"s|/_next/image?url=\%2Fhero.jpg\&w=640\&q=75|\.\./public/hero2|i"

#      Substitute
"s|/_next/image?url=%2Fhero.jpg&w=750&q=75|http://161.35.5.174/berat/public/hero1|i"
#      Substitute
"s|/_next/image?url=\%2Fhero.jpg\&w=1920\&q=75|\.\./public/hero1|i"
      Substitute
"s|/_next/image\?url=\%2Fhero.jpg\&w=1920\&q=75|\.\./public/hero1|i"

#      Substitute
"s|/_next/image?url=\%2Fhero.jpg\&w=750\&q=75|\.\./public/hero1|i"
#      Substitute
"s|/_next/image?url=\%2Fhero.jpg\&w=1920\&q=75|\.\./public/hero1|i"

#http://198.211.116.12
#/_next/image?url=%2Fhero.jpg&w=1920&q=75


#EnableSendfile off
# test above

#a RewriteCond %{HTTP:Connection} Upgrade [NC]
#a RewriteCond %{HTTP:Upgrade} websocket [NC]
#a RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P,L]


#a      AddOutputFilterByType SUBSTITUTE text/html text/xml
text/javascript application/json
#a      Substitute "s|1920|7777744|i"
#a      Substitute "s|648|6488811|i"



#test2
     #ProxyPass /_next/image/    http://161.35.5.174/berat/public/hero1
#http://161.35.5.174/berat/public
     #ProxyPassReverse /_next/image/   http://161.35.5.174/berat/public/hero1
#http://161.35.5.174/berat/public


#     ProxyPass "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1
#     ProxyPassReverse "/_next/image?url=%2Fhero.jpg&w=750&q=75"
http://161.35.5.174/berat/public/hero1

#     ProxyPass "/_next/image?url=/hero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero2
#     ProxyPassReverse "/_next/image?url=/hero.jpg&w=640&q=75"
http://161.35.5.174/berat/public/hero2



    #DocumentRoot   /var/www/html/berat


    <Directory    /var/www/html2/berat>

  Header Set Pragma "no-cache"
  Header Set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
  Header Set Cache-Control "max-age=0, no-store, no-cache, must-revalidate"
  Header Unset ETag
  FileETag None

            #ProxyRequests Off
            #ProxyPreserveHost On
            #<Proxy *>
            #  Require all granted
            #</Proxy>

            #ProxyPass / http://127.0.0.1:3000/

            #ProxyPassReverse / http://127.0.0.1:3000/

    #        DirectoryIndex index.html index.php

    #        Options -Indexes +FollowSymLinks +MultiViews
            Options +FollowSymLinks   +MultiViews

            AllowOverride All
            #Options -MultiViews
            #i think or 2.4 Order allow,deny
            #i think for 2.4 Allow from all

            #use for 2.4?
            Require all granted
            ##Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All Require all granted


            ##Options Indexes FollowSymLinks MultiViews
            ##Options -Indexes FollowSymlinks
            #Options FollowSymlinks
            #AllowOverride All
            ##Order allow,deny
            ##allow from all
            #Require all granted




    </Directory>

    ##Alias "/berat" "/var/www/html/berat/"


    LogLevel debug
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


as far as I can determine, the enabled/installed mods for apache are
the same on both systems.


any thoughts/comments for why the test servers would have diff
displays for same code?

the url(s) is actual test servers


On Tue, Jul 23, 2024 at 7:23 PM Robert Heller <heller at deepsoft.com> wrote:
>
> What is in /var/log/apache2/error_log?
>
>
> Wild guess: compare /etc/apache2/mod-enabled and /etc/apache2/mod-available on
> both servers.
>
> At Tue, 23 Jul 2024 18:44:55 -0400 "Ubuntu user technical support,? not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:
>
> >
> > Might be the best place to post.. but I'll give it a shot.
> >
> > Two more or less test servers running ubuntu from digital ocean.
> > created 1st server, and then cloned it to test.
> >
> > Both have the same test apache setup/test webapps..
> >
> > So, both should more or less "work".
> >
> > However.. I'm getting different output from a test app, and can't
> > figure out why. Lots of research, testing, posting to a few different
> > sites. no luck as of yet.
> >
> >
> > ======================
> > http://198.211.116.12/berat
> > The server is temporarily unable to service your request due to
> > maintenance downtime or capacity problems. Please try again later.
> >
> > the working srvr...
> >
> > ------------------------------------------
> >
> > http://161.35.5.174/berat/
> > Index of /berat
> > [ICO]    Name    Last modified    Size    Description
> > [PARENTDIR]    Parent Directory         -
> > [TXT]    README.md    2024-07-21 22:20     1.0K
> > [DIR]    app/    2024-07-21 22:20     -
> > .
> > .
> > .
> >
> > the dir listing, instead of the "err" statement
> > -from the 2nd server
> >
> >
> > they should be the same output.
> >
> > the 2 systems are using the ipaddress as they're tmp servers..
> > ========================>
> > thoughts/comments...
> >
> > thanks
> >
>
> --
> Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
> Deepwoods Software        -- Custom Software Services
> http://www.deepsoft.com/  -- Linux Administration Services
> heller at deepsoft.com       -- Webhosting Services
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



More information about the ubuntu-users mailing list