2

I'm using my companies Docker Template to try and connect to Localhost, but I get the message "File not found" when inputting localhost:8888 into chromes URL bar. After running the command "docker-compose up"in Git Bash, I try to connect to Localhost, but apache gives me [proxy_fcgi:error] AH01071: Got error 'Primary script unknown. I'm not sure why this isn't working because I'm using the companies documentation through this process and the documentation worked for all of my other coworkers. All the containers in docker seem to be running correctly, so any help with the apache side would be appreciated

Some fixes I've tried:

Editing my .htaccess file, as of right now it is:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ./index.php [L]
ProxyErrorOverride on
</Proxy>
</IfModule>

Editing my apache.conf file, as of right now it is:

ServerName localhost

LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so

<VirtualHost *:80>
#Proxy .php requests to port 9000 of the php-fpm container
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1
DocumentRoot /var/www/html/
<Directory /var/www/html/>
        DirectoryIndex index.php
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

#send apache logs to stdout and stderr
CustomLog /proc/self/fd/1 common
ErrorLog /proc/self/fd/2
</VirtualHost>

My docker-compose.yml file is:

version: "3.2"
services:
  php:
    build: './php/'
    networks:
      - backend
    volumes:
      - ./src/:/var/www/html/
      - ./installs/:/tmp/installs/
  apache:
    build: './apache/'
    depends_on:
      - php
      - mongo
    networks:
      - frontend
      - backend
    ports:
      - "8888:80"
    volumes:
      - ./src/:/var/www/html/
  mongo:
    image: mongo:4.0.6
    networks:
      - backend
    ports:
      - "9999:27017"
    volumes:
      - ./mongo_data/:/data/db/
networks:
  frontend:
  backend:
Nolan
  • 21
  • 1
  • 3

0 Answers0