Crystal, I really appreciate the detailed explanations and step by step instructions. I was able to follow everything without a problem and was able to finally access the python file from a web browser.
On Monday, December 19th, 2022 at 11:07 AM, Crystal Kolipe <kolip...@exoticsilicon.com> wrote: > # mkdir /var/www/usr/local/lib/pyton3.9 > # mkdir /var/www/usr/local/include/pyton3.9 A slight correction to the lines above in case anyone comes across this in the future. The above lines should be: mkdir -p /var/www/usr/local/lib/python3.9 mkdir -p /var/www/usr/local/include/python3.9 > The /var/www/usr/local/lib path is not being searched for dynamic > libraries when you try to run the python interpreter within the > chroot. The easiest way to 'make it work' is to move the files > you just copied to /var/www/usr/local/lib/ to /var/www/usr/lib/ > instead. I think the first sentence makes sense to me. While trying to search for a solution to the 'ld.so' error, a lot of the solutions recommended two possible solutions. The first was to add '/var/www/usr/local/lib' to the library search path with 'export LD_LIBRARY_PATH=/usr/lib:/var/www/usr/local/lib'. The second was to attempt the same thing with 'ldconfig /var/www/usr/local/lib'. Neither of these seemed to work, so not sure why. Also, I don't really understand why your solution worked. > The first thing to understand is that there are several ways to > do what you want to do. Quite a lot of different ways, actually. > That's ONE way of doing it. Definitely NOT the best way for a > real application, but if you're just learning this then it's > probably the easiest^Wleast difficult way in. > Putting python in the chroot is ONE way of doing it. > > It's not the best way in general. But it might be the best way for > you, if you're trying to get an introduction to doing these things. I understand why putting python(1) in chroot is a bad idea. Therefore, what are the other possible options? When I was searching online, I couldn't find anything that didn't involve moving python(1) into chroot, so I'm not sure how to even find another possible solution, let alone a list of them analyzing the pros and cons of each. Again, I really appreciate your help. With it working now, I can start writing some python web apps. Just to be clear, this will not be on a production machine. It's on a non-networked machine that I'm just using to learn that has a web browser installed. However, even though my problem has been solved, I'd like to understand the proper way to configure this.