First, install the MARIADB
1?CD/USR/LOCAL/SRC/Go to the download file storage directory
2, 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
3. Unpacking Package: TAR-ZXVF mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
4. In order to differentiate from MySQL, create the/data/mariadb/directory.
5?MV mariadb-10.2.6-linux-glibc_214-x86_64/usr/local/mariadb
6. Initialize the installation./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mariadb--datadir=/data/mariadb
(If you do not define BASEDIR then the system will go to the MySQL directory)
7, echo $? Check if initialization is successful
8. Under the directory support-fiels/there are several formulations, the difference is that the data cache size is different, the use of these things, depending on the size of your memory, it can give you to specify the appropriate cache, so that your MySQL to achieve higher performance;
Copy preparation Template: CP support-files/my-small.cnf/usr/local/mariadb/my.cnf
In order to differentiate MySQL, we did not put it under the/etc/directory,
Copy startup script: CP support-files/mysql.server/etc/init.d/mariadb
[[email protected] mariadb]# ls support-files/
Binary-configure my-large.cnf mysql-log-rotate wsrep_notify
Magic MY-MEDIUM.CNF Mysql.server
MY-HUGE.CNF MY-SMALL.CNF Policy
MY-INNODB-HEAVY-4G.CNF Mysqld_multi.server wsrep.cnf
[Email protected] mariadb]#
9. Edit the startup/etc/init.d/maradb file and change the start command line!
Basedir=/usr/local/mariadb
Datadir=/data/mariadb
conf= $basedir/my.cnf Defining a configuration file path
10. Check that the MySQL service has not started, otherwise it will generate port conflict: PS aux |grep mysqld, in case of OK shutdown, we start mariadb service/etc/init.d/mariadb start
We started the MySQL service because we didn't define DATADIR, and now we have to define it, then it will start mariadb.
VIM/USR/LOCAL/MARIADB/MY.CNF add a line under [MySQL]: datadir=/data/mariadb
After the reboot, its path becomes datadir=/data/mariadb.
Ii. installation of Apache (HTTPD 2.4)
Apache is the name of a foundation, HTTPD is the package we want to install, the early name is Apache, its official website: www.apache.org, its mainstream version is 2.4
1?APR and Apr-util is a general function library, it httpd can not care about the underlying operating system platform, can be easily ported. (Migrating from Linux to Windows)
2?cd/usr/local/src then download three more packages
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33.tar.gz
wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
3. Unzip the source package.
TAR-ZXVF httpd-2.4.33.tar.gz
TAR-ZXVF apr-1.6.3.tar.gz
TAR-JXVF apr-util-1.6.1.tai.bz2
TAR-ZXVF pcre-8.38.tar.gz
4. View installation instructions install or redeme (more installed), compile, install
5, compile and install APR, Apr-util, Pcre
Apr
CD apr-1.6.3
./configure--PREFIX=/USR/LOCAL/APR
Make
Make install
Apr-util:
CD apr-util-1.6
./configure--PREFIX=/USR/LOCAL/APR
Make #提示出错, the following error directly installs the dependency package solution: Yum Install Expat-devel
Make install
Pcred:
CD pcre-8.38
./configure--prefix=/usr/local/pcre #提示出错, e.g., less gcc and C + +
Workaround: Yum install-y gcc gcc-c++
Make
Make install
Install Apache:
CD httpd-2.4.33
./configure--prefix=/usr/local/apache--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util--with-pcre=/ Usr/local/pcre--enable-so--enable-mods-shared=most
Make & make Install
Complete the installation
Description:--enable-so: Indicates support for dynamic expansion module,
--enable-mods-shared=most
5. Go to Apache directory: Cd/usr/local/apache
BIN/HTTPD is its core directory, binary files,
conf/Configuration file Directory
htdocs/the location of the access page after starting the HTTPD service, the default website will be placed in this directory
logs/Log Related
modules/Expansion Module
How to see what modules Apache has loaded:/usr/local/apache/bin/httpd-m
or with/usr/local/apache/bin/apachectl-m.
Static and dynamic difference is: Static is directly to the module compiled into the httpd, dynamic is the expansion module, in the modules inside
Command line start Apache:/usr/local/apache/bin/apachectl start
Then view the process: PS aux |grep httpd view listening port: NETSTAT-LNTP
Installation of MARIADB and Apache