MyBB Community Forums

Full Version: Setting up .htaccess Block
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to block access to my site for a bit while I disable my plugins, including security, while I preform an update. I've had issues with bots before and I'm afraid of them making a bunch of new accounts while I do. More so then annoying my users as I'm doing this when actual people aren't around. I found a list of htaccess commands, but I don't know if I have Apache 2.2, Apache 2.4, or Nginz servers. I'm afraid I didn't set up my website myself and I've never done this before. I would settle for disabling new members for a bit, but I can't remember how I did it, as the spam bot issues were years ago as the plugins have been stopping them.

I found a .htaccess in my file manager if that helps. Here is what it says.

# Use PHP52 as default
AddHandler application/x-httpd-php52 .php
##<IfModule mod_suphp.c>
  #  suPHP_ConfigPath /opt/php52/lib
#</IfModule>
You can go in to your ACP and close your board so all visitors except Administrators will get an on screen message defined by you.

https://community.mybb.com/thread-5461.html
Here's a tool that may distinguish server software, although it doesn't tell me I'm running 2.4
https://dnschecker.org/website-server-software.php

If you have access to the server itself, here's a link.
https://serverguy.com/servers/how-to-che...of-apache/

This at the beginning of your .htaccess will block everyone but you. Make sure your IP address is stable.

# works for apache 2.4
Require all denied
Require ip xx.xx.xx.xx

# works for apache 2.2
 order deny,allow
 deny from all
 allow from xx.xx.xx.xx
(2021-03-23, 05:56 AM)Ben Wrote: [ -> ]You can go in to your ACP and close your board so all visitors except Administrators will get an on screen message defined by you.

https://community.mybb.com/thread-5461.html

The upgrade instructions recommended I don't do that.

https://docs.mybb.com/1.8/install/upgrade/
You could temporarily disable registrations in your configuration settings - Login and Registration Options - Disable Registrations.  If not mistaken, closing the board will do that anyway.

For most upgrades, I always restrict access by IP too.  Because an admin could come on and try to post or something else.  We used to have some non-technical admins I'd worry about.  More like owners really - long story.  Huh

But you need to know your web server type and version - so I'd make a point of finding out.  Should be available in your panel, or host support will know.
That's why it wants you to do the htaccess block? Well I don't need to worry about that. I'm afraid my admins aren't exactly active these days.
Big Grin

Just checked on our test board.  While closed, the register link is non-responsive.  Regular members can login, but not navigate the forum or do anything.  All the while getting the board closed message specified in the ACP.  Admins can see the board is closed, but otherwise not restricted in any way.  This is on 1.8.26.

Updates requiring the upgrade script I prototype in our test system.  Depending on the time it takes, and eyeballing the changes - tend to make a call on restricting access via IP.  This might not be the right answer, but has worked so far.  But always hesitant to ignore official docs. Confused
(2021-03-25, 10:46 AM)nixer55 Wrote: [ -> ]Big Grin

while unrelated to thread content, I have been simply curious for a while due to your handle, were you ever on say the linspire/lindows/freespire then ubuntu loco teams, cuz for some reason your handle is reminding me of someone (whom hailed from bc) back in those days regardless if la jolla was ages ago, haha, hence I just had to ask, if not no worries Wink
(2021-03-25, 10:53 AM)censor_deeznutz Wrote: [ -> ]while unrelated, I have been curious for awhile due to your handle, were you ever on say the linspire/lindows/freespire then ubuntu loco teams, cuz for some reason your handle is reminding me of someone back in those days, hence I just had to ask, if not no worries Wink

As mentioned in my profile, I've been around a (fearfully) long time.  Participated in a few Linux boards back in the day, but honestly don't remember exactly which.

BTW, fan of your CSS skills.  Not something that was common when I was writing code.  Once stated on our board - last time I wrote meaningful code - dinosaurs roamed the earth. Toungue
(2021-03-25, 11:03 AM)nixer55 Wrote: [ -> ]As mentioned in my profile, I've been around a (fearfully) long time.  Participated in a few Linux boards back in the day, but honestly don't remember exactly which.

BTW, fan of your CSS skills.  Not something that was common when I was writing code.  Once stated on our board - last time I wrote meaningful code - dinosaurs roamed the earth. Toungue

cool beans, thanks for the response and I knew I liked the way you think, hahaha, thanks I did need a good chuckle this morn, would be funny to find if we crossed paths back then.. and while I did try to look up the particular handle holder last time I was up in Nanaimo and Whisteler/Alpine, that also was ages ago and was not successful, haha.