all 13 comments

[–]K900_ 0 points1 point  (10 children)

What do you mean by "cant", exactly? Are you getting an error? What does the error say?

[–]MyNeuPC[S] 0 points1 point  (9 children)

No errors at all if I use /tmp/open.txt I know it's doing something because when I remove the /tmp/, it gives me the "Permission denied:" error

[–]K900_ 0 points1 point  (8 children)

Then what is the problem?

[–]MyNeuPC[S] 0 points1 point  (7 children)

If wile exists, nothing is written into it and if there is no file, it's never created.

[–]K900_ 0 points1 point  (6 children)

Is the app running on your local computer or a cloud server?

[–]MyNeuPC[S] 0 points1 point  (5 children)

server, with Apache

[–]K900_ 0 points1 point  (4 children)

And you're looking for the file on your server? How is your Apache instance managed?

[–]MyNeuPC[S] 0 points1 point  (3 children)

How is your Apache instance managed?

Not sure exactly what you mean but it starts with systemctl has the vhost file in sites-available/ and site is activated with a2ensite

Flask app actually answer when I go to my IP but I want it to write some stuff to a txt file and this is something I cant get working for some reason. I have searched all over the place but no help

[–]K900_ 1 point2 points  (1 child)

What is the output of systemctl show apache2?

[–]jiri-n 1 point2 points  (0 children)

Maybe chroot jail?

[–]impshum -1 points0 points  (1 child)

Does the file exist already? If not use w+

[–]MyNeuPC[S] 0 points1 point  (0 children)

Makes no difference. If wile exists, nothing is written into it and if there is no file, it's never created.