Welcome to the Android Enthusiasts, Majk! We support end-users with Android-specific issues, but cannot help you setting up a Linux server on a device, though it was running Android before. Still, some helpful hints:
- There are means to control your device even with a broken screen. We've got several issues reported where people wanted to do exactly that. Please check e.g.:
- My screen got broken, how to see on the computer what I'm doing in my device?My screen got broken, how to see on the computer what I'm doing in my device?
- Control Android with broken screen from PCControl Android with broken screen from PC
- Use android phone with broken screen as WiFi cameraUse android phone with broken screen as WiFi camera
- Broken Screen + Using adb shell to run vnc serverBroken Screen + Using adb shell to run vnc server
- There are several web server apps available for Android as well. Even some supporting/including things like PHP and MySQL. Some examples:
I guess that should get you started if you want to solve your issue using Android. And as I initially wrote: Doing that with any other OS, even on an "Android device", is beyond the scope of this site. But I would wonder if you will really need that, after these details – right? :)