Giantpaper.org

Category: The Paper

  • From Mac OS Big Sur to Monterey: The Saga

    From Mac OS Big Sur to Monterey: The Saga

    So my big, super amazing plans for GPORG that I’m been working at furiously behind the scenes (locally) at had to be put on hold.

    Apple decided to release Monterey around Halloween. And I upgraded, after reading that there’s not much of a difference between it and Big Sur (because apparently, Monterey is based of Big Sur, code-wise).

    The biggest difference I noticed is that Apple decided to remove the built-in PHP in Monterey. And to be fair, they did warn about this in Big Sur (labeling it as deprecated), but I completely forgot about this. (And honestly, having a third party PHP install means you could update it whenever you want. If you were using Mac OS’s PHP, you were at the mercy of Apple, whenever they realized PHP needs to be updated. Which was almost never.)

    After doing some searching online, I decided to install PHP from Homebrew. I ran into some 403 (Forbidden) error issues, and one of the suggestions I found online was to upgrade Apache. Except you can’t upgrade the OS’s built-in Apache for some reason. And the solution to that was to install Apache from Homebrew instead.

    I’ve been using Homebrew for about a few years now, so it wasn’t anything new to me. I already had PHP 8 installed through Homebrew. And I already knew what was involved in setting up Apache, because for some reason, whenever people upgraded between Mac OS versions (from Catalina to Big Sur, etc), the OS would completely reset your Apache settings. 🤨 I think in newer Mac OS versions, they’ve been backing up the config files, by changing the old files to something like httpd.conf__BACKUP or something (which was better than completely removing them). But even so, I needed a tutorial to figure out how to set up this install of Apache.

    I don’t remember which tutorial I followed, but I did everything by the letter, and whenever I visited 127.0.0.1, I got a “could not connect to server” error, and after tweaking the config file a little later, it turned into a 403 error. Like, wut.

    Nothing I did fixed it. For a while, I thought it was being literal and there was a problem with folder permissions. And then after reading online, someone on StackOverflow suggested it was a PHP problem. Like maybe there was a problem with the PHP install. I couldn’t tell if that was it. apachectl configtest said “Syntax OK”! And brew doctor kept giving unrelated warnings about other brew packages (and no, fixing them did not fix the problem).

    OpenLitespeed???

    At one point, I tried ditching Apache for OpenLitespeed! Because my host uses the enterprise version, I’m already pretty familiar with Litespeed servers in general, right???

    And installing it on Mac OS only gives you two options: you could either build it from source or install it through Docker. I tried it from source, because I didn’t want to go the Docker route. I barely understand Docker or its purpose, and while Docker!OLS comes with its own MySQL/MariaDB and PHP installs, I wanted to use whatever I already had installed from Homebrew, and not savvy enough to know how to get Docker!OLS to recognize the Homebrew installs, instead of the Docker versions (or if it was even possible).

    Installing from source did not work. I think I got part of it running, but 127.0.0.1 still gave the “could not connect to server” error. And didn’t know how to fix that.

    So I tried that Docker route, and while I got it running successfully, I didn’t know how to get it to recognize the folders I set up for each virtual host. And I looking through the OLS folder, I found a .env file that covered the entire server. One of the settings was for WordPress (URL specifically). So I need to have one WordPress install per server only?? Searching online for “multiple wordpress installs on openlitespeed” only brought up one page on this, and it didn’t talk about setting up multiple WordPresses on one OpenLitespeed server. 😐

    Back to Apache

    After this point, I decided that as a user, I’m pretty familiar with Litespeed. But as a server admin, I’m more familiar with Apache, and while I’m not an expert at debugging either, I’m better at debugging Apache.

    So I was back to trying the usual stuff before I even though about OpenLitespeed. Googling “mac os apache 403 forbidden” (or any combination of) showed me all search results with purple links. 😬 (As in I already visited them before, probably several times).

    I also tried uninstalling and reinstalling Apache, as suggested by someone on StackOverflow. It didn’t fix the problem, but before I uninstalled, I renamed the httpd folder to httpd_old, so I would get the default config files. However it’s set up, I wanted to see if changing as few settings as possible would fix things.

    Eventually I found this article. And it looked like the other 50 articles I read about the topic, and it’s for the built-in Apache rather than the Homebrew version, but Ctrl/Cmd+F for the heading “Losing Localhost”.

    Instructions for fixing the 403 error on Mac OS Apache.
    Screenshotted, because Gutenberg kept messing up the formatting.

    So I have at the top of my httpd-vhosts.conf file:

    Screenshot of a portion of my httpd-vhosts.conf file

    /usr/local/var/www is the default DocumentRoot for Homebrew Apache, BTW. It already has a index.html with “It Works!” text, so 🤷‍♀️.

    Another thing I did that wasn’t done after I reinstalled Apache: uncomment this line in httpd.conf:

    LoadModule userdir_module lib/httpd/modules/mod_userdir.so

    If you’re getting errors when restarting Apache (for me, it was about not finding the public_html folder), in your httpd-userdir.conf, look for this line:

    UserDir public_html

    If you try to access localhost/~username from your browser, Apache will try to look for a public_html folder in your user folder. You can either create a public_html folder in your user folder, or just change it to:

    UserDir Sites

    Since I already had ~/Sites set up from the old Apache install (pre-Monterey), I just changed it to Sites. But it can be wherever you’re keeping your local sites files on your computer.

    sudo apachectl restart

    …and Apache works again. 🥳

    Now gotta fix this huge number of PHP errors on my local sites, after jumping from PHP 7 to 8. 🙈

  • Human name prejudice

    Human name prejudice

    I was on r/namenerds, and someone was asking “What do people mean when they say a name will sound “unprofessional” on a resume?” The answer? WELLLL….

    Comment
    byu/FriendAdditional from discussion
    innamenerds
    Comment
    byu/FriendAdditional from discussion
    innamenerds
    Comment
    byu/FriendAdditional from discussion
    innamenerds

    So…when HR managers pass over a resumé with a unique/”weird” sounding name—ex. Princess, Babygirl, etc, do they assume the person picked it themselves? Because 99.999999% (number I made up) of the time, they don’t. If anything, it’s more like poor judgement on the parents than the potential interviewee.

    Comment
    byu/FriendAdditional from discussion
    innamenerds
    Comment
    byu/FriendAdditional from discussion
    innamenerds

    And in some occasions, the name might seem “new” and “weird” but is probably an old, ethnic name.

    Comment
    byu/FriendAdditional from discussion
    innamenerds

    Right. You might not be able to take a surgeon named Buddy seriously. But when Buddy is the best surgeon in the facility and you need life-saving surgery ASAP, are you really going to reject him because he has a weird name??

    Comment
    byu/FriendAdditional from discussion
    innamenerds

    (Copypasted comment below:)

    Look at it this way:

    You are hiring a babysitter for your children. Are you more likely to choose Margaret or Crystal for the position? Assuming you haven’t met them, and are going off a similar resume of ‘no professional experience, but I have watched my younger sibling(s)!’

    You are choosing a doctor. Are you more likely to choose Dr. Jack Harrison, or Dr. Jadartha Agarwal

    Typically, people like names that are familiar to them. Even if you don’t care, others will let that subconscious bias influence them.

    u/Positive-Court

    You have to remember…most people don’t actually pick their own names.

    (Although I don’t understand the hate against Crystal. 🤷‍♀️)

    Also for some people, names are like our identities, so it’s not like we can just change it. (Heck, I hate my name, but I don’t think I could find one that sounds like “me”.)

  • Bot Fight Mode!

    Bot Fight Mode!

    Hey guys, remember this status where I mentioned GPORG’s 404 logs containing more traces of bots trying to find exploits than actual 404s?

    A few days ago, I found about 20+ 404s of very suspect URLs, from the same user agent, all within the span of a minute. And while this wasn’t the first time I found this many 404s from a single bot, it did make me think, hmmmmm, maybe I should think about doing something about these exploit finding bots?

    Disclaimer: I don’t work for Cloudflare and am not an affiliate. I’m just a happy user of their free plan.

    Then I remembered seeing something about a Bot Fight Mode in their settings somewhere.

    Firewall > Bots > check the box for Bot Fight Mode

    (There is a SUPER BOT FIGHT MODE, which I guess gives you control of how it fights bots? But I don’t know anything about it, since I’m only a free user and it’s not available to me.)

    So now my 404 logs are more like this:

    Notice that 8 hour gap in between the first two 404s??? 😱

    And in Cloudflare, Firewall > Overview:

    (There were 8 pages of this, btw. Most of them from the same bot.)

    So yeah, it’s working awesomely. 👍

    (And here, this is where I would mention alternatives for people who don’t use Cloudflare just to prove that I’m not trying to push people to sign up, but sadly, I don’t know of any. Sucuri, I guess?)

    Re: Country Blocking

    Also, on another note, notice that the country says United States? This is why I don’t believe in country blocking. Not only can the bad guys mask their location, folks from the “weird” countries (like Russia, China, India, etc) might be some normal people who just want to check out your site. And also, exploit finders can also legit be from the US (or Canada, or the UK, or Australia).

    Re: IP Address Blocking

    Folks might be wondering, why just not just block the IP address? IP addresses aren’t really that permanent:

    • They can change just by someone resetting the router.
    • Those of us privacy-minded folks who use VPNs, our IP addresses change whenever we connect to a server.
    • People who make it their life’s work to find exploits on people’s sites wouldn’t use a fixed IP address. So if I were block the one in the screenshot, it would work great for about a day (whenever bots switch IPs), then when the bot moves onto a new address, the old one (52.142.62.44) could end up with some poor shmoe, who is now blocked from my site even though they didn’t do anything wrong.

    For me, the answer to great WordPress security is:

    • using strong passwords (randomly generated 20+ character string of upper and lowercase letters, numbers and special characters) stored in a trusted password manager
    • 2FA if able
    • using reputable plugins and themes
    • removing unused plugins and themes
    • getting a good security plugin (I like WordFence, but I hear a lot of good things about Sucuri)

    ^Not a complete list, btw.

    – THE END –

  • Facebook’s double standards

    Facebook’s double standards

    Apple reportedly threatened to boot Facebook from the App Store over human trafficking concerns

    Linking to the reddit post instead of the article itself, which is paywalled. Here’s a summary:

    Comment
    byu/chrisdh79 from discussion
    intechnology

    Let’s read the comments instead!

    Comment
    byu/chrisdh79 from discussion
    intechnology

    Facebook finds boobies more offensive than child trafficking. 😑

    Comment
    byu/chrisdh79 from discussion
    intechnology

    Facebook apparently launched itself in the afterlife. 😐

    Comment
    byu/chrisdh79 from discussion
    intechnology

    Uhh…..

    Dear Apple, you want to ban Facebook from your App Store?

    Wake me up when we get a decentralized alternative to Facebook 😩