38, MARIADB installation, Apache installation

Source: Internet
Author: User
Tags bz2

First, MARIADB installation

Installation method and installation MySQL basically consistent

# CD/USR/LOCAL/SRC

# wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.14/bintar-linux-glibc_214-x86_64/ Mariadb-10.2.14-linux-glibc_214-x86_64.tar.gz

Official website: downloads.mariadb.com

10.2.6 64-bit binary package: 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

https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.14/bintar-linux-glibc_214-x86_64/ mariadb-10.2.14-linux-glibc_214-x86_64.tar.gz with this address download, the speed is OK, teacher video inside that address will be slower

# tar ZXVF mariadb-10.2.14-linux-glibc_214-x86_64.tar.gz Unzip

# MV MARIADB-10.2.14-LINUX-GLIBC_214-X86_64/USR/LOCAL/MARIADB renaming distinction

Create the Data directory, which is also the MySQL user.

#./scripts/mysql_install_db--user=mysql--datadir=/data/mariadb then initialize

If there is a problem, then define:--BASEDIR=/USR/LOCAL/MARIADB, if you do not define BASEDIR, it is possible to go to MySQL to find. Here I am ok here.

# ls support-files/

The difference between my-huge.cnf, MY-LARGE.CNF, MY-SMALL.CNF, and my-medium.cnf is that the size of the cache is different, some buffers, some caches, and their role is to specify the appropriate cache depending on the size of your memory. Enable your MySQL to achieve more efficient performance.

MY-SMALL.CNF the smallest file as we do the experiment, just use this minimal.

MY-HUGE.CNF the largest file

# CP support-files/my-small.cnf/usr/local/mariadb/my.cnf Copy this template configuration file, in order to differentiate the MySQL is not placed under the/etc/.

# CP SUPPORT-FILES/MYSQL.SERVER/ETC/INIT.D/MARIADB Copy startup script

# VIM/USR/LOCAL/MARIADB/MY.CNF There's no need to change

[Client] Clients use, do not change, change the useless

[mysqld] need to change the part, mainly to change here, the socket can be customized

Server-id = 1 for the master from the copy, follow-up explanation

[mysqldump] Parameters used for backup

[MySQL] backup related, no concern

[Myisamchk] Backup related, no concern

[Mysqlhotcopy] Backup related, no concern

# VIM/ETC/INIT.D/MARIADB modified to the following parameter, conf as the new row.

Basedir=/usr/local/mariadb

Datadir=/data/mariadb

CONF=/USR/LOCAL/MARIADB/MY.CNF specifies its configuration file, which can also be written as conf= $basedir/my.cnf

The startup script needs to add a new--defaults parameter

Then you can start it, before starting to see if there are mysqld services are started, if there is a conflict, because they are 22 ports.

# PS aux |grep MySQL to see if there is a MySQL process, just use the following command to stop.

#/etc/init.d/mysqld Stop

#/etc/init.d/mariadb Start mariadb

# PS aux |grep mariadb again check the boot success no

# NETSTAT-LTNP Look at the port, 3306

The difference from MySQL is that you specify the path to a configuration file more than one. If you don't have MySQL installed, just install mariadb and put the config file on/etc/my.cnf as MySQL does.

The--datadir=/data/mysql here is because the specified configuration file/usr/local/mariadb/my.cnf does not define this item, so it needs to be defined in this configuration file.

#/etc/init.d/mariadb Restart to start again after the change

If it still does not change, Killall mysqld, and then start the #/etc/init.d/mariadb start this service, and then you can see DATADIR=/DATA/MARIADB

Second, Apache installation

Apache is the name of a foundation,httpd is to install the package, the early name of it is called Apache.

Apache official website: www.apache.org

Now it should be called httpd, not Apache,lamp should also be called LHMP.

Dependent software: APR;APR and Apr-util are a common library of functions that allow httpd to be easily ported (from Linux to Windows) without caring for the underlying OS platform

The 2.4 and 2.2 versions of httpd depend on the APR version as well.

2.4 Source Bundle: http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33.tar.gz

Apr:http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz

apr-util:http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2

Download these three packages under/usr/local/src/

# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33.tar.gz

# wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.3.tar.gz

# wget HTTP://MIRRORS.HUST.EDU.CN/APACHE/APR/APR-UTIL-1.6.1.TAR.BZ2

Then unzip separately.

# tar zxf httpd-2.4.33.tar.gz

# tar zxf apr-1.6.3.tar.gz

# tar jxf apr-util-1.6.1.tar.bz2

# CD apr-1.6.3

#./configure--PREFIX=/USR/LOCAL/APR Installation

# Make && make install

# CD: /apr-util-1.6.1/

#./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

# Make && make install

An error occurred during installation, one less dependency package, and the installation of the dependent package

--ENABLE-SO supports dynamic expansion modules

# CD:

[Email protected] src]# CD httpd-2.4.33/

#./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 error says there is no such pcre-config libpcre.

Pcre: A driver library for regular expressions.

Search # Yum List |grep pcre//Usually the library files are either with Devel or LIB.

Install this pcre-devel.x86_64 package here, # yum Install-y pcre-devel.x86_64

And then do it again:

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

# Make && make install

# cd/usr/local/apache2.4/

[[email protected] apache2.4]# ls

Bin build Cgi-bin conf error htdocs icons include logs man manual modules

Under Bin is the executable file, to start the service is started by the httpd under the bin. The core binary file.

Conf: the directory where the configuration file resides.

Htdocs: The access page is stored.

Logs: Log. Error log, access log.

Modules: Extension module.

See what modules Apache has loaded:/usr/local/apache2.4/bin/apachectl. Actually it is called/usr/local/apache2.4/bin/httpd-m this file.

If it is static, it means that the file is bound together with httpd in httpd.

If it is shared, it means that it is an extended module, which is a. so visible file.

Apache boot does not need to start the script, do not have to put under the/etc/init.d/, start with the command line can be

#/usr/local/apache2.4/bin/apachectl Start Apache

#/usr/local/apache2.4/bin/apachectl Stop Stop

Check the process with PS aux |grep httpd

Check the port number with NETSTAT-LTNP


Mysqld Default listener 3303 port (common sense)

httpd Default Listener 80 port (common sense)

sshd Default Listener 22 port (common sense)

25 port, outgoing mail.



Extended

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


38, MARIADB installation, Apache installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.