LinkStackOrg / linkstack-docker

A simple to set up docker variant of LinkStack. LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface.
https://linkstack.org/docker
GNU Affero General Public License v3.0
349 stars 43 forks source link

Permission denied on httpd.conf on Startup #110

Closed HerXayah closed 8 months ago

HerXayah commented 10 months ago
+ ------------------------------------------------------------------ +
|                      LINKSTACK v4.2.3                      |
+ ------------------------------------------------------------------ +
| Updating Configuration: Apache Base (/etc/apache2/httpd.conf)      |
sed: can't create temp file '/etc/apache2/httpd.confXXXXXX': Permission denied

Fresh installed container on Debian host with this Compose file. I tried mounting the httpd.conf to my local drive aswell, same result. Doesnt matter whatever i do. Permissions are 100 and 101 for group on the folders.

linkstack:
    hostname: 'linkstack'
    image: 'linkstackorg/linkstack:latest'
    container_name: 'linkstack'
    environment:
      - PUID=100
      - PGID=101
      - TZ='Europe/Berlin'
      - SERVER_ADMIN="*****'
      - HTTP_SERVER_NAME='*****'
      - HTTPS_SERVER_NAME='*****'
      - LOG_LEVEL=info'
      - PHP_MEMORY_LIMIT='256M'
      - UPLOAD_MAX_FILESIZE='8M'
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.linkstack.entrypoints=http"
      - "traefik.http.routers.linkstack.rule=Host(`*****`) || Host(`*****`) || Host(`*****`)"
      - "traefik.http.middlewares.linkstack-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.linkstack.middlewares=linkstack-https-redirect"
      - "traefik.http.routers.linkstack-secure.entrypoints=https"
      - "traefik.http.routers.linkstack-secure.rule=Host(`*****`) || Host(`*****`) || Host(`*****`)"
      - "traefik.http.routers.linkstack-secure.tls=true"
      - "traefik.http.routers.linkstack-secure.tls.certresolver=cloudflare"
      - "traefik.http.routers.linkstack-secure.tls.domains[0].main=*****"
      - "traefik.http.routers.linkstack-secure.tls.domains[0].sans=*****"
      - "traefik.http.routers.linkstack-secure.tls.domains[1].main=*****"
      - "traefik.http.routers.linkstack-secure.tls.domains[1].sans=*****"
      - "traefik.http.routers.linkstack-secure.tls.domains[2].sans=*****"
      - "traefik.http.routers.linkstack-secure.tls.domains[2].main=*****"
      - "traefik.http.routers.linkstack-secure.service=linkstack"
      - "traefik.http.services.linkstack.loadbalancer.server.port=80"
    volumes:
      - linkstack_data:/htdocs
      - /opt/linkstackapache/httpd.conf:/etc/apache2/httpd.conf
    ports:
      - '8082:80'
      - '8083:443'
    restart: unless-stopped
    user: apache:apache
    # read_only: true
    depends_on:
      - mysql
    links:
      - mysql
  mysql:
    image: mysql:8
    environment:
        MYSQL_ROOT_PASSWORD: *****
    ports:
        - 3306:3306
satyam7world commented 9 months ago

same error

NULLYUKI commented 9 months ago

Found a possible solution: https://forums.centos.org/viewtopic.php?t=6853#p193005

This might work without needing to disable "selinux" The error is a bit different, but maybe the solution could be working here.

Demigodrick commented 9 months ago

I have no idea if this is safe or not but if you remove "user: apache:apache" it should work. Something isnt set right with the permissions for the apache user.

HerXayah commented 9 months ago

I have no idea if this is safe or not but if you remove "user: apache:apache" it should work. Something isnt set right with the permissions for the apache user.

I dont have an Apache User though

Demigodrick commented 9 months ago

In the compose file above you have the line 'user: apache:apache'

Removing that line caused it to work fine for me.