ddev launch command returns "File not found." - windows-10

My organization is establishing a ddev-pantheon setup on Windows 10. Successful "ddev pull pantheon" commands have executed. 403 errors arose after running ddev start and clicking the project links; this error disappeared after establishing the folder with "index.php" as the docroot folder in my "config.yaml" file. However, now "File not found." is being displayed after clicking both project links (those returned after a "ddev start" or "ddev restart" command). Could it be that some file in the repo linked to the index.php file is having trouble locating another file - how do I get rid of this message and view the site?
If anyone is willing to help me establish a functional connection, then I would appreciate it. It will also be helpful to know where ddev users usually clone their git repositories and how I can locate the files downloaded following a "ddev pull pantheon" command. Could the presence of lando .yml files cause issues? Any help is appreciated. Thank you.
Moving the "index.php" file (and those referenced by it) into the initial docroot folder did not get rid of the "File not found." message. Neither did deleting the repo, redownloading it, and establishing the new repo folder as the docroot folder in the "config.yaml" file resolve this issue.

As you discovered, the most common reason to get a 403 is that your docroot is set wrong (or that there is no index.php or index.html in your docroot). This happens enough that there's an FAQ for it, https://ddev.readthedocs.io/en/latest/users/basics/faq/#why-do-i-get-a-403-or-404-on-my-project-after-ddev-launch
Please look at your .ddev/config.yaml and see what's there for docroot when you're having this problem, and use ddev ssh to inspect what's inside the container.
ddev logs may help you understand why the 403 is happening.
You don't say whether you're using mutagen or not.
ddev pull pantheon should have nothing to do with your 403 problem; it's not clear why you mention ddev pull pantheon. I supposed you could have a really messed up pantheon.yaml that could do it, or that you could be downloading a broken database. Are you saying that your project is only broken after you do a pull? If so, ddev delete -Oy will get you back to where you started, so you can demonstrate that. You can also do ddev pull pantheon --skip-files or ddev pull pantheon --skip-db as part of your debugging process.
The way things should be working:
You should have checked out your git repo that has the code for your project.
On most project types you would have done a ddev composer install after that.
Then a ddev pull pantheon would load your database with the upstream database. You can see the contents of the database with ddev mysql or by using the PhpMyAdmin UI (ddev launch -p).
The files from Pantheon will be put into your upload_dir. For example, this would be web/sites/default/files on a standard Drupal project.
BTW, the recommended environment on Windows is WSL2, you'll like it a lot in the long run.
This sort of problem would be easier to sort out in a more interactive environment, so you're invited to the DDEV Discord at https://discord.gg/hCZFfAMc5k .

Related

Install drupal project with drupal in a subdirectory

My customer a has production environment with the following folder structure:
- www
|- maresmuseum
where I only have access to these two empty folders, being the "maresmuseum" the public_folder.
I've deployed my Drupal 9 site with composer, like the project-recommended way does, you know: placing the index.php along many other core related folders & files in "maresmuseum" folder, and /vendor, /tmp and many other private stuff in the "www" folder.
As a result, I can access my website through a url like this: https://example.com/maresmuseum (I'm quite sure my customer has a .htaccess rule somewhere to accomplish that, don't you?)
Given this production scenario, and having in mind I work with DDEV on local, I want to install this site on my local machine so I can access it with a url like this: https://example.local/maresmuseum.
Of course, all inner pages of this site must follow this url pattern, something like this:
https://example.local/maresmuseum/about-us
https://example.local/maresmuseum/contact, etc..
How should I configure DDEV to accomplish that?
Thanks in advance.
I'm sure there are many ways to do this. Here's one way to do it using nginx configuration changes.
I used https://blog.rebootr.nl/drupal-8-in-a-subdirectory-with-nginx/
ddev config --composer-root=maresmuseum --project-type=drupal9 --webserver-type=nginx-fpm --docroot=maresmuseum/web --create-docroot --web-working-dir=/var/www/html/maresmuseum (This sets up to put composer.json in maresmuseum)
Install Drupal 9: ddev composer create drupal/recommended-project --no-install
ddev composer require drush/drush
Install project, or load db, or whatever, maybe ddev exec vendor/bin/drush si -y demo_umami --account-pass=admin
Edit the .ddev/nginx_full/nginx-site.conf to remove the #ddev-generated and replace the location stanza, example in https://gist.github.com/rfay/5248e5f75bf3e27d84965bfdfc69c240#file-nginx-site-conf
Edit the maresmuseum/sites/default/settings.php to add the stanza suggested in the article to the bottom, example in https://gist.github.com/rfay/5248e5f75bf3e27d84965bfdfc69c240#file-settings-php
ddev restart && ddev launch /maresmuseum
https://<project>.ddev.site/maresmuseum will work fine (as it will without the directory).
I had some trouble with browser cache, so you'll want to pay attention to that.

Why do all my browsers show error that the phpmyadmin config.js file is forbidden?

