back story: my website stopped working when my vps host rebooted my server. this happened like 2 months ago but all i did about it was make a snarky toot. its still not working of course. because i didnt actually do anything to fix it it. kinda annoying that my toot did nothing. anyway im gonna try to fix it now
part 2: finding the log files
i dont know where any of the log files are in linux. every time i have to look them up. today im not even having much success doing that
first i tried to read the apache access.log, and then i couldn't find it, and then i realised that apache probably isn't starting up so i need to read the "startup log" to see if the service failed to start for some reason, except i dont know where that is. syslog is just full of useless garbage
part 3: i dont think i actually need log files
so im assuming the problem is that the apache2 service isnt running. i dont know how to check, and i dont want to type anything into google to find out how to check, but i DO remember the Magic Incantation:
sudo service apache2 start
which i typed, and i hit return, and it says that the service failed to start. so from that, and the fact i cant connect to my web server, well! my dear fucking watson, we can deduce that it wasnt running. probably
part 4: what does the message tell me to do
the message that the service service told me is to "see 'systemctl status apache2.service' and 'journalctl -xn' for details" so im going to type those in because it beats typing anything else into stack overflow & reading any more incorrect garbage!! ill keep u posted
part 5: what does this mean
so well. it says that the service for the web server was "loaded" and also it has a "drop-in" (whatever that is) and also theres a lil kinda ANSI line and it says "forking.conf" so i assume that's a config file that has an error in it. who knows? the only thing i can see in here which is actionable is that the solution must be something to do with forking.conf?? but maybe not, because ive never heard of that file so it can't be my fault
part 6: maybe i do need the apache log after all
so i dont think the service status program is going to tell me anything useful. i need to go straight to the source. straight in there. thats right im gonna need to go look at the apache error.log. and thats not easy. u gotta kinda pull ur own watergate break-in, by giving the computer your root password. pretty exciting stuff.
anyway. error.log is completely empty. error.log.1 does have stuff, but stops in november
part 7: ok so i need to type shit into google to solve this problem
now im typing some stuff into google. i'm typing stuff such as "find out why apache won't start" and theres some results including someone who's like "apache won't start and theres nothing in the logs" which seems to be the same problem as me!
ok their problem is that they dont have a log directory at all. and needed to create it. so thats not the same problem at all
part 8: typing more shit into google
heres some other result. https://askubuntu.com/questions/119571/where-can-i-find-messages-related-to-apache-start-up
its from ask ubuntu. and my server is debian. but i figure it should be the same right. i guess
anyway. the answer says "sudo /etc/init.d/apache2 restart" and see what error i get. im going to type that even though its pretty similar to what i've seen before
okay i just get the same error message that i get from typing sudo service apache2 start. so thats not a very valuable answer
part 9: typing in shell commands that random people on a website have suggested to someone else several years ago
someone else says:
"I wasn't getting any error messages, but source /etc/apache2/envvars && /usr/sbin/apache2 worked for me. (on Debian)"
and i typed that, and, well, it seems to have done somethin! yes, in fact, just running the apache2 executable gives me useful info. no idea how to find that info when starting it as a service, though. but im glad just running it told me stuff