Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "httpd"
The website for our biggest client went down and the server went haywire. Though for this client we don’t provide any infrastructure, so we called their it partner to start figuring this out.
They started blaming us, asking is if we had upgraded the website or changed any PHP settings, which all were a firm no from us. So they told us they had competent people working on the matter.
TL;DR their people isn’t competent and I ended up fixing the issue.
Hours go by, nothing happens, client calls us and we call the it partner, nothing, they don’t understand anything. Told us they can’t find any logs etc.
So we setup a conference call with our CXO, me, another dev and a few people from the it partner.
At this point I’m just asking them if they’ve looked at this and this, no good answer, I fetch a long ethernet cable from my desk, pull it to the CXO’s office and hook up my laptop to start looking into things myself.
IT partner still can’t find anything wrong. I tail the httpd error log and see thousands upon thousands of warning messages about mysql being loaded twice, but that’s not the issue here.
Check top and see there’s 257 instances of httpd, whereas 256 is spawned by httpd, mysql is using 600% cpu and whenever I try to connect to mysql through cli it throws me a too many connections error.
I heard the IT partner talking about a ddos attack, so I asked them to pull it off the public network and only give us access through our vpn. They do that, reboot server, same problems.
Finally we get the it partner to rollback the vm to earlier last night. Everything works great, 30 min later, it crashes again. At this point I’m getting tired and frustrated, this isn’t my job, I thought they had competent people working on this.
I noticed that the db had a few corrupted tables, and ask the it partner to get a dba to look at it. No prevail.
5’o’clock is here, we decide to give the vm rollback another try, but first we go home, get some dinner and resume at 6pm. I had told them I wanted to be in on this call, and said let me try this time.
They spend ages doing the rollback, and then for some reason they have to reconfigure the network and shit. Once it booted, I told their tech to stop mysqld and httpd immediately and prevent it from start at boot.
I can now look at the logs that is leading to this issue. I noticed our debug flag was on and had generated a 30gb log file. Tail it and see it’s what I’d expect, warmings and warnings, And all other logs for mysql and apache is huge, so the drive is full. Just gotta delete it.
I quietly start apache and mysql, see the website is working fine, shut it down and just take a copy of the var/lib/mysql directory and etc directory just go have backups.
Starting to connect a few dots, but I wasn’t exactly sure if it was right. Had the full drive caused mysql to corrupt itself? Only one way to find out. Start apache and mysql back up, and just wait and see. Meanwhile I fixed that mysql being loaded twice. Some genius had put load mysql.so at the top and bottom of php ini.
While waiting on the server to crash again, I’m talking to the it support guy, who told me they haven’t updated anything on the server except security patches now and then, and they didn’t have anyone familiar with this setup. No shit, it’s running php 5.3 -.-
Website up and running 1.5 later, mission accomplished.6
I have never doubted my abilities more, before this happened:
I got a Linux VM on Azure, downloaded apache httpd source which I proceeded to configure, make and install.
As expected, install failed with something related to apr and apr-util.
Searched several mailing lists, tried out several configure options, nothing worked..
After almost an hour, it stuck to me, all I had to do was "sudo yum install httpd" !!!
Disappointed that I missed something so simple, but when I did that, it came back with 'Nothing to do'...
Realized, httpd was pre-installed in that VM.. I just had to start the service !!!
So my host of choice decided to migrate an old site to a new set of IPs without warning yesterday, down side to a VPS I guess.
Now this wouldn’t be an issue if it wasn’t on a dedicated IP you wankers.
DNS won’t resolve to new location yet and Virtual hosts contained the old IPs and for some fuck of a reason the httpd file is auto generated 😡so updating it will be lost on reboot.
Like What the flying fuck you imbeciles, this site has been up and running for 5+ years on this IP.
I barely do any maintenance for t as it’s just an old horse sitting on the web but fuck you don’t need to fuck with it or atleast give some fucking warning before you go drop it offline 😡1
In today's episode of kidding on SystemD, we have a surprise guest star appearance - Apache Foundation HTTPD server, or as we in the Debian ecosystem call it, the Apache webserver!
So, imagine a situation like this - Its friday afternoon, you have just migrated a bunch of web domains under a new, up to date, system. Everything works just fine, until... You try to generate SSL certificates from Lets Encrypt.
Such a mundane task, done more than a thousand times already... Yet... No matter what you do, nothing works. Apache just returns a HTTP status code 403 - Forbidden.
Of course, what many folk would think of first when it came to a 403 error is - Ooooh, a permission issue somewhere in the directory structure!
So you check it... And re-check it to make sure... And even switch over to the user the webserver runs under, yet... You can access the challenge just fine, what the hell!
So you go deeper... And enable the most verbose level of logging apache is capable of - Trace8. That tells you... Not a whole lot more... Apparently, the webserver was unable to find file specified? But... Its right there, you can see it!
So you go another step deeper and start tracing the process' system calls to see exactly where it calls stat/lstat on the file, and you see that it... Calls lstat and... It... Returns -1? What the hell#2!
So, you compile a custom binary that calls lstat on the first argument given and prints out everything it returns... And... It works fine!
Until now, I chose to omit one important detail that might have given away the issue to the more knowledgeable right away. Our webservers have the URL /.well-known/acme-challenge/, used for ACME challenges, aliased somewhere else on the filesystem - To /tmp/challenges.
See the issue already?
Some *bleep* over at the Debian Package Maintainer group decided that Apache could save very sensitive data into /tmp, so, it would be for the best if they changed something that worked for decades, and enabled a SystemD service unit option "PrivateTmp" for the webserver, by default.
What it does is that, anytime a process started with this option enabled writes to /tmp/*, the call gets hijacked or something, and actually makes the write to a private /tmp/something/tmp/ directory, where something... Appeared as a completely random name, with the "apache2.service" glued at the end.
That was also the only reason why I managed fix this issue - On the umpteenth time of checking the directory structure, I noticed a "systemd-private-foobarbas-apache2.service-cookie42" directory there... That contained nothing but a "tmp" directory with 777 as its permission, owned by the process' user and group.
Overriding that unit file option finally fixed the issue completely.
I have just one question - Why? Why change something that worked for decades? I understand that, in case you save something into /tmp, it may be read by 3rd parties or programs, but I am of the opinion that, if you did that, its only and only your fault if you wrote sensitive data into the temporary directory.
And as far as I am aware, by default, Apache does not actually write anything even remotely sensitive into /tmp, so...
I wasted 4 hours of my life debugging this! Only to find out its just another SystemD-enabled "feature" now!
And as much as I love kidding on SystemD, this time, I see it more as a fault of the package maintainers, because... I found no default apache2/httpd service file in the apache repo mirror... So...9
After spending 8 hours straight trying to install and configure the LAMP stack + WordPress on Linux in vain, this comes as a pleasant surprise. I guess I am officially a part of this now. Minus being able to set up a local dev environment... Fuk.6
So Apache and I don’t seem to understand one an other.
# sudo service httpd restart
I’m still here waiting for this fucking useless thing too turn off 10 minutes later.
I’m starting to think it would have been easier to reboot the entire server.6
Doing things on Linux is so fucking hard when you don't know what you are doing. I have spent the past 3-4 hours trying to build httpd from source (good learning experience, eh?), trying to follow the documentation to the letter, and the curveballs keep on coming one after another after another. You need to know this, and to understand that, and install this, and configure that. AAAARGH! I am learning though...8
Fuck who ever put the `hosts` file in that path WHICH IS IMPOSSIBLE TO REMEMBER!
and then fuck who put the httpd-vhosts.conf in a totally different path that is impossible to remember!8
Going to build a blog and use the process as an opportunity to learn a full stack. The question is: LAMP or MEAN or smth else?
I have more (albeit very limited) experience with LAMP so the ecosystem seems a bit more transparent. PHP connected to httpd via PHP-FPM. WordPress with MySQL for the blog posts. Or go flat-file with Statamic. Then shared hosting, FTP, etc. But it's all a bit old school and it seems like the grass is greener and growing faster in the fancy JS garden. And JS for front and back sounds appealing as a learning investment.
But with a JS full stack, I don't even know where to start. I know some basic vanilla JS (about as much as I know PHP). Node, Express, Angular? Never touched 'em. But it seems like if you're gonna dive in and learn some web dev in 2019 these are the things to learn, no? Still more questions: how the hell do you build a blog with JS? Do you need a CMS? Flat-file? And how do you host/deploy that stuff? Droplets, virtual machines, containers? Heroku? Digital Ocean?
Can anybody shed any light? I am not trying to overwhelm myself with a stack too complex for a blog (MEAN), nor shoot my future self in the foot learning fading technologies (LAMP).8
Someone send help. IBM has taken over my village. They're brainwashing the children; they wont use any packages that don't end in 'd'!2
Can't tell if this is a mistake in the documentation or just weird logic. Can anybody confirm if this is correct or backwards?
Link to docs: http://httpd.apache.org/docs/2.4/...4
Starting my first small c++ project with website interaction on an Ubuntu server as practice for next semester. Any good recommendations to get user input from a webpage using only c++ (there can be html within the c++ program of course) and libraries?
I have once worked with an httpd-deamon and got user info from the url but I want a user to be able to fill in 2 textboxes and submit them using a button.
Plain text is good enough and it will only be used by 2 people once every week or so.8