Skip to content
← Back to Community
Apache Server on Repl.it!
Profile icon
programmeruser

svg files cannot be displayed: https://upload.wikimedia.org/wikipedia/commons/d/db/Apache_HTTP_server_logo_%282016%29.svg
I've gotten the Apache Server to work successfully on repl.it. (PHP doesn't work currently, for some strange reason it can't find the apache php package.)
Edit: PHP now works!
Edit 3/22/2022: there might be a better solution with Nix, but I haven't got it to work yet (idk how services with Nix work)

Voters
Profile icon
lu700
Profile icon
GarrySmith1
Profile icon
UnknownLITE
Profile icon
ABOS2020
Profile icon
Polo1245Ofi
Profile icon
Baconman321
Profile icon
programmeruser
Comments
hotnewtop
Profile icon
GarrySmith1

Thanks !

Profile icon
programmeruser

@GarrySmith1 you might want to consider making a better version with the new Nix package manager that was added to Replit since this uses old, hacky methods that aren't really the best (though I haven't tried using Nix for this yet).

Profile icon
xNotKing

@programmeruser you should make this with nix, and please, can you tell me how can I add extensions like PDO ?

Profile icon
ABOS2020

I have completely copied the Apache2 folder files onto my project and when I run "bash apache2/start-apache.sh" in shell it works, but here is where the problem exists. The apache thing works for about 5 minutes before it randomly turns off and so to use it again I have to rerun "bash apache2/start-apache.sh." I am no coding expert but your help may save me a lot.

Profile icon
programmeruser

@ABOS2020 what's in the logs?

Profile icon
ABOS2020

@programmeruser apache.log (it is copied from here) or what console shells when I run "bash apache2/start-apache.sh" command?

Profile icon
programmeruser

@ABOS2020 apache.log

Profile icon
ABOS2020

@programmeruser I don't think anything changed as all I did was copy the files from this repl. BTW I am using html to code, if you believe that might be the problem.

Profile icon
UCYT5040

How do I specify the path the server should run in? I have a folder called public, can I just run it in there? I don't want other files seen.

Profile icon
programmeruser

@UCYT5040 change $APACHE_DOCUMENT_ROOT

Profile icon
UCYT5040
Profile icon
programmeruser

@Baconman321 PHP now works.

Profile icon
Baconman321

@programmeruser Oh, cool!

Profile icon
Baconman321

@programmeruser It's a shame that people don't care about PHP :(

Profile icon
Battledash2

PHP has potential but everyone is saying that it's either outdated or bad which makes new developers not like it.. It's just all the bad developers giving bad influence on new developers.. @Baconman321

Profile icon
Baconman321

@Battledash2 Yeah.

Personally though, without some other server management service, PHP is kinda bad. I mean, sure it's simple and all, but it needs a server to work with because it is bad at handling redirects and such; Apache is much better with that.

Profile icon
Battledash2

Yeah.. PHP + Apache is good.. But... I'd rather use Node anytime tbh.. PHP is good though, I've made a few websites with it. It was easy to use and straight forward. I'd rather use NodeJS just because I'm more used to it, not because PHP is bad (it's not bad) @Baconman321

Profile icon
Baconman321

@Battledash2 Yeah. In fact, it's a good idea to know it since so many hosting services might offer PHP as a main language (that said, it doesn't meant that you shouldn't learn another language).

Profile icon
Battledash2