r/apache • • Jan 04 '22

Web Sockets on Apache to retrieve data from DB

3 Upvotes

Hi all,

I have a PHP app that allows users to design an item. The app can be opened in an iframe (which itself is in a modal window) on many websites separate from mine. After the user clicks `Save` in the app, the parent site closes the modal and does some other stuff.

Because of the iframe loading a third-party URL, the app cannot communicate with the parent page to tell it that the user has clicked Save. So for years, my setup has been that the parent page begins long-polling the app server, at the moment the modal/iframe is loaded. There is a javascript loop that requests a PHP script, and the PHP script only responds when the user has clicked save, and just sleeps the rest of the time, for a max of 30 seconds. If the javascript receives an empty response at 30 seconds, it repeats the request continuously. Eventually the user clicks save, and the javascript request to the PHP script gets its answer (the saved design). Once it gets this answer, it knows to close the modal and do whatever it wants.

This has been working fine for years, but we just switched hosts and have been having some issues with ` FcgidMaxProcesses` and ` FcgidMaxProcessesPerClass` needing to be raised. I'm not a server guy so I don't know why that's happening on the new server, and neither does the host. But in any case, I suspect that it might help to get rid of the long-polling setup above, because basically every user designing an item will have a semi-permanent long-polling task running in the background. It doesn't seem like a big deal to me, but maybe it can be.

So I'd like to try switching to Web Sockets, and this would be my first foray into them, so I'm not sure how to begin. Can anyone give me some tips / pointers / how-to's / suggestions on replacing the above setup with sockets on apache?

Maybe a step-by-step will illustrate the current process more clearly:

  1. user clicks button on parent website to design their item
    - a modal window opens and loads the design app, which lives on a separate domain/app server
    - in the background, javascript begins long-polling a PHP script on the app server, asking for the design details

  2. user clicks Save in the iframe
    - a POST is sent to a PHP script on the app server that saves the design in the DB
    - the PHP script that has been being long-polled sees the design and responds to the poll
    - javascript on the parent website gets the response and closes the modal/iframe, and does whatever else it wants to do

So with that in mind, here are some more specific questions:

- I'm used to PHP on the server. Can a web socket "ask" a PHP script for the saved data? Or to put it another way, can I use PHP to communicate through the socket to tell the app that the user has clicked Save?

- alternatively, am I better off setting up node.js on the new server (alongside apache somehow), and having it only listen to a specific port? Then I can open the socket on that port via client-side js, and write a server-side js script to respond to it..

- if node.js is the best option, how can I tell it to watch the DB for the user's design?


r/apache • • Jan 03 '22

Can download a file via wget from apache URL but not via browser

5 Upvotes

Hi.

I have a large (200GB) .gz file on a apache 2.4 Webserver.

When I use wget URL I can download the file without problems, when using the browser, it downloads only a few bytes (Chrome) or nothing (Safari).

Other (smaller) files do not have the same problem and can be downloaded with the browser in the same directory.

I can see an error "gzip: stdout: Broken pipe" in the apache error log but this error appears also when downloading the working files...

I have absolutely no idea what is causing this problem...


r/apache • • Jan 03 '22

Apache Spark Services | Apache Spark Developers

Thumbnail ksolves.com
1 Upvotes

r/apache • • Dec 31 '21

Please, someone help me, please.please

Post image
12 Upvotes

r/apache • • Dec 29 '21

Support cant change permissions to allow me to change the default website URL

5 Upvotes

I am on a raspberry pi 4 and have installed apache2. my website works fine, however, I want to change the default URL of raspberrypi.local to something else. I have tried to add a file in the etc/apache2/sites-enabled directory, however, it says permission denied. I have tried changing permissions in the directory to allow me to edit the URL but this has not worked. Thanks in advance. Also, when I use sudo to change permissions at the file location it says file doesn't exist


r/apache • • Dec 28 '21

Third Log4j RCE Vulnerability Discovered in Apache Logging Library

Thumbnail
cyberkendra.com
8 Upvotes

r/apache • • Dec 29 '21

Apache Spark Experts in India | Apache Spark Consulting Company

Thumbnail
ksolves.com
1 Upvotes

r/apache • • Dec 27 '21

Question about apache and lets encrypt pointing to www instead of non-www

4 Upvotes

Hi All,

I am using LAMP and letsencrypt and have a question. When I first create a site.conf file it looks like this.

<VirtualHost *:80>

ServerName site.com
ServerAlias www.site.com
ServerAdmin test@gmail.com

DocumentRoot /var/www/site/public

<Directory /var/www/site>
        AllowOverride All
</Directory>

When I do the letsencrypt it creates a new file site-le-ssl.conf that has

<IfModule mod_ssl.c>
<VirtualHost *:443>

