Closed joepio closed 3 years ago
I never tried the docker-compose but I think it should work with https://github.com/pdsinterop/php-solid-server/blob/master/run-solid-test-suite.sh#L9 https://github.com/pdsinterop/php-solid-server/blob/master/run-solid-test-suite.sh#L23
I'll see if I can set up a public instance
I just tried:
docker build -t server .
docker run -d --network=host server
and now see 'Hello, World!' on https://pss.pdsinterop.net/
When browsing to https://pss.pdsinterop.net/login I see '405 Method Not Allowed'.
I tried fetch('', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: 'username=alice&password=alice123' });
from that page but got a 405 for that as well.
Ah, https://pss.pdsinterop.net/profile/card#me shows something meaningful :)
Here is the entire history from a clean Ubuntu server, including LetsEncrypt setup:
apt install certbot
certbot certonly --standalone
git clone https://github.com/pdsinterop/php-solid-server
cd php-solid-server
mkdir tls
cp /etc/letsencrypt/live/pss.pdsinterop.net/privkey.pem tls/server.key
cp /etc/letsencrypt/live/pss.pdsinterop.net/fullchain.pem tls/server.cert
snap install docker
docker build -t server .
docker run -d --network=host -e SERVER_ROOT=https://pss.pdsinterop.net -e USERNAME=alice -e PASSWORD=alice123 -v `pwd`/tls:/tls server
Adding on to the pile of information - I have an instance running locally with docker-compose, but the setup is different. It consist of these files: docker-compose.yml apache.conf php-solid-server/ php-solid-pubsub-server/
docker-compose.yml:
version: '3'
services:
php-apache:
build:
context: ./php-apache
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- ./php-solid-server/:/var/www/
- ./php-solid-pubsub-server/:/var/websocket/
- ./apache.conf:/etc/apache2/sites-enabled/001-default-ssl.conf
apache.conf:
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /tls/server.cert
SSLCertificateKeyFile /tls/server.key
ServerName localhost
DocumentRoot /var/www/html/
</VirtualHost>
and directories php-solid-server and php-solid-pubsub-server checked out from github.
The caveat is that the pubsub server has to be started up manually (php /var/websocket/server/server.php) from the commandline.
So is https://github.com/pdsinterop/php-solid-server/blob/master/docker-compose.yml outdated? I see it's 5 months old, so probably it's better if you overwrite it with your working one?
Or we remove the failing docker-compose.yml and add the steps from https://github.com/pdsinterop/php-solid-server/issues/40#issuecomment-749539591 to the readme?
I think we would be better served updating the docker-compose file...
I've updated the docker-compose so that it now runs the local Dockerfile and adds a pubsub server from git (php-solid-pubsub-server#master).
@joepio Could you see if this one starts everything up for you?
Almost there!
AH00526: Syntax error on line 29 of /etc/apache2/sites-enabled/site.conf:
Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
Seems to have an issue reading this line:
Header add Access-Control-Allow-Origin "*"
Removing the line results in the same error, though. Might be a different issue!
could you check what happens if you do 'a2enmod headers' on the commandline? I'm expecting it to say 'Module headers already enabled'. I would have expected the new Dockerfile to have handled that though, so maybe a 'docker-compose build php-solid-server' is needed to rebuild the image with mod_headers enabled?
docker-compose run php-solid-server a2enmod headers
returned
Enabling module headers.
To activate the new configuration, you need to run:
service apache2 restart
But... Indeed, after running docker-compose build php-solid-server
, it seems to work fine! Thanks :)
@joepio :tada:
@ylebre We'll have to investigate at a later moment what gives, as the Dockerfile
contains a RUN a2enmod headers
instruction.
Then again, when we finally move the Docker image created by/for this repo to Docker Hub, this issue should also be resolved.
Anyway... mañana.
The a2enmod was a recent addition I did earlier today, which is also why the docker-compose build fixed it :)
I shut down pss.pdsinterop.net again to save money, let me know if we need a public PSS server running again.
@michielbdejong That shouldn't be needed. There's work underway for push-button deploys for Heroku et-al.
First off: awesome work! This really helps make the Solid ecosystem more mature :).
Since there's a
docker-compose.yml
file, I'd love to use that to run this project locally. However, I'm not getting it to work, and I'm not sure what I'm doing wrong.When I run
docker-compose up
, the image is properly pulled and it'sAttaching to solid-php-server
, but from then on I can't get a connection. The compose file seems to correctly expose port 80, but I can't make a connection. Also, the logs are empty:docker logs solid_php
.Thanks in advance!