Click here for "Error Codes for Commercial Air Conditioners".

CentOS7.6 WEB Server Deployment 

1.Install Apache httpd 2.4

Install a web server (Apache2.4) to display the web site.

Installation Requirements
♦Use the latest version of Apache 2.4, 2.4.41
♦Install Apache in /usr/local/src (the standard installation directory as is customary for Linux when installing from source)
♦Installation directory for documents to be published on the Web /var/www/html/
♦Using Virtual Hosts

Before installing Apache, install the necessary libraries.

1.1  Install APR, APR-util, and expat-devel

①Install APR (latest version is 1.7.0)

②Install APR-util (latest version is 1.6.1)

③Install expat-devel
When compiling apr-util 1.6.0, if you have not installed the "expat-devel" package, you may get the following error.

xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: fatal error: expat.h: There are no such files or directories.
#include <expat.h>
Stopped compiling.。 make[1]: *** [xml/apr_xml.lo] error 1
make[1]: directory`/usr/local/src/apr-util-1.6.0' It's coming from
make: *** [all-recursive] error 1

1.2 Install Apache 2.4 (latest version is 2.4.41)

Downloading and Deploying Apache 2.4

Compiling and installing

Typical Examples of Apache Compilation and Installation Options
Options for Apache Installation

Option Details
--with-layout=[F:]ID Use the installation path layout ID obtained from file F
--target=TARGET Install the associated file using the name specified in TARGET
--prefix=PREFIX Install Apache (command) in the directory specified by PREFIX.
--exec-prefix=EPREFIX Install httpd (daemon) in the directory specified by EPREFIX.
--bindir=DIR Specify the bin directory by DIR
--sbindir=DIR Specify the sbin directory by DIR
--libexecdir=DIR Specify the libexec directory by DIR
--mandir=DIR Install man (manual) in the directory specified by DIR.
--sysconfdir=DIR Install the configuration file in the directory specified by DIR.
--datadir=DIR Install the data files in the directory specified by DIR.
--iconsdir=DIR Install the icon files in the directory specified by DIR.
--htdocsdir=DIR Set the directory specified by DIR as a document file (index to be published via http).
--cgidir=DIR Set the directory specified by DIR as the CGI directory.
--includedir=DIR Install the include files in the directory specified by DIR.
--localstatedir=DIR Install the modifiable data files in the directory specified by DIR
--runtimedir=DIR Install the runtime data in the directory specified by DIR.
--logfiledir=DIR Install the log file in the directory specified by DIR.
--proxycachedir=DIR Install the proxy cache data in the directory specified by DIR

⑤Configuring Apache (editing httpd.conf)
Whole apache configuration
Range-specified configuration (per directory, file, path, etc.)
The range specification is done in a section container, and the settings outside the section container become the overall apache settings.
The following range of <Directory "/usr/local/apache2/htdocs">~</Directory> is the section container.

In httpd.conf.
# Specify by directory -- <Directory>
# Specify by file -- <Files>
# Specify by path -- <Location>
# Load other configuration files -- Include
<Directory "/usr/local/apache2/htdocs">
# Setting contents
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
⑥Create a web publishing directory
⑦Automatic start-up setting
You now have a minimum of Apache installed.

2.PHP7 Installation

2.1. Download and install the required libraries.

Download

Install

2.2 Download and install PHP

2.3 Edit Apache configuration file to work with Apache

Associates the extension (.php) used in PHP with PHP. By registering, when a file with the extension (.php) is accessed, the result of the execution using PHP will be returned to the client. Put the following at the end of the "httpd.conf" file

AddType application/x-httpd-php .php

2.4 Edit PHP configuration file

タイトルとURLをコピーしました