若是官网速度慢,r.aminglinux.com 有资源html
建议放这里:mysql
cd /usr/local/src wget http://xxx (复制连接粘贴)
cd /usr/local/src tar -zxvf xxx(选择粘贴)
换目录更名字:linux
mv xxx(选择粘贴) /usr/local/mariadb
cd ../mariadb (这是basedir)
加用户,存放点:sql
useradd mysql mkdir /data/
查找并安装依赖包apache
yum list | grep -i xxx | grep -i xxx yum install -y perl-Data-Dumper yum install -y libaio
运行:vim
./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb echo $? 检查
复制配置模板:windows
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf (defaults-file默认位置/etc/my.cnf被mysql占了能够这么放,启动时须要指过来) (若是机器内存足够,能够用huge模板)
修改:安全
vim my.cnf(用于调优,暂时不改)
复制模板:函数
cp support-files/mysql.server /etc/init.d/mariadb
修改:操作系统
vim /etc/init.d/mariadb basedir=/usr/local/mariadb 指定基础目录 datadir=/data/mariadb 指定存储目录 conf=$basedir/my.cnf 指定配置文件 start函数下插入:--defaults-file="$conf" (若是defaults-file在默认位置,则不须要改)
开机设置:
chkconfig --add mariadb chkconfig --list systemctl disable mariadb(systemd自动指回chkconfig)
即时启动/关闭:
service mariadb start service mariadb stop
启动:
/usr/local/mariadb/bin/mysqld_safe --default-file=/usr/local/mariadb/my.cnf --user=mysql --datadir=/data/mariadb & (注意要加“&”放后台)
安全关闭:
killall mysqld(不建议用kill -9 可能会致使数据损坏或丢失)
查看进程:ps aux |grep mysql 查看端口:netstat -lntp
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.27.tar.gz wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.2.tar.gz wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.6.0.tar.gz for i in *tar*;do tar zxvf $i;done
cd apr-1.6.2 ./configure --prefix=/usr/local/apr make && make install
cd /usr/local/src/apr-util-1.6.0 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make && make install
yum install -y expat-devel
cd httpd-2.4.27 ./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 yum list | grep pcre yum install -y pcre-devel
/usr/local/apache2.4/bin/apachectl start
ls /usr/local/apache2.4/modules //查看模块文件 /usr/local/apache2.4/bin/httpd -M //查看加载的模块 ps aux |grep httpd //查看进程 netstat -lntp //查看端口 vim /usr/local/apache2.4/conf/httpd.conf
apache dso https://yq.aliyun.com/articles/6298
apache apxs http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/programs/apxs.html
apache工做模式 http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html