Q's blog

一些个人文档笔记

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
yum install bison bison-devel zlib-devel libcurl-devel libarchive-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel -y
useradd -r -s /sbin/nologin -d /data/mysql/ mysql
mkdir /data/mysql -pv >/dev/null
chown mysql.mysql /data/mysql
tar xf mariadb-10.2.23.tar.gz
cd mariadb-10.2.23/
cmake . -DCMAKE_INSTALL_PREFIX=/app/mysql \
-DMYSQL_DATADIR=/data/mysql/ \
-DSYSCONFDIR=/etc/mysql \
-DMYSQL_USER=mysql \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITHOUT_MROONGA_STORAGE_ENGINE=1 \
-DWITH_DEBUG=0 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP=0 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
make -j 12 && make install
echo 'PATH=/app/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
source /etc/profile.d/mysql.sh
#/app/mysql/bin/mysql_secure_installation
cp /app/mysql/support-files/mysql.server /etc/rc.d/init.d/mysql
chkconfig --add mysqld
cat > /etc/my.cnf.d/my.cnf <

1
2
3
4
5
6
7
8
9
10
11
yum install -y vim lrzsz tree screen psmisc lsof tcpdump wget ntpdate gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools iotop bc zip unzip zlib-devel bash-completion nfs-utils automake libxml2 libxml2-devel libxslt libxslt-devel perl perl-ExtUtils-Embed
useradd nginx -s /sbin/nologin -u 2000
cd /root
wget https://nginx.org/download/nginx-1.15.12.tar.gz
tar xvf nginx-1.15.12.tar.gz
cd nginx-1.15.12/
./configure --prefix=/apps/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module
make && make install
echo 'PATH=/apps/nginx/sbin:$PATH' > /etc/profile.d/nginx.sh
sed -i "s@\/scripts$fastcgi_script_name@$document_root$fastcgi_script_name@g" /apps/nginx/conf/nginx.conf
/apps/nginx/sbin/nginx -V

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
yum  install -y  wget vim pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel
cd /root
#wget https://www.php.net/distributions/php-7.2.19.tar.xz
tar xf php-7.1.30.tar.gz
cd php-7.1.30/
./configure --prefix=/apps/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-pear --with-curl --with-png-dir --with-freetype-dir --with-iconv --with-mhash --with-zlib --with-xmlrpc --with-xsl --with-openssl --with-mysqli --with-pdo-mysql --disable-debug --enable-zip --enable-sockets --enable-soap --enable-inline-optimization --enable-xml --enable-ftp --enable-exif --enable-wddx --enable-bcmath --enable-calendar --enable-shmop --enable-dba --enable-sysvsem --enable-sysvshm --enable-sysvmsg
make -j 4 && make install
cd /apps/php/etc/php-fpm.d/
cp www.conf.default www.conf
sed -i "s/= www/= nginx/" www.conf
cd /apps/php/etc/
cp php-fpm.conf.default php-fpm.conf
/apps/php/sbin/php-fpm -t
#useradd nginx -s /sbin/nologin -u 2000
/apps/php/sbin/php-fpm -c /apps/php/etc/php.ini
ps -ef | grep php-fpm

一 : 缓存 概念 :

缓存是为了调节速度不一致的两个或多个不同的物质的速度,在中间对速度较快的一方起到一个加
速访问速度较慢的一方的作用,比如 CPU 的一级、二级缓存是保存了 CPU 最近经常访问的数据,内存是保存 CPU 经常访问硬盘的数据,而且硬盘也有大小不一的缓存,甚至是物理服务器的 raid 卡有也缓存,都是为了起到加速 CPU 访问硬盘数据的目的,因为 CPU 的速度太快了,CPU 需要的数据硬盘往往不能在短时间内满足 CPU 的需求,因此 PCU 缓存、内存、Raid 卡以及硬盘缓存就在一定程度上满足了 CPU 的数据需求,即 CPU 从缓存读取数据可以大幅提高 CPU 的工作效率。

阅读全文 »
0%