How to reverse proxy with Docker and Ubuntu Tutorial - docker

I am trying to reproduce this git repository with a few tutorial-based lecture notes. This website is basically docker container with npm and yarn technology. It works fine within my network say 10.35.34.35:8000. But, if I use reverse proxy and give it in public say www.abc.xyz.com/tutorial, it is not working. The error is due to an incorrect path that is not recognized by the docker to send the request back.
When the index.html <base href="/"> is changed to <base href="tutorial/"> it is reaching the index.html page properly, but the tutorial elements are not mapped back again.
I get the following error:
https://abc.xyz.com/tutorial/src/tutorial.html 404 (Not Found)
I have tried many possibilities to rectify this error, by changing each elements' absolute path, but none worked efficiently. Could someone suggest an efficient solution to resolve this?
To Reproduce, please follow the following instructions
Download docker in machine
Download the following code from github: https://github.com/canonical-web-and-design/tutorials.ubuntu.com
Run the command ./run serve inside the downloaded folder
Reverse proxy on apache config as follows
ProxyPass /tutorials http://10.35.34.35:8000
ProxyPassReverse /tutorials https://10.35.34.35:8000
Restart apache

Related

Why isn't Drupal recognizing my new twig files?

I want Drupal to recognize my new twig files. Trying to clear the cache with the
drush cr
command gives me a success message. So does manually clicking on "Flush all caches" from the menu. But my new twig files are not being recognized. I was able to clear caches for weeks perfectly fine and it recognized twig files until now. I am using ddev to run my server. I have stopped and restarted the server. Restarted docker. I am using development.services.yml, not services.yml, which from my research I believe is correct. I am also exporting my settings.local.php from my settings.php.
I would like for Drupal to recognize my twig files. Neither clearing the cache by command line with
or manually works. No part of the configuration was changed it just stopped working suddenly.
Most probably, it’s related with permissions.
Resetting permissions, perhaps like described in
After drupal update site throws HTTP ERROR 500
might work,

Jenkins searchbox result URLs incorrect

We have a problem with the URLs returned by the Jenkins search functionality.
Our Jenkins URL is, say, https://example.com/jenkins
Jenkins sits behind a reverse proxy (HAProxy). We've configured HAProxy as follows:
frontend buildserver
bind *:443 ssl crt /etc/ssl/certs/example.com.pem
http-request set-header X-Forwarded-Proto https
http-request set-header X-Forwarded-Host example.com
http-request set-header X-Forwarded-Port 443
acl PATH_JENKINS path_beg -i /jenkins
use_backend jenkins-http if PATH_JENKINS
backend jenkins-http
server jenkins 127.0.0.1:8080
and in /etc/default/jenkins we have:
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --prefix=/jenkins"
In the GUI configuration we have Jenkins URL set to:
https://example.com/jenkins/
Everything appears to work and I can navigate all links in Jenkins with the exception of any search results generated using the search box on the top panel. These search results link to the job/view/etc URL without the "/jenkins/" prefix and therefore don't work.
We have recently upgraded Jenkins and I'm told the search results previously worked.
Has anybody else seen this issue?
Ubuntu, Jenkins 2.289.2
UPDATE: I downgraded to our previous version 2.263.4 but the problem still persists. Inspecting the HTML shows the generated hrefs are relative and unusual, eg:
myjob
I can get it working by editing like this:
myjob
I've also noticed the below search text help appear after a search. I don't see that on other instances of Jenkins I have access to. Is this enabled by configuration / plugin perhaps?
POSSIBLE SOLUTION: so the image above is the nested-view plugin. Issues have been reported with this, eg:
https://issues.jenkins.io/browse/JENKINS-65924
I rolled back the plugin from 1.20 to 1.17 and now have the more familiar search functionality back and working. phew.
Looks like the issue is solved with 1.26 and I haven't had to create a ~/.nestedViewsSearch file.
https://phabricator.wikimedia.org/T294424#8028735
Had the same issue. Downgraded nested-view to 1.19 from 1.21 and search issue went away.
nested-view v1.24 (diff) allows restoring default search behavior by creating a file named ~/.nestedViewsSearch on the Jenkins controller.
This takes effect immediately; it is not necessary to restart the controller.

Gulp not detecting file changes in subfolder

