MariaDB installation, Apache installation

MariaDB installation:

cd /usr/local/src 
 

            wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz = Download the mariadb installation package (you can directly Using this download address, you can also go to the official website to find the download package official website: downloads.mariadb.com)

tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz = unzip the download package
 

mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb = move file and rename
 

cd /usr/local/mariadb = enter the renamed directory
 

 ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb    =初始化
 

 cp support-files/my-small.cnf /usr/local/mariadb/my.cnf = copy the mariadb configuration file and rename it
 

 vi /usr/local/mariadb/my.cnf //Define basedir and datadir = define file path
 

 cp support-files/mysql.server /etc/init.d/mariadb = copy startup files  
 

 vim /etc/init.d/mariadb //Define basedir, datadir, conf and startup parameters = modify the startup file and define several parameters
 

 /etc/init.d/mariadb start = start the service

chkconfig --add mariadb join boot

Start MariaDB and see if there are mysqld services starting before starting. If they are, they will conflict because their listening ports are the same

https://downloads.mariadb.org/mariadb/10.3.5/ = mariadb download address

 

 

Apache installation:

First download the three installation packages and unzip them after downloading

2.2 source package:  http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz
2.4 source package:  http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29 .tar.gz
apr:  http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
apr-util:  https://mirrors.cnnic.cn/apache/apr/apr-util -1.6.1.tar.gz

tar zxvf http-2.4.27.tar.gz

tar zxvf apr-1.5.2.tar.gz

tar zxvf apr-uti-1.5.4.tar.gz

Apache installation conditions: gcc package, pcre package, apr and apr-util must be installed first;

Install the gcc plugin package first, yum install -y gcc and then you can install other packages.

install apr-1.6.3

cd apr-1.6.3/
./configure --prefix=/usr/local/apr     
After installation, check whether the command is running normally echo $?
make && make install Check whether the command is correct and then install

install apr-util

cd /usr/local/src/apr-util-1.6.1/

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make && make install

Check the installation step by step like installing apr above, but installing apr-util requires formulating apr

 

Troubleshooting

Error:

xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory

Then search for the prompt expat
yum list |grep -i expat

[root@aming-01 apr-util-1.6.1]# yum list | grep -i expat
expat.x86_64                                2.1.0-10.el7_3             @anaconda
expat.i686                                  2.1.0-10.el7_3             base     
expat-devel.i686                            2.1.0-10.el7_3             base     
expat-devel.x86_64                          2.1.0-10.el7_3             base     
expat-static.i686                           2.1.0-10.el7_3             base     
expat-static.x86_64                         2.1.0-10.el7_3             base 

Install the expat-devel package

yum install -y devel.x86_64  (see system installation for 32-bit and 64-bit systems)  

After installing the expat package, re-execute make && make install

 

install httpd

cd /usr/local/src/httpd-2.4.29/

./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so -- enable-mods-shared=most (the first error will occur here = error 1)

make && make install (there will be a second error = error 2)

 

Troubleshooting

Error 1:

checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

Hint: Missing PCRE package

Solution: query and install pcre

yum list |grep -i pcre

yum install -y pcre-devel.x86_64 (x86 for 64-bit systems and i686 for 32-bit systems are installed according to system requirements)

Error 2:

collect2: error: ld returned 1 exit status
make[2]: *** [htpasswd] error 1
make[2]: leaving directory "/usr/local/src/httpd-2.4.29/support"
make[1]: *** [all-recursive] error 1
make[1]: leaving directory "/usr/local/src/httpd-2.4.29/support"
make: *** [all-recursive] error 1

 

Solution:
delete the file, re-decompress the source package installation, copy the documentation first, and add "--with-included-apr" after configure. recompile again;

cd /usr/local/src/

cp -r apr-1.6.3 /usr/local/src/httpd-2.4.29/srclib/apr

cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.29/srclib/apr-util

cd /usr/local/src/httpd-2.4.29/

./configure --prefix=/usr/local/apache2.4 --with-included-apr --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most

make && make install

 

start httpd

/usr/local/apache2.4/bin/apachectl start

 

Query whether httpd is started

ps aux |grep httpd

netstat -lntp (default port 80)

 

Detailed explanation of httpd directory

[root@aming-01 httpd-2.4.29]# ls /usr/local/apache2.4/ (directory path)

apache2.4 folder

conf folder: configuration files

htdocs: homepage document

logs folder: log files

modules: module storage

 

View the modules called by apache (both commands have the same effect)

/usr/local/apache2.4/bin/httpd -M

/usr/local/apache2.4/bin/apachectl -M

 

 

expand

apache dso  https://yq.aliyun.com/articles/6298
apache apxs http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/programs/apxs.html
apache working mode  http://www.cnblogs.com /fnng/archive/2012/11/20/2779977.html

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326068365&siteId=291194637