若是官網速度慢,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