Back

IT-WST05

Protecting Your Database and Server (Part 1)

Document

What is a Server?

A server is a computer program or device that provides a service to another computer program.

Server vs. Personal Computer

FeaturePersonal ComputerServer
Use TimeNot built to run continuouslyBuilt to run continuously
StorageConsumer disks (HDD or SSD)Hot-swappable drives (disks you can replace while running) and RAID (a system using many disks to protect data)
ProcessorIntel Core (i5, i7, i9) or AMD RyzenIntel Xeon
SoftwareWindows 10/11 or standard LinuxWindows Server, Red Hat Enterprise Linux, or FreeBSD

Databases and Web Tools

  • Database: A neat collection of organized information stored in a computer system.
  • DBMS: A Database Management System (DBMS) is the software used to control a database. Examples include MySQL, Oracle, and MongoDB.
  • Web Server (Apache): Software that shows website content by processing and sending webpages to users.
  • PHP: A coding language (scripting language) used for web development that fits inside HTML.
  • XAMPP: A tool that includes Apache, MariaDB, PHP, and Perl.
  • MariaDB: A database that works just like MySQL but is slightly faster for searching and copying data.

Important Server Settings (php.ini)

Changing these settings helps keep your server safe.

SettingDefaultNew Security Setup
display_errorsOnOff (hides code errors from users)
expose_phpOnOff (hides that you are using PHP)
allow_url_fopenOnOff (stops the server from opening outside links)
memory_limit(limits the memory a script can use)
max_execution_time(stops scripts if they run too long)

Using .htaccess for Control

The .htaccess file handles specific tasks for your website:

  • Moving users to a different page (redirecting).
  • Blocking users by their IP (Internet Protocol address).
  • Making website addresses (URLs) look cleaner.

URL Cleaning Example

You can use a command (directive) called RewriteRule to hide file endings:

  • RewriteEngine On: Turns on the tool that changes URLs.
  • RewriteCond %{REQUEST_FILENAME} !-f: Checks if the requested name is not a real file.
  • ^([^\.]+)$: A pattern that looks for text without a period.
  • $1.php: Adds ".php" to the end of the web address automatically.

This document is a summary of the original lesson material. It was organized using an AI tool to help with study and review. While every effort was made to stay accurate to the source, please check your original files for complete details and to avoid potential errors.