Previous Thread
Next Thread
Print Thread
Hop To
#258749 10/01/2016 8:27 PM
Joined: Feb 2005
Posts: 21
W
stranger
stranger
W Offline
Joined: Feb 2005
Posts: 21
Aren't we supposed to do something to secure the config.inc.php file? Like something in .htaccess or moving it out of the includes directory or tightening permissions? It seemed there used to be two or three recommended steps, but now it seems like we just leave it in includes with the same 0666 permissions as the rest of the includes directory files, according to the installation documentation. Is that right? Is it secure? Doesn't it leave the database user and that user's password open for reading?

Thanks in advance,
Maria

Joined: Apr 2004
Posts: 2,032
Likes: 176
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 2,032
Likes: 176
For security reasons, Apache prevents PHP files from being downloaded so that the source code is unreadable, unless there is a server failure while you attempt the download. Normally, you'll only get the HTML output of a PHP file on your local computer as a "gift", not the source code. The config.ini.php contains only PHP code, and no HTML code.

If you locked your config.php file down at the server level with a 444, then it wont be able to be changed through the Control Panel. A CHMOD setting of 644 for that file is advised. The includes directory (IIRC) should be 755. That CHMOD setting will pass within the "Permissions Checks" control panel tool.

though via .htaccess, setting a user/password for your /admin and /templates/default directories is suggested.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.1 // wip: UBB.threads 8.1.0
isaac @ id242.com // my forum @ CelicaHobby.com
isaac #258751 10/01/2016 8:50 PM
Joined: Feb 2005
Posts: 21
W
stranger
stranger
W Offline
Joined: Feb 2005
Posts: 21
Thanks so much for your speedy help! I will take care of those things now. smile

WriteOn #258752 10/02/2016 10:19 PM
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
I have a .htaccess file in directories that the UBB does not embed files from that is:
Code
# Start .htaccess file #

# Deny viewing of .htaccess #
<Files .htaccess>
order allow,deny
deny from all
</Files>

# Don't Allow Access #
AuthType Basic
AuthName "Access Denied"
Require valid-user

# End of .htaccess file #

As there is no user listing it will always deny browsing of the directory. I use this all over my CMS, you'll find through trial and error where to place it (if it pops up when browsing your forums, then you have it in a folder that we're calling files from, such as the libs folder).


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Gizmo #258770 10/10/2016 6:33 PM
Joined: Feb 2005
Posts: 21
W
stranger
stranger
W Offline
Joined: Feb 2005
Posts: 21
Hi Gizmo, thank you for that idea. I've just moved servers and now I'm going to do the update from 7.5.8 to 7.5.9.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
8.0.1 Patch Changelog Discussion
by isaac - 11/26/2025 1:34 PM
Upgraded to ver8 - now can't login
by phoenix011235 - 10/24/2024 8:50 AM
Who's Online Now
0 members (), 399 guests, and 96 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)