Re: setting up/running apache reverse proxy/PM2 node server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all/Frank!

I've managed to "get" 2 different test sites running separately. They
each have different "vhost" config files. They each have different pm2
server port addresses

However, when I
  a2ensite berat_h chainsafe
  systemctl stop apache2
  systemctl start apache2
  and in each dir run the pm2 server to generate the display for the
test page/sites

  /var/www/html/berat
     pm2 start npm --name "waitlist-landing-page" -- start
    curl http://127.0.0.01:3000
   /var/www/html/chainsafe
     pm2 start npm --name "mlanding" -- start
    curl http://127.0.0.01:3001

data is present..

and as i said, when doing the above for one of the test sites at a
time, things appear to work..

when doing both, the 1st test site -- the "berat" works/displays.. But
the 2nd generates an err if the error.log
    [Sat Jul 27 22:45:43.549642 2024] [core:info] [pid 49527] [client
162.234.196.167:51832] AH00128: File does not exist:
/var/www/html/berat/chainsafe
    as if the "docroot/directory is combined???

the two vhosts, stripped down to relevant sections...

cat chainsafe.conf
<VirtualHost *:80>
    ServerAdmin foo@xxxxxxxxx
    ServerName  temp22cs
    ServerAlias tempcs

    DocumentRoot   /var/www/html/chainsafe


## gets the 200 code for the content..
     ProxyPass /chainsafe http://127.0.0.1:3001/
     ProxyPassReverse /chainsafe http://127.0.0.1:3001/


    <Directory    /var/www/html/chainsafe>

            Options -Indexes +FollowSymLinks

            AllowOverride None
            Require all granted
            #Require all granted
    </Directory>


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


\\\\\\\\\\\\\\\\\\\\\\\\\\\\

cat berat_h.conf

<VirtualHost *:80>
    ServerAdmin foo@xxxxxxxxx
    ServerName  temp223h
    ServerAlias temp3h

    DocumentRoot   /var/www/html/berat

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


## gets the 200 code for the content..
     ProxyPass /berat http://127.0.0.1:3000/
     ProxyPassReverse /berat http://127.0.0.1:3000/


    <Directory    /var/www/html/berat>

            Options  -Indexes +FollowSymLinks
            AllowOverride None
            Require all granted

    </Directory>

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

any thoughts/ideas??
 thanks


On Fri, Jul 26, 2024 at 6:50 PM Frank Gingras <thumbs@xxxxxxxxxx> wrote:
>
>
>
> On Fri, Jul 26, 2024 at 6:14 PM bruce <badouglas@xxxxxxxxx> wrote:
>>
>> Hi, for those who have followed my attempts, thanks. This is a trimmed
>> down attempt.
>>
>> Found some additional examples, and managed to get the following to
>> "work", once!
>>
>> Not sure why it stopped, but I now get a 403/Fobidden err. error.log
>> inspection shows
>> /////
>> Cannot serve directory /var/www/html/berat/: No matching
>> DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm)
>> found, and server-generated directory index forbidden by Options
>> directive
>> ////
>> Which is odd.. as the PM2 server doesn't create any of these file
>> types as far as I can tell.
>>
>> I think I did a
>>   "systemctl stop apache2"
>>    "systemctl start apache2"
>>   to test
>> and after the "start", the 403 was displayed.
>>
>> Here's the test vhost. The initial apache2.conf is the default with no changes.
>>
>> The test site that has the 403 is
>>  http://161.35.5.174/berat
>>
>> The working test site is..
>> http://198.211.116.12/berat
>>
>> the berat_h.conf file is
>> <VirtualHost *:80>
>>     ServerAdmin foo@xxxxxxxxx
>>     ServerName  temp223a
>>     ServerAlias temp3a
>> #
>> #https://medium.com/@unishubh1/production-ready-node-js-using-reverse-proxy-smartscribs-2cf95e58e002
>> #
>> # as test.. run from html2 berat_h
>> # all other apps are in html
>> # this is the same as the "clone" vhost
>> #jul25/24
>> #stripped out
>>     DocumentRoot   /var/www/html/berat
>>
>>     #test for styles..
>>     #does order matter??? -- the actual ip is used to test..
>>
>>
>>  #
>>
>>
>> #RewriteEngine On
>>
>>  #test frm web
>>  ProxyRequests Off
>>  ProxyPreserveHost On
>> ProxyVia Full
>>
>> ## gets the 200 code for the content..
>>      ProxyPass /berat http://127.0.0.1:3000/
>>      ProxyPassReverse /berat http://127.0.0.1:3000/
>>
>> #test
>>
>> #ttest substitute below
>>  #RewriteEngine On
>>     SetOutputFilter INFLATE;proxy-html;SUBSTITUTE;DEFLATE;
>>     ProxyHTMLInterp On
>>     ProxyHTMLExtended Off
>>
>>
>>       AddOutputFilterByType SUBSTITUTE text/html
>>       Substitute "s|/_next/static/|\.\./\.next/static/|"
>>
>> #      Substitute
>> "s|/_next/image?url=\%2Fhero.jpg\&w=1920\&q=75|\.\./public/hero1|i"
>>       Substitute
>> "s|/_next/image\?url=\%2Fhero.jpg\&amp;w=1920\&amp;q=75|\.\./public/hero1|i"
>>
>>
>> #EnableSendfile off
>> # test above
>>
>>
>>     #DocumentRoot   /var/www/html/berat
>>
>>
>>     <Directory    /var/www/html/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
>>
>>
>>     #        DirectoryIndex index.html index.php
>>
>>     #        Options -Indexes +FollowSymLinks +MultiViews
>>             Options  -Indexes +FollowSymLinks
>>
>>             #AllowOverride All
>>             AllowOverride None
>>             #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
>>
>>     </Directory>
>>
>>     LogLevel debug
>>     ErrorLog ${APACHE_LOG_DIR}/error.log
>>     CustomLog ${APACHE_LOG_DIR}/access.log combined
>> </VirtualHost>
>>
>> OK.. WTH!!!!
>>
>> Just retried the err srvr.. and the page is now showing...!!!
>> So something is happening that's not in the conf file?
>>
>> Could it be some cache thing? Some node/PM2 thing? Some timing thing?
>> Something else??
>>
>> I'm completely at a loss to explain this behaviour.
>>
>> thanks
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>
> You need to match the trailing slashes when proxying/redirecting.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux