Providing resources for people with a passion for Christ and the web
Welcome!
Articles :: Web Technologies

Web Server Basics - Apache, MySQL and PHP


Customizing Your Web Server
Headings
  1. Apache
  2. MySQL
  3. PHP
Each of the major LAMP components can be customized and you should understand how this is accomplished.

Apache

We're going to start with Apache - it has 2 different methods for controlling how it behaves. Both ways involve configuration files. The first is httpd.conf and is the primary configuration for the server. On your local installation of XAMPP, look for httpd.conf in xampp/apache/conf/. It has an unusual extension, but it is just a text file and can be opened with any word processor or text editor. If you open it, you will find a lot of information that is pretty well commented (lines starting with a # are comments). At the beginning of the file are a few links directing you to additional documentation about Apache and the various directives contained in httpd.conf.
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# for a discussion of each configuration directive.
Any changes made to this file require full access to the server and the changes will not go into affect until you restart Apache. Unless you have a dedicated server or a virtual private server, you probably will not have access to this file.

Apache also has another configuration file that you will, most likely, be able to edit and use to control how Apache behaves - these are .htaccess files (no file name, just the . and htaccess extension). htaccess files have the same basic structure as httpd.conf, but have a limited number of directives that can be placed in them. You can also have more than one .htaccess file - an .htaccess file will affect the directory it is in, plus all subdirectories under that directory. So, if you want different rules (directives) for different directories, create separate .htaccess files for each directory. Apache does not need to restart to apply the directives found in an .htaccess file - the directives are applied the next time files are requested from the directories affected by the .htaccess file.

MySQL

The database engine also has a configuration file - my.cnf. In XAMPP, you will find it in xampp/mysql/bin/. Again, despite the extension, this is just a text file.Take a look at it, but there will be very few things you will change or request to have changed in your MySQL configuration.

PHP

Last, but not least, is the PHP configuration file - php.ini. If you are looking for the configuration file in XAMPP, you will find it in xampp/php/. Depending on how PHP is installed on your web server, you will have different options for changing the PHP configuration.

In common installations PHP will run as an Apache module - in that case, you can make adjustments to your PHP configuration by editing the main php.ini file, or by using htaccess files. Just like with Apache, not all configuration changes are allowed in htaccess files and editing the main php.ini requires full access to your server.

The second type of installation has PHP running separately. In those cases, you can alter the configuration in the main php.ini file, or place additional php.ini files in directories where you want added control. Trying to control PHP installed in this way by including statements in an htaccess file will result in server errors. Making changes to the main php.ini file requires full access to your web server and restarting Apache, which will reinitialize PHP. If you are modifying PHP through .htaccess files or local php.ini files, they are executed when the folders are accessed, but not all changes are possible through the local php.ini files.

While this is, by no means, an exhaustive review of Apache, MySQL and PHP, I hope this has brought you some insight to the inner workings of your web site.
Subtitles
  1. LAMP/WAMP
  2. Customizing Your Web Server
Pages:
<< Securing Your Website An Effective Solution for Church Web Sites >>
Trackback
  • URL: https://www.christianwebresources.net/modules/article/view.article.php?c1/14
  • Trackback: https://www.christianwebresources.net/modules/article/trackback.php?14
API: Toolkit PM Email PDF Bookmark Print | RSS | RDF | ATOM
Copyright © Steve & Christian Web Resources
The comments are owned by the poster. We aren't responsible for their content.

Bookmark and Share!

Join Us On Facebook

Find Us on the Socials

Facebook Christian Web Resources LinkedIn page YouTube