I'm using a docker-yeoman image to launch a container and then running the Yeoman gulp-webapp generator to generate a project skeleton.
Once generated, I'm running it in the same container using:
docker run -it -p 9000:9000 -p 35729:35729 --rm -v $(pwd):/src cthulhu666/yeoman:gulp gulp serve`
This bit is all working fine. I can view the site by visiting 192.168.99.100:9000 (I'm using Docker Toolbox so it's a VM rather than localhost).
But something strange is happening:
If I add body { background: red; } to /app/styles/main.scss, the change is detected by Gulp, the tasks are run and the background of the page goes red. So far so good.
However, if I then create a /app/styles/partials/_test.scss and then move the body selector into that file (including it in main.scss with import "partials/test";) then no changes are detected by Gulp when I save the file. The only way I can get it to "notice" the changes is to re-save the main.scss file, at which point Gulp kicks in and the changes to the _test.scss file are also applied.
I tested this by installing the generator locally and re-running the same experiment. Sure enough, the changes are applied just fine when made in either main.scss and _test.scss, as expected.
Can anyone shed any light on why this isn't the case in the Docker container?
It seems to be something to do with the underscore in the filename. SCSS allows you to use an variety of naming conventions:
Filename: /partials/_test.scss /
SCSS: #import "partials/_test";
Filename: /partials/_test.scss /
SCSS: #import "partials/test";
Filename: /partials/test.scss /
SCSS: #import "partials/test";
All three of the above import the partial correctly. However, only the last allows Gulp to detect changes (though only in a Docker container - it works fine locally).
I'd still be interested to know why this is, if anyone has any ideas :)
Virtualbox shared folders don't work very well with file watching.
https://www.virtualbox.org/ticket/10660
https://github.com/mitchellh/vagrant/issues/707
(I'm sure you can find many others)
Virtualbox is what is being used by Docker Toolbox/Docker Machine to provide the VM.

Getting 404 File Not Found on Apache 2.4, FastCGI and Ubuntu 14.04

My first step was install HHVM following this guide: https://github.com/facebook/hhvm/wiki/Prebuilt-packages-on-Ubuntu-14.04
Then i run the script with the command: ´sudo /usr/share/hhvm/install_fastcgi.sh
Then i test if hhvm was installed with command ´php -v´ and the output is OK, says that HIPHOP VM is runing.
The problem arrives when i try to access to a PHP file, Apache always return 404 error. In the other hand html files and static files works good. I only receive 404 error with php files.
I search on Google and found many people with same issue but no solutions. Perhaps someone can help.

Dart Editor Dartium: "could not start pub serve or connect to pub"

I just installed Dart Editor on Ubuntu 14.04, opened the Sunflower demo, right clicked on sunflower.html, chose Run in Dartium, and was faced with "Could not start pub serve or connect to pub." So I went to Google and found the following reasons why this happens:
"Run in Dartium" doesn't invoke "pub serve" correctly for Dart files that aren't in web/ or test/ (But the Sunflower demo files are all in web/)
https://code.google.com/p/dart/issues/detail?id=18990
Project files must be inside "C:\Users[username]\dart" instead of "C:\progs\Dart\projects" (Doesn't help; I'm not on Windows, but would demos that come with Dart Editor be in the wrong place?)
https://code.google.com/p/dart/issues/detail?id=19659
Same problem in recent release shows up on Mac OSX, bug fix promised in that next release (Doesn't help; I'm not on Mac OSX and that next release already came)
https://code.google.com/p/dart/issues/detail?id=19143
Another service is listening on port 8080 (Nope, I checked the ports and also made sure nothing with dart pub serve was already running, plus rebooted a couple of times)
dart error - could not start pub serve or connect to pub
So I found more information that gave me the idea to try pub serve from the command line. So I went to the directory where the sunflower project was placed by the Dart Editor (where the pubspec.yaml is found) and in the command line I typed:
sudo /opt/dart/dart-sdk/bin/pub serve
Which resulted in:
You don't have a lockfile, so we need to generate that:
Resolving dependencies... (1.1s)
Downloading browser 0.9.1...
Got dependencies!
Loading source assets...
Serving sunflower web on http:// localhost:8080
Build completed successfully
Great, I thought, so I opened Chrome and visited http:// localhost:8080 and saw this:
404 Not Found
Could not find asset web in package sunflower.
And in my command line console I saw this:
[web] GET / → Could not find asset sunflower|web.
[web] GET /favicon.ico → Could not find asset sunflower|web/favicon.ico.
I am about to get more aggressive with my Google search and investigation, but I thought I would have this question out here just in case I cannot find the answer. Even though I encounter many obstacles before running my first Dart demo, which makes for a poor introduction (I know, Dart is new), I keep liking what people say about it and I am compelled to get this working. Please help me like Dart. :)
Much appreciated!
I came across similar error and this solved it for me:
1) Move all html/css/dart files to /web directory.
2) Than create a pubspec.yaml with your projects dependences (usually it's "browser" only).
You may try like this, [run]-->[Manage Launches], then unmarked "Use pub serve to serve the application", good luck!

Resources