MariaDB安装
1、[root@centos7 package]# tar xf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
2、
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
cd /usr/local/mariadb
useradd mysql && mkdir /data/mariadb
./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb
echo $?
cp support-files/my-small.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mariadb
vi /etc/my.cnf
#新增配置
basedir=/usr/local/mariadb
datadir=/data/mariadb
vi /etc/init.d/mariadb
#新增配置
basedir=/usr/local/mariadb
datadir=/data/mariadb
conf=/etc/my.cnf
$bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &
/etc/init.d/mariadb start
[root@centos7 mariadb]# ps -ef | grep mysqld
root 3426 1 0 13:47 ? 00:00:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/etc/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/centos7.pid
mysql 3548 3426 0 13:47 ? 00:00:00 /usr/local/mariadb/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mysql --log-error=/data/mariadb/centos7.err --pid-file=/data/mariadb/centos7.pid --socket=/tmp/mysql.sock --port=3306
Apache安装
Apache是一个基金会的名字,httpd才是我们要安装的软件包,早期它的名字就叫apache。httpd使用一个通用函数库Apr和apr-util,它让httpd可以不关心底层的操作系统平台,可以很方便地移植(从linux移植到windows)。Apache官网 www.apache.org
下载:
1、wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
2、wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.3.tar.gz
3、wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
4、
[root@centos7 package]# tar xf httpd-2.4.29.tar.gz
[root@centos7 package]# tar xf apr-1.6.3.tar.gz
[root@centos7 package]# tar xf apr-util-1.6.1.tar.gz
5、安装arp包
yum install -y gcc*
yum install gcc
cd apr-1.6.3
./configure --prefix=/usr/local/apr
yum -y install expat-devel
make && make install
6、安装arp-util
cd ../apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
7、安装httpd
cd httpd-2.4.29
yum install -y pcre-devel
./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
echo $?
8、安装成功
9、目录结构
[root@centos7 apache2.4]# ls
bin build cgi-bin conf error htdocs icons include logs man manual modules
bin:可执行文件目录
conf:配置文件
htdocs:主目录(存放网页)
modules:模板目录
10、查看模板:
[root@centos7 apache2.4]# /usr/local/apache2.4/bin/httpd -M
11、启动:
[root@centos7 bin]# /usr/local/apache2.4/bin/apachectl start
[root@centos7 apache2.4]# ps -ef | grep httpd
root 45047 1 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
daemon 45048 45047 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
daemon 45049 45047 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
daemon 45050 45047 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
daemon 45051 45047 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
daemon 45052 45047 0 20:16 ? 00:00:00 /usr/local/apache2.4/bin/httpd -k start
root 45055 17686 1 20:16 pts/0 00:00:00 grep --color=auto httpd