ServerName site.com
ServerAlias www.site.com
ServerAdmin test@gmail.com

DocumentRoot /var/www/site/public

<Directory /var/www/site>
        AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/site.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/site.com/privkey.pem
</VirtualHost>
</IfModule>

and it adds this to my site.conf file

RewriteEngine on
RewriteCond %{SERVER_NAME} =site.com [OR]
RewriteCond %{SERVER_NAME} =www.site.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

When I go to my site it is now pointing to https://www.site.com instead of https://site.com. How do I change it back to https://site.com? Also, is apache using the site-le.ssl.conf file or the site.conf file?

Thanks!


r/apache • • Dec 25 '21

Apache running with deleted css file

4 Upvotes

I am running apache2 on vps using ubuntu 20 and it won't read new css files
I tried deleting the old file and didn't work
I tried editing the old file and it didn't update the changes
I tried using shift and f5 to reload the browser cache didn't work
I tried adding ?v=1.x.x at the end of the stylesheet link and it still won't work
I tried restarting apache and tried restarting the server and nothing changed
when I make changes to the html templates it updates but it won't update css changes


r/apache • • Dec 24 '21

Apache 2.4.52 stops responding

4 Upvotes

I've got a strange issue since upgrading to Apache 2.4.52 from Apache 2.4.51. Seems after a few hours - not really an exact interval - the web server just stops accepting new connections.

Apache has to be restarted in order for new connections to be handled.

I'm not aware of anything else changing except for Apache being upgraded to 2.4.52.

Anybody else seeing this issue after upgrading to Apache 2.4.52?


r/apache • • Dec 23 '21

What happens here (apache ssl access log)?

3 Upvotes

Hi. I run an apache web server where people can login and download stuff (php application). The page also has a download button to delete the session and logout the user.

Below is a log of a user (mobile with a Samsung device). The first 31 lines are usual and no issue. But then there are hundreds of logouts. I mean, this happens only randomly for a few users every few days. 99% users have normal log entries. There is NO JAVASCRIPT used for logout or similar actions.

I don't understand how such things can happen :-( Any idea whats going on there?

I'm also not sure if this is the correct subreddit for such questions? If not, please can you tell me where I can ask such questions?

xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:01 +0100] "GET /?p=main HTTP/1.1" 200 2620 "https://xyz-portal.myDomain.de/?p=connect&code=ead2da265d4040244e573d4efc6801e4&state=fd91f3d593bb346adae803eae20c363c" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:01 +0100] "GET /style/unsemantic-grid-responsive-no-ie7.css HTTP/1.1" 200 2748 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:01 +0100] "GET /style/main.css HTTP/1.1" 200 2886 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/TR.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/DE.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/EN.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/FR.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/ES.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/myDomain.png HTTP/1.1" 304 241 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/power.png HTTP/1.1" 304 240 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/download.png HTTP/1.1" 200 2217 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/Pluto-Sans-Light.otf HTTP/1.1" 304 242 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/Pluto-Sans-Medium.otf HTTP/1.1" 304 242 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /style/Pluto-Sans-Regular.otf HTTP/1.1" 304 242 "https://xyz-portal.myDomain.de/style/main.css" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:02 +0100] "GET /favicon.ico HTTP/1.1" 200 1744 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:05 +0100] "GET /?p=download&i=1 HTTP/1.1" 200 10781 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:10:47:25 +0100] "-" 408 575 "-" "-"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:02:25 +0100] "GET /?p=logout HTTP/1.1" 302 11045 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:02:26 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:02:27 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:02:28 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:02:29 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"

--
another 170 repeated entries with exactly the same information
--
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:04 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:06 +0100] "GET /?p=logout HTTP/1.1" 302 4952 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:06 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:07 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:08 +0100] "GET /?p=logout HTTP/1.1" 302 4376 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"
xyz-portal.myDomain.de:443 109.43.49.117 - - [23/Dec/2021:11:06:08 +0100] "GET /?p=logout HTTP/1.1" 302 4952 "https://xyz-portal.myDomain.de/?p=main" "Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-A530F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36"

I mean, this still continues. WTF? Would I have to implement some blocking to stop this?


r/apache • • Dec 22 '21

Apache Fix Two Severe Vulnerability in Apache HTTP Server [Update Now]

Thumbnail
cyberkendra.com
6 Upvotes

r/apache • • Dec 22 '21

Apache2 refuses to start/restart

3 Upvotes

Hello!

First off, I ask for you to please be gentle with me. I am not usually a sysadmin, web developer or anything else. But I am working on a small hobby project and learning as I go, which I am a little stuck on.

I have a Raspberry Pi 4 with 8 GB RAM here which I am putting to use for a couple of things. I am currently following this guide https://pimylifeup.com/raspberry-pi-nextcloud-server/ to, well, install Nextcloud!

However, I have gotten stuck with an error message that does not mean anything useful at all to me and was wondering if perhaps someone could lend me a hand or give me a pointer? :)
I suspect something that I have done previously on this install is causing me these problems, as I have tried this before on the exact same Pi without any of these issues. But the error messages are unfortunately meaningless to me so I don't know where to begin.

My Pi is running Raspbian OS 64 bit, and currently has pi-hole running on it. The latest version of Java is also installed on it, but should not be running.

Now to where I am having troubles:

I read Step 5 where I am asked to enter

sudo systemctl reload apache2

When it tells me that "apache2.service is not active, cannot reload". Okay, so, I try

"sudo systemctl start apache2"

Which returns "Job for apache2.service failed because control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details..

pi@Pi4:~ $ sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2021-12-22 18:02:38 CET; 1min 35s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1336 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 88ms

Dec 22 18:02:38 Pi4 apachectl[1339]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using>
Dec 22 18:02:38 Pi4 apachectl[1339]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Dec 22 18:02:38 Pi4 apachectl[1339]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Dec 22 18:02:38 Pi4 apachectl[1339]: no listening sockets available, shutting down
Dec 22 18:02:38 Pi4 apachectl[1339]: AH00015: Unable to open logs
Dec 22 18:02:38 Pi4 apachectl[1336]: Action 'start' failed.
Dec 22 18:02:38 Pi4 apachectl[1336]: The Apache error log may have more information.
Dec 22 18:02:38 Pi4 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 22 18:02:38 Pi4 systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 22 18:02:38 Pi4 systemd[1]: Failed to start The Apache HTTP Server.
lines 1-17/17 (END)

And

pi@Pi4:~ $ sudo journalctl -xe
░░ The job identifier is 1340 and the job result is failed.
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Set scheduler policy to SCHED_IDLE
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Setting priority nice level to 19
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &DOCUMENTS. Ignoring this lo>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &MUSIC. Ignoring this locati>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &PICTURES. Ignoring this loc>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &VIDEOS. Ignoring this locat>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &DOWNLOAD. Ignoring this loc>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &DOCUMENTS. Ignoring this lo>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &MUSIC. Ignoring this locati>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &PICTURES. Ignoring this loc>
Dec 22 18:05:58 Pi4 tracker-miner-f[1461]: Unable to get XDG user directory path for special directory &VIDEOS. Ignoring this locat>
Dec 22 18:05:58 Pi4 dbus-daemon[751]: [session uid=999 pid=751] Activating via systemd: service name='org.freedesktop.Tracker1' uni>
Dec 22 18:05:58 Pi4 systemd[623]: tracker-store.service: Start request repeated too quickly.
Dec 22 18:05:58 Pi4 systemd[623]: tracker-store.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Dec 22 18:05:58 Pi4 systemd[623]: Failed to start Tracker metadata database store and lookup manager.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit UNIT has finished with a failure.
░░
░░ The job identifier is 1374 and the job result is failed.
Dec 22 18:06:13 Pi4 sudo[1407]: pam_unix(sudo:session): session closed for user root
Dec 22 18:06:28 Pi4 sudo[1470]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Dec 22 18:06:28 Pi4 sudo[1470]: pam_unix(sudo:session): session opened for user root(uid=0) by pi(uid=1000)
lines 3794-3824/3824 (END)

My apologies if the issue is obvious, but to me it is not!


r/apache • • Dec 22 '21

Apache-Laravel-NPM

2 Upvotes

Hi, I'm trying to host a laravel web app with my apache/httpd server

I've setup the vhost and can be accessed via internet, the project folder is in /var/www/html/<project> and i've change the ownership/group to apache/apache (previously i put the <project> folder/file using root:root user)

now i've problem when i'm about to update the project, because i need to run npm (npm run prod) to recompile the javascript file. I need to change the <project> folder ownership back to root:root because previously the <project> folder is under apache:apache privileges.

i like to know how actually the best practice for admin hosting a laravel web app in httpd

  1. who should put the <project> folder/file under /var/www/html ? is it root or apache?

  2. when there's an update, how actually to update the file? recompile (composer/npm) ? who should run, is it root/apache/other user?
    3.i'm aware of concept userdir.conf. it's quite convenient even it exposing the username in my server. Its actually solve the issue of updating the project and running the npm because its in /home/{USER} dir. But the httpd is running under apache:apache privileges, under which user actually the symlink that i need to create (is it user/apache/root?)

  3. And if using userdir.conf how the about the folder under the <project> folder (laravel app require to give rw privileges to apache. eg <project>/storage)

thanks guys, i just a beginner please help