php – Debian : Apache no muestra imágenes

Tengo una máquina configurada con nginx + apache y me resuelve las peticiones correctamente de un proyecto que tengo con PHP7.3, es un proyecto que crea un documento pdf y lo muestra por pantalla.
El problema lo tengo cuando intento mostrar las imagenes con https no me las carga, en cambio si lo hago en http SI.

Si hago http://cars.local/imagenes/logo.png (el navegador lo muestra)
Si hago https://cars.local/imagenes/logo.png (el navegador también lo muestra)

El problema lo tengo que esto si lo muestra por pantalla dentro de un archivo php

<img src="https://cars.local/imagenes/logo.png">

En cambio si lo pongo con https, no lo muestra da error

<img src="https://cars.local/imagenes/logo.png">

La configuración de nginx que tengo es esta

server {
        listen 80;
        listen (::):80;
        listen 443 ssl;
        listen (::):443 ssl;

        root /var/www/html/cars/;
        index index.php index.html index.htm;
        server_name cars.local;

        location / {
        try_files $uri $uri/ /index.php;
        }

        location ~ .php$ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8000;
        }

        location ~ /.ht {
                deny all;
        }
}

La configuración de apache es esta otra

<VirtualHost *:8000>

        ServerAdmin webmaster@localhost
        ServerName cars.local
        DocumentRoot /var/www/html/cars/

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

</VirtualHost>

virtualmin – Failed to create virtual server : The domain x already hosted by your Apache webserver

I’m just trying to create a new virtual server, unfortunately it does not work.

I created a virtual server and deleted it.

I’m trying to create a virtual server with the same name, but I get this error message:

Failed to Create Virtual Server: The Domain X is Already Hosted by
Your Apache Web server.

I have searched for a solution and have only found a question regarding this problem with the solution to delete the alias from the virtual server in httpd.conf file, but I do not have this file and in apache2.conf I do not find the alias from the Virtual Server .

docker – How should I authorize calls to an API behind an Apache reverse proxy behind CAS authentication?

Apologies if this is incoherent. I’m very new.

I have an Apache server protected by CAS in a Docker container. I’m using mod_auth_cas to do this. I have an API running on a different container which is accessed through a reverse proxy using ProxyPass so that the user must be authorized to make API calls. I now want to know the UID in my API so that I can make sure that the user has permissions.

I’m hoping that there’s a way to add an additional parameter with the verified UID to incoming API calls. I feel like there should be some way to do this with mod_rewrite, but I’m not sure how. I suppose I’d have to get the UID as a string.

apache http server – Docker: httpd starts before volume is mounted?

I have a simple docker with apache2 installed (with a2enmod cgid) with CMD being:

CMD apachectl -D FOREGROUND

I run container with:

docker run --name app1 -p 8080:80 -v "C:storeapp1www":/app1/www -d app1:1.3

The problem I have is… if the container is stopped, then restarted (via the GUI docker desktop), apache goes into a state where it returns 503 for everything until it is restarted with apachectl restart.

I have no idea why, but I suspect that it is related to the volume not finishing mounting properly before the CMD is executed?

Is there something basic I am not understanding about when -v would complete compared to when CMD is run? The apache2 log file just says this for every request, even after volume appears to be mounted ok:

(cgid:error) No such file or directory: (client 127.0.0.1:59282) AH02833: ScriptSock /var/run/apache2/cgisock.9 does not exist: /bcon/www/index.cgi

I have resorted to doing this CMD, but I feel like I am missunderstanding something important about docker:

sleep 5 && apachectl -D FOREGROUND

apache2 – Apache proxy not working correctly

In the process on publishing my node app on a ubuntu 18.04 server with apache, I had created a virtualhost file like this bellow,

<VirtualHost *:80>
ServerName example.com

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

   <Location /nodejs>
      ProxyPass http://127.0.0.1:8080
      ProxyPassReverse http://127.0.0.1:8080
   </Location>

    <Directory "/var/www/example.com/html">
    AllowOverride All
    </Directory>
</VirtualHost>

I saved and restarted apache, everything is normal till now. But when I decided to change the location to /nodejs to only / and updated it as so, it doesn’t work.

Whenever I hit the domain, it shows the default apache page and if I hit with domain/nodejs then the app loads just fine.

I have tried disabling proxy modules, restarting servers. I think there is some kind of cache or something, but can’t figure out.

Please help.

apache2 – Desplegando app laravel en VPS con Apache

En el archivo 000-default de apache redirecciono de esta forma mi aplicacion.

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/App-web-facturas/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Pero al dirigirme a la direccion de mi proyecto lo que me muestra es el contenido del index.php

introducir la descripción de la imagen aquí

apache – Docker Image not having correct permissions for www-data in WordPress

So I have a docker container running Apache/WordPress which runs Apache as www-data. I build the image using a Dockerfile and started it. I then copied my local uploads and plugin folders using:

docker cp ../wp-content/uploads esaanz_dev:/var/www/html/wp-content

When I access the machine and I try to install a plugin, always gives me Installation failed: Could not create directory. Furthermore, my backup plugin cannot wrote to wp-content/updraft to create backups.

I have logged into the machine using docker exec and I have run this command:

chown -R www-data:www-data wp-content

The problem persists even though www-data has access to everything:

Permissions for www-data

I am going mad figuring why WordPress is not able to write if it’s running under www-data and this user/group can write to anything in the container.

Any pointers are greatly appreciated.

apache spark – Is there a way to define pure SQL UDF’s that still take advantage of all of Pyspark’s optimizations?

I’m repeating a lot of code that looks like the following:

trim(concat(ifnull(`field1`, ''), ' ', ifnull(`field2`, ''))) as my_field

It would be nice to be able to define a function called trim_and_concat that takes an arbitrary number of fields, concatenates them, and trims the result. I could write a UDF, but then I would lose out on all the PySpark optimization.

Is it possible to define a function that combines native SparkSQL methods such that the typical loss of opitimization associated with UDFs is avoided?

I know about the create_function syntax, but as far as I can tell this is just another way to create UDFs, and still requires that the functions be written in scala or Python.

Do I need to use OAuth2 to authorize my Laravel API to communicate with Apache Kafka?

I have a project in which I separated the front-end (Vuejs) and the backend (Laravel API).

I will use Apache Kafka to get data from IoT devices then Laravel will use this data (Consume) to display analytics in real-time to the front-end.

I decided to not use microservices for many reasons (we’re just 2 in the team without any experience in micro-services and we need to validate the business value first).

After this, I decided to use Laravel Sanctum (SPA authentication) to implement the authorization part, easy and perfect for my use case per the documentation but then I remembered that I also need Apache Kafka to communicate with Laravel API.

I’m confused here do I need to use Authorization for Apache Kafka for just my Laravel API to consume data from it in the first place or not? and if yes do I need to use Laravel Passport?

NOTE: Apache Kafka will give data only to my Laravel API, so do I need to implement some OAuth2 here or not?

I have read the documentation for both the Laravel Sanctum and Laravel Passport and it said “Laravel Sanctum does not support OAuth2”.

I also decided to use another RDBMS(MySql) for tables after much deliberation and Apache Kafka for just the data coming from IoT.

I hope that I have explained well my problem and where I’m really confused.

I don’t want to use Laravel Sanctum and when I get to the part where I need to consume data from Apache Kafka then I will be shocked to find that I need to use Laravel Passport (for OAuth2).