Linux企业运维–LAMP–mysql-php-memcache

LAMP是指一组通常一起使用来运行动态网站或者服务器的软件名称首字母缩写:

  • LINUX

  • Apache,Nginx

  • Mysql

  • PHP

*************源码安装数据库********************

数据库是“按照数据结构来组织、存储和管理数据的仓库”。是一个长期存储在计算机内的、有组织的、可共享的、统一管理的大量数据的集合

server1 172.25.14.1

从服务端把压缩

Linux企业运维--LAMP--mysql-php-memcache?包5.7.31下载到server1

 

安装相关依赖
yum install -y cmake  
yum install -y ncurses-devel
yum install -y bison

删除CMakeCache.txt

 cmake  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql  -DMYSQL_DATADIR=/data/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_EXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_unicode_ci -DWITH_BOOST=boost/boost_1_59_0

Linux企业运维--LAMP--mysql-php-memcache?

make 

makeinstall

 

在/usr/local/mysql下看到已经下载完毕

Linux企业运维--LAMP--mysql-php-memcache?
切换到support-files下复制mysql.server到etc/init.d/mysqld ll可以查看

 

Linux企业运维--LAMP--mysql-php-memcache?

 

建立一个用户mysql

Linux企业运维--LAMP--mysql-php-memcache?

更改~/.bash_profile 文件,修改里面路径

Linux企业运维--LAMP--mysql-php-memcache?
重新在bash里启用 —-source ~/.bash_profile

 

Linux企业运维--LAMP--mysql-php-memcache?

 

 

编辑/etc/my.cnf

Linux企业运维--LAMP--mysql-php-memcache?

 

初始化 mysqld –initialize –user=mysql

开启数据库/etc/init.d/mysqld start

Linux企业运维--LAMP--mysql-php-memcache?

查看日志会发布一个local密码   —–cat mysqld.log

mysql -p   ——用cat到的密码登陆mysql

为了安全我们要自己更改密码,所以退出mysql
mysql_secure_installation —-更改root用户密码,按指示步骤操作

Linux企业运维--LAMP--mysql-php-memcache?

 再登陆mysql  用我们新更改的密码完成登陆

Linux企业运维--LAMP--mysql-php-memcache?

Linux企业运维--LAMP--mysql-php-memcache?

 

***************源码安装php*******************

 

从服务器下载php源码
解压

Linux企业运维--LAMP--mysql-php-memcache?

 

./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –enable-fpm –with-fpm-user=nginx –with-fpm-group=nginx  –with-curl –with-iconv –with-mhash –with-zlib –with-openssl –enable-mysqlnd –with-mysqli –with-pdo-mysql –disable-debug –enable-sockets –enable-soap –enable-inline-optimization –enable-xml –enable-ftp –enable-gd –enable-exif –enable-mbstring  –enable-bcmath –with-fpm-systemd

Linux企业运维--LAMP--mysql-php-memcache?

 

Linux企业运维--LAMP--mysql-php-memcache?

 

根据上述命令安装,如果有需要依赖性的包,就必须将包下载并且重新执行上述命令

make开始解析
make install

Linux企业运维--LAMP--mysql-php-memcache?

 

进入php目录下sapi/fmp/

复制php-fpm.server 到/usr/lib/systemd/system
systemctl daemon-reload 重新加载配置文件

Linux企业运维--LAMP--mysql-php-memcache?

 

cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf  复制文件并改名,目的是为了备份
vim php-fpm.conf

Linux企业运维--LAMP--mysql-php-memcache?

 

cp www.conf.default www.conf  

Linux企业运维--LAMP--mysql-php-memcache?
cd php-7.4.12
cp php.ini-production /usr/local/php/etc/php.ini   复制文件到etc下,并起名php.ini

 

Linux企业运维--LAMP--mysql-php-memcache?
vim /usr/local/php/etc/php.ini
Linux企业运维--LAMP--mysql-php-memcache?

cd /usr/lib/systemd/system
vim php-fpm.server

Linux企业运维--LAMP--mysql-php-memcache?
systemctl daemon-reload            
netstat -antlp | grep :9000   监测9000端口

 

Linux企业运维--LAMP--mysql-php-memcache?

cd /usr/local/nginx/conf/
vim nginx.conf

 

Linux企业运维--LAMP--mysql-php-memcache?

 

vim index.php

Linux企业运维--LAMP--mysql-php-memcache?

 

nginx
curl localhost php-fpm:9000

Linux企业运维--LAMP--mysql-php-memcache?

 

使用浏览器登陆

Linux企业运维--LAMP--mysql-php-memcache?
*******phpmyadmin**********

 

下载压缩包phpMyAdmin-5.0.2-all-languages.zip
解压

Linux企业运维--LAMP--mysql-php-memcache?

 

mv phpMyAdmin-5.0.2-all-languages myadim   为方便更改名字    
mv myadim /usr/local/nginx/html              移动到html

cd /usr/local/nginx/conf/
vim nginx.conf

Linux企业运维--LAMP--mysql-php-memcache?
nginx -s reload

 

cd /usr/local/php/etc/
vim php.ini

Linux企业运维--LAMP--mysql-php-memcache?

 

Linux企业运维--LAMP--mysql-php-memcache?

 

nginx -s reload
systemctl reload php-fpm   平滑重加载

网页登录数据库

Linux企业运维--LAMP--mysql-php-memcache?

 

********memcache**********

memcache是一套分布式的高速缓存系统,由Livejournal的Brad Fitzpatrick开发,但目前被许多网站使用以提升网站的访问速度,尤其对于一些大型的、需要频繁访问数据库的网站访问速度提升效果十分显著  。这是一套开源,以BSD license授权发布。

下载 memcache-4.0.5.2.tgz并解压

Linux企业运维--LAMP--mysql-php-memcache?

 
yum install -y autoconf   安装相关依赖
vim .bash_profile   —-添加路径

Linux企业运维--LAMP--mysql-php-memcache?
source .bash_profile   在bash里重新刷新

 

 phpize
./configure –enable-memcache  

Linux企业运维--LAMP--mysql-php-memcache?
 make
 make install
cd /usr/local/php/etc/
 vim php.ini

Linux企业运维--LAMP--mysql-php-memcache?
Linux企业运维--LAMP--mysql-php-memcache?
systemctl reload php-fpm

Linux企业运维--LAMP--mysql-php-memcache?
切换到目录memcache-4.0.5.2下
cp memcache.php example.php /usr/local/nginx/html/  复制

Linux企业运维--LAMP--mysql-php-memcache?

 

cd /usr/local/nginx/html/
yum install -y memcached
systemctl  start memcached

netstat -antlp|grep :11211     监听11211端口

Linux企业运维--LAMP--mysql-php-memcache?
vim memcache.php
Linux企业运维--LAMP--mysql-php-memcache?

 

在浏览器看到捕捉机率

Linux企业运维--LAMP--mysql-php-memcache?

 

文章知识点与官方知识档案匹配,可进一步学习相关知识云原生入门技能树首页概览8698 人正在系统学习中

来源:凯哥我点了!

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年11月8日
下一篇 2021年11月8日

相关推荐