Ubuntu 20.04
Apache 2.4.41
phpmyadmin 4.9.5deb2
I can log in to phpmyadmin and see the main page where the databases are listed in the left-hand panel. But I get an error message. Using F12, I see the following error:
Failed to load resource: the server responded with a status of 403 (Forbidden) config.js:1
There is a config.js file under /usr/share/phpmyadmin/js. There are other js files in that folder that are included in the sources listed in the browser (again, using F12).
I confirmed that the config.js file has read permissions set for everyone. All the js files in that folder have the same permissions set.
I also confirmed that /etc/apache2/conf_enabled/phpmyadmin.conf links to /etc/apache2/conf_available/phpmyadmin.conf and that links to /etc/phpmyadmin/apache.conf. Neither this apache.conf nor /etc/apache2/apache2.conf deny access to config.js.
When I delete config.js, I do not get the error BUT I get other errors concerning functions that are contained in that config.js (like "Uncaught ReferenceError: isStorageSupported is not defined."). This tells me that the forbidden file is indeed this file. I renamed it and created a new empty config.js - still get the same forbidden error(fwiw).
We've been using phpmyadmin on this server since April. The error has cropped up in the last couple weeks. When I ssh'd into the server this week, it displayed a message that it needed restarted to make updates. I did not know there were auto-updates going on. I restarted, which did not help the problem. Then I updated and upgraded everything but still no help. I uninstalled (remove and purge) and installed phpmyadmin, but still no help.
My next step would be to upgrade phpmyadmin to the latest stable using a different repository (the debian repo is a little behind). But I thought I'd ask here because I have a feeling that might not help either.
I'm thinking that something changed in the server stack that isn't allowing the config.js file to be read; I just have no idea what that would be. Has anyone else seen this or something similar?
I implemented a band-aid: I copied the /usr/share/phpmyadmin/js/config.js file to config.1.js. I edited the code in /usr/share/phpmyadmin/libraries/classes/Header.php to use config.1.js instead of config.js.
No error now!
But I don't like this answer because it doesn't tell me what the original source of the problem is and how to keep it from happening again.

permission error when trying to run node server in godaddy

im trying to run a nodejs server on godaddy using the cpanel thing. i followed this tutorial, and got to the part where you run the server file. however, the server gives me a permission error.
there may be something wrong with my file structure, or the tutorial may be out of date, as my file structure differed from that in the tutorial. ex: tutorial said to go to /home/username/public_html, but my public_html folder is located on the root folder.
Update:
i just found that i could change file permissions, and enable the execute option on the node file. i'm now getting a segmentation fault error
if you need any extra information, let me know.

Log4j-Audit Getting Started fails for Catalog Editor

Was doing the Log4J-Audit getting started at https://logging.apache.org/log4j-audit/latest/gettingStarted.html
In the Catalog Editor section found some problems:
Download jar url was incorrect, missing "log4j-audit" folder
wget url was incorrect, had an extra 1.0.1 folder
git remote -v was set to ${remoteRepoUrl} instead of actual http://github.com/etc address. And the repo was not pulled. The .git folder was found but the git pull never happened. I think this might be related to proxy server but not sure if git supports a Variable.
Am I doing it wrong or are the instructions incorrect?
Where can I report such a problem?
In the end, I manually changed the
git remote set-url origin http://github.com/etc
did a manual git pull, and then the UI finally came up.
So, #1 and #2 are still a problem.
Because I have a corporate proxy server which also requires a user/password
3 was solved with adding system env vars like this
java -Dhttps.proxyHost=myProxyServer -Dhttps.proxyPort=8080 -jar log4j-catalog-editor-1.0.1.jar
It does seem that the sun.net.HTTPSClient class which is called, does not mention using Basic Auth so not convinced why it works.
A new thing I found in the Getting Started tutorial is that it's important to change the branch=master in the application.properties.

Linking in localhost(LAMP)

I am newly(about 1 month) started using LAMP and Bootstrap.
I developed a web-site that worked perfectly until I reinstalled LAMP.
Here my progress:
0. reinstalled LAMP
1. moved my "backup-ed" file to my "localhost" direction
2. I run "chmod 777 *" to each dir and file
3. When I write "localhost" to my browser(firefox) the "index.html" is running
4. When I click the link(say: index)
The browser responds:
http://localhost/undefined
Not Found
The requested URL /undefined was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Is there any way to fix this, by the way it's working(linking) perfectly when I write file:///var/www/html/index.html.
The reason why I want to use LAMP is add .php files to handle form.
Thanks
What happens when you do hit http://localhost ?
What exactly do you see?? Tried http://localhost/html
What is exactly your document root as per apache conf?
You might need to check that you are placing your files in the root directoy. It should be in the "htdocs" foler.
/opt/lampp/htdocs/
If all else fails, you can try using xampp which is another free alternative to lamp.
I get this a lot, when your browser looks for a file that is not in htaccess you get a forbidden or unfound error. The way to fix this is to make sure the link you click goes to an accessible URL. Try finding if other links in the page or scripts are overwriting your link.
Finally check if you can access it from another browser, or try to demonstrate the security of your machine. From a public library you can request an Ubuntu CD from canonical, and while you're waiting, you can visually inspect your machine for tampering.

Resources