-
Notifications
You must be signed in to change notification settings - Fork 454
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
How to use in subdirectory #101
Comments
Do you use latest version, |
Thanks @nijel I'll check the version tomorrow. I thought I excuted |
That sounds correcty, but if there is no supervisor, it's clearly some older version. Maybe I've made something wrong in the docker hub tags setup.... |
@nijel I feel that's understandable for me. I'd had old container at the moment so I did |
Hi @nijel, I was wrong that I specified an old image in Could you tell me how you tried a web server to have an alias? |
The It's there for handing following setups:
Here phpMyAdmin would think it's running on |
I used phpmyadmin behind haproxy so tried to setup haproxy as a ProxyPass and works! Here's my haproxy settings for subdirectoried phpmyadmin .
Here's docker-compose.yml for phpmyadmin.
Now they're working perfectly. Thank you very much. Would my settings be added to your document perhaps? |
Adding that to the docs could be useful, can you please document your setup for our docs? It's here: https://github.com/phpmyadmin/phpmyadmin/blob/master/doc/setup.rst#installing-using-docker |
Hello, I'm using phpMyAdmin 4.7.0 on Docker along with traefik reverse proxy. I'm experiencing a similar issue on setting up subdirectory. I used following
Also, I set up reverse proxy to point phpMyadmin server with request URL's path to I tried to use UPDATE I will put request header when I'm trying to access phpMyAdmin at Chrome browser.
and this is for
|
The container will always serve phpMyAdmin on /, you need to rewrite the URL in your reverse proxy. With haproxy example we have in configuration it is done by |
Thanks in advance 👍 While I'm looking through docs, and checking timelines of resources when phpMyAdmin is requested, I just want to check one thing. As I said, I get If my assumption is right, there should be Requesting CSS @ Is my assumption correct? |
Hello again. Sorry for messing up issue thread. I finally found a way to access phpMyAdmin behind traefik. The reason why upper issue happened is a matter of traefik.
I tried 'traefik.toml' first time as above, which is a configuration file. It does get a main page, but static assets, like CSS, JS are not retrieved, since there is no trailing slash on request URL. (This is why above issue happened, browser ommitting incomplete path '/phpmyadmin', when requesting assets.)
P.S. |
Thanks, I've added your example to our docs. |
See phpmyadmin/docker#101 (comment) Signed-off-by: Michal Čihař <michal@cihar.com>
I'm struggling a lot to find a working configuration to make that work with an apache2 reverse proxy using rewrite module. Anyone would have a solution please ? |
Can we do it from docker-compose.yml labels instead of the traefik.toml? |
I have answered this here https://stackoverflow.com/a/68643939/5689995 in case you don't want to change reverse proxy configuration |
Thank you |
Sure, post and image have been updated |
so, but how do I add this to the docker-compose file? |
@lug-gh: Create a new Dockerfile and paste the line of the Stackoverflow post from @laimison into it. Modify your docker-compose.yml file: phpmyadmin:
image: my-phpmyadmin #<--- Image name to build
build: <folder of Dockerfile> #<--- Folder without Dockerfile. See https://docs.docker.com/compose/compose-file/compose-file-v3/#build
... config as usual ... |
That way I have to build a new Dockerfile everytime I want to update? Thats not really a good solution in my opinion. Needs a lot of time and is laborious. I just created a script
Even thats not a good solution, but better than creating a new Dockerfile, I think. |
No, it grabs the already existing image from docker hub and only applies the additional step at the end. So, it takes less than a few seconds. Anyway, I will send a PR today to be able to configure the sub uri based on configuration without the need to re build any image. |
I am re-opening because of #353 |
Very much simpler approach: Set Was it the feature that is wanted ? Anyone, please let me know bout this :) --- a/apache/docker-entrypoint.sh
+++ b/apache/docker-entrypoint.sh
@@ -35,6 +35,12 @@ if [ -n "${APACHE_PORT+x}" ]; then
sed -i "s/Listen 80/Listen ${APACHE_PORT}/" /etc/apache2/ports.conf
apachectl configtest
fi
+
+if [ ! -z "${APACHE_ROOT_FOLDER}" ]; then
+ echo "Creating an alias for / to ${APACHE_ROOT_FOLDER}."
+ sed -i "/DocumentRoot \/var\/www\/html/a \ Alias ${APACHE_ROOT_FOLDER} /var/www/html" /etc/apache2/sites-enabled/000-default.conf
+ apachectl configtest
+fi
# end: Apache specific settings
get_docker_secret() { |
this is much make sense and simple, already use this trick before using docker.. edit: example: after I add |
I had similar issues using nginx as reverse proxy directing to a docker container and using a subdir for the phpmyadmin url. If i didn't add a slash at the end of the url (https://www.example.org/phpmyadmin) I ended up with a blank page and alle external resources failed to load. Adding a slash at the end (https://www.example.org/phpmyadmin/) helped. I added this to the location part of the phpmyadmin-nginx-config-file: |
I am wondering why looking at your example above:
I would expect But as I understand I have to set This makes running multiple containers on different hosts pretty unflexible, because we have to always modify the docker-compose file for each new instance, because of changed host name. Is that correct, or do I miss something? update I could get it work with apache adding this to the vhosts config # serve phpMyAdmin from subdirectory
ProxyPass /pma http://phpmyadmin:80/
ProxyPassReverse /pma http://phpmyadmin:80/ in docker compose: ...
# Apache Service
apache:
build: 'docker/apache_docker'
ports:
- 127.0.0.1:8080:80
# phpMyAdmin Service
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
environment:
PMA_HOST: mariadb
PMA_PORT: 3307
PMA_ABSOLUTE_URI: "http://phpmyadmin/pma/"
depends_on:
- mariadb
... |
Is is possible that I launch it as http://example.com/phpmyadmin/ ?
PMA_ABSOLUTE_URI
seemed not work.The text was updated successfully, but these errors were encountered: