A)Basics_of_Apache_and_install_WP.md
Apache¶
Apache is one of the world’s most popular web servers. Apache is open-source software that is maintained by the Apache Software Foundation. It is available for a wide variety of operating systems, including Unix, Linux, and Windows. Apache is a "good old" web server that has been around for a long time and is known for its stability and out of the box compatibility.
Apache is known for "all in one" solution, it can be used as a web server and part of a LAMP stack. LAMP stands for Linux, Apache, MySQL, and PHP. It is a combination of open-source software that is typically installed together to enable a server to host dynamic websites and web apps.
LAMP stack is still a popular choice for some developers and system administrators who need a reliable stack for hosting web applications. LAMP stack is more of good reliable choice than a super modern and cutting edge stack.
Illustration: Important Apache paths (filesystem map)¶
/
└── etc/
└── apache2/
├── apache2.conf
├── sites-available/
├── sites-enabled/ -> symlinks to enabled vhosts. Use a2ensite and a2dissite to manage these.
├── conf-available/
└── conf-enabled/
/
└── var/
├── www/html/ -> default DocumentRoot for Apache. This is where your website files go.
└── log/apache2/ -> Apache log files
├── access.log
└── error.log
Meaning of /¶
Note that the / character in the paths above represents the "root" of the running system or proses. So what is root for apache? Go back and read AGAIN where is the Documentroot. Documentroot = / = /var/www/html/ for apache. So when you go to http://MachineIP/wordpress/ you are actually going to /var/www/html/wordpress/ folder.
So /THING can be separation to alias or document path from Documentroot.
Apache server directories and files.¶
The actual web content, which by default consists only of the Apache start page you saw earlier, is served from the /var/www/html directory. This can be changed by modifying Apache configuration files.Server Configurations
Apache configuration directory. All Apache configuration files are located here.
Apache’s main configuration file. This can be modified to change the general configuration of Apache.Directory where site-specific server blocks can be stored. Apache does not use configuration files found in this directory unless they are linked to the sites-enabled directory. Typically, all server block configurations are done in this directory and then enabled by linking to another directory.
Directory where enabled site-specific server blocks are stored. Typically, these are created by linking to configuration files found in the sites-available directory. Directories that contain additional configuration snippets which manage modules, global configuration fragments, or virtual host configurations, respectively. Every request to your web server is recorded in this log file unless Apache is configured to do otherwise. This log file will have all errors and warning messages from Apache service.Managing Apache Processes¶
Now that your web server is up and running, let’s look at some basic management commands.
Start the web server when it is stopped by typing:
Stop the web server by typing:
Stop and (re)start the service by typing:
If you’re just making configuration changes, Apache can often reload without dropping connections. Changes will take effect immediately, and your site will remain online. This has the advantage of not breaking existing connections during a reload, but has the disadvantage of sometimes not applying all the changes.
By default, Apache is configured to start automatically when the server boots. If you don’t want this, you can disable this behavior by typing:
You can re-enable the service to start up at boot by typing: