friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
45 stars 18 forks source link

URL rewrite in .htaccess is not working #113

Closed stodge closed 4 years ago

stodge commented 4 years ago

I followed your website for running Friendica using docker-compose at https://hub.docker.com/_/friendica#! - "Base version - apache". My YAML file is:

version: '2'

services:
  db:
    image: mariadb
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=friendica
      - MYSQL_RANDOM_ROOT_PASSWORD=yes

  app:
    image: friendica
    restart: always
    volumes:
      - friendica:/var/www/html
    ports:
      - "9090:80"
    environment:
      - MYSQL_HOST=db
      - MYSQL_USER=friendica
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=friendica
      - FRIENDICA_ADMIN_MAIL=root@friendica.local      
    depends_on:
      - db

volumes:
  db:
  friendica: 

When I use docker-compose up -d, I get:

URL rewrite in .htaccess is not working. Make sure you copied .htaccess-dist to .htaccess.

Any suggestions? Thanks

annando commented 4 years ago

I'm no Docker pro, but the message asked if you copied the file .htaccess-dist to .htaccess. Can you check if this happened?

stodge commented 4 years ago

There's no sign of that happening in the logs:

docker-compose up
Creating network "friendica_default" with the default driver
Creating volume "friendica_db" with default driver
Creating volume "friendica_friendica" with default driver
Creating friendica_db_1 ... done
Creating friendica_app_1 ... done
Attaching to friendica_db_1, friendica_app_1
db_1   | 2020-04-28 14:44:10+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.12+maria~bionic started.
app_1  | Initializing Friendica 2020.03 ...
db_1   | 2020-04-28 14:44:11+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1   | 2020-04-28 14:44:11+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.12+maria~bionic started.
db_1   | 2020-04-28 14:44:11+00:00 [Note] [Entrypoint]: Initializing database files
app_1  | Initializing finished
app_1  | New Friendica instance
app_1  | Running web-based installer on first connect!
app_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.31.32.3. Set the 'ServerName' directive globally to suppress this message
app_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.31.32.3. Set the 'ServerName' directive globally to suppress this message
app_1  | [Tue Apr 28 14:44:12.622917 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.3.17 configured -- resuming normal operations
app_1  | [Tue Apr 28 14:44:12.622984 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
db_1   | 
db_1   | 

I trimmed off the DB logs as I don't think there's anything relevant there.

stodge commented 4 years ago

I worked out what the problem was. I had changed the docker-compose file to expose Friendica on port 9090, instead of 80:

ports:
  - "9090:80"

As I was already running something on 80. I reverted to using 80 and re-started docker-compose and it seems to be ok.