Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 error except for /install/ #22

Closed
thacoon opened this issue Sep 1, 2022 · 4 comments
Closed

404 error except for /install/ #22

thacoon opened this issue Sep 1, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@thacoon
Copy link

thacoon commented Sep 1, 2022

Hi,

I am trying to get Cockpit running in a docker container, but I am currently failing to do so. After building the Dockerfile below and running it with docker run -it --rm -p "8080:80" cockpit and open the page http://localhost:8080/install/ in my browser I see that the installation completed successfully. However, if I click on login I get a 404. I get this for all sites which are not http://localhost:8080/install/.

FROM php:8.0-rc-apache-buster

RUN apt-get update \
    && apt-get install -y \
                wget zip unzip \
        libzip-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        sqlite3 libsqlite3-dev \
        libssl-dev \
    && pecl install mongodb \
    && pecl install redis \
    && docker-php-ext-install -j$(nproc) iconv gd pdo zip opcache pdo_sqlite

RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini
RUN echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini

RUN wget https://files.getcockpit.com/releases/master/cockpit-core.zip \
    && unzip cockpit-core.zip -d /tmp \
    && rm cockpit-core.zip \
    && cd /tmp/cockpit-core \
    && cp -Rp . /var/www/html \
    && cd /var/www/html \
    && rm -r /tmp/cockpit-core

ENV DOCUMENT_ROOT /var/www/html

# COPY config.php /var/www/html/config/config.php

RUN chown -R www-data:www-data /var/www/html

CMD ["apache2-foreground"]

P.S.
Btw. nice project, I tried multiple open source headless CMS and Cockpit is my favorite.

@aheinze
Copy link
Collaborator

aheinze commented Sep 1, 2022

Looks like mod_rewrite is not enabled. Try to add:

RUN a2enmod rewrite

@aheinze aheinze added the help wanted Extra attention is needed label Sep 1, 2022
@aheinze aheinze closed this as completed Sep 11, 2022
@thacoon
Copy link
Author

thacoon commented Oct 25, 2022

Thanks a lot, the following works:

FROM php:8.0-rc-apache-buster

RUN apt-get update \
    && apt-get install -y \
        wget zip unzip \
        libzip-dev \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        sqlite3 libsqlite3-dev \
        libssl-dev \
    && pecl install mongodb \
    && pecl install redis \
    && docker-php-ext-install -j$(nproc) iconv gd pdo zip opcache pdo_sqlite

RUN a2enmod rewrite && a2enmod rewrite expires

RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini
RUN echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini

RUN wget https://files.getcockpit.com/releases/master/cockpit-core.zip \
    && unzip cockpit-core.zip -d /tmp \
    && rm cockpit-core.zip \
    && cd /tmp/cockpit-core \
    && cp -Rp . /var/www/html \
    && cd /var/www/html \
    && rm -r /tmp/cockpit-core

ENV DOCUMENT_ROOT /var/www/html

# COPY config.php /var/www/html/config/config.php

RUN chown -R www-data:www-data /var/www/html

CMD ["apache2-foreground"]

@aheinze
Copy link
Collaborator

aheinze commented Oct 25, 2022

@thacoon
Copy link
Author

thacoon commented Oct 25, 2022

Nice, thanks +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants