Installing MARIADB and Apache

Source: Internet
Author: User
Tags mkdir fully qualified domain name

Install mariadb (binary-free compiler Package)
  • 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
  • Tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
  • MV MARIADB-10.2.6-LINUX-GLIBC_214-X86_64/USR/LOCAL/MARIADB
  • Cd/usr/local/mariadb
  • ./scripts/mysql_install_db--user=mysql --basedir=/usr/local/mariadb/--datadir=/data/mariadb
  • CP SUPPORT-FILES/MY-SMALL.CNF/USR/LOCAL/MARIADB/MY.CNF
  • VI/USR/LOCAL/MARIADB/MY.CNF//define BASEDIR and DataDir, if not defined here, because the previous installation of the Mysql,mysql service starts will call/etc/ My.cnf in the DataDir, the following service database will be wrong
    vi /usr/local/mariadb/my.cnf# The MySQL server[mysqld]basedir         = /usr/local/mariadbdatadir         = /data/mariadbport            = 3306
    [[email protected] mariadb]# ps aux |grep mysqlroot      1838  0.2  0.0 115388  1748 ?        S    21:41   0:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/usr/local/mariadb/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/akuilinux01.pidmysql     1960  2.7  3.0 1649312 57884 ?       Sl   21:41   0:00 /usr/local/mariadb/bin/mysqld --defaults-file=/usr/local/mariadb/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mysql --log-error=/data/mariadb/akuilinux01.err --pid-file=/data/mariadb/akuilinux01.pid --socket=/tmp/mysql.sock --port=3306root      1999  0.0  0.0 112676   984 pts/0    S+   21:41   0:00 grep --color=auto mysql
  • CP SUPPORT-FILES/MYSQL.SERVER/ETC/INIT.D/MARIADB
  • VIM/ETC/INIT.D/MARIADB// define Basedir, DataDir, conf, and startup parameters
    If you do not install MySQL and mariadb at the same time, you do not need to define Conf

    basedir=/usr/local/mariadbdatadir=/data/mariadbconf=$basedir/my.cnf# may be overwritten at next upgrade.  $bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "[email protected]" &
  • /ETC/INIT.D/MARIADB start
Installing Apache
  • Apache is the name of a foundation, HTTPD is the package that we want to install, earlier its name is Apache
  • Apache official website www.apache.org
  • wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33. tar.gz
  • wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.gz
  • wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
  • 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
  • Tar zxvf httpd-2.4.26.tar.gz
  • Tar zxvf apr-util-1.5.4.tar.gz
  • Tar zxvf apr-1.5.2.tar.gz
  • cd/usr/local/src/apr-1.5.2
  • ./configure--PREFIX=/USR/LOCAL/APR
  • Make && make install
  • cd/usr/local/src/apr-util-1.5.4
  • ./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
  • Make && make install
  • cd/usr/local/src/httpd-2.4.27
  • ENABLE-SO supports dynamic expansion modules, and the last one is support for most dynamic modules here the backslash is the caret, plus it we can write a line of commands into multiple lines

    ./configure \--prefix=/usr/local/apache2.4 \--with-apr=/usr/local/apr \--with-apr-util=/usr/local/apr-util \--enable-so \--enable-mods-shared=most\\ 指定支持大多数模块
    configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/[[email protected] httpd-2.4.27]# yum install -y pcre-devel
  • Make && make install
  • Ls/usr/local/apache2.4/modules//Dynamic Module Catalog
  • /USR/LOCAL/APACHE2.4/BIN/HTTPD-M//View the loaded module or/USR/LOCAL/APACHE2.4/BIN/APACHECTL-M
  • /usr/local/apache2.4/bin/apachectl Start//Startup command
  • Startup error
    [[email protected] ~]#/usr/local/apache2.4/bin/apachectl starthttpd:could not open configuration file/usr/local /apache2/conf/httpd.conf:no such file or directory[[email protected] ~]# mkdir-pv/usr/local/apache2/conf/mkdir: Directory created "/usr/local/apache2" mkdir: Directory Created "/usr/local/apache2/conf/" [[email protected] ~]# ln-s/usr/local/ Apache2.4/conf/httpd.conf/usr/local/apache2/conf/httpd.conf[[email protected] ~]#/usr/local/apache2.4/bin/ Apachectl startAH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using fe80::68fd:e6f A:c781:f5a6. Set the ' ServerName ' directive globally to suppress this message[[email protected] ~]# PS aux |grep httpdroot 14        75 0.0 0.1 95496 2512?        Ss 23:16 0:00/usr/local/apache2.4/bin/httpd-k Startdaemon 1476 2.9 0.3 382324 6464?        Sl 23:16 0:00/usr/local/apache2.4/bin/httpd-k Startdaemon 1477 3.4 0.3 382324 6464? Sl 23:16 0:00/usr/local/apache2.4/bin/httpd-k Startdaemon 1478 3.4 0.3 382324 6464? Sl 23:16 0:00/usr/local/apache2.4/bin/httpd-k startroot 1561 0.0 0.0 112676 980 pts/0 s+ 23:16 0:00 grep--color=auto httpd
    Extended
  • Apache DSO
  • Apache APXS
  • Apache Working mode

Installing MARIADB and Apache

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.