自己搭了一套lnmp+redis的vm虚拟机提供linux下的web运行测试环境,使用与物理机文件共享的方式,把站点配置,站点代码目录等放在物理机的文件夹中方便直接开发配置等,phpmyadmin因为变成了777权限。
会报
配置文件权限错误,不应任何用户都能修改!
处理
找到phpmyadmin/libraries/config.default.php文件,把 $cfg['CheckConfigurationPermissions'] 修改为false

nginx一般做代理服务器较多,大多数缓存都是proxy cache,偶尔有些架构是nginx+php组合的,其缓存就是另一种
fastcgi cache.
配置

http段:

fastcgi_cache_path /dev/shm/nginx_cache levels=2:2 keys_zone=cgi_one:10m inactive=2d max_size=10g;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie ;

server段

set $skip_cache 0;
if ($request_method = POST) {
        set $skip_cache 1;
}
if ($request_uri ~ ^/admin/) {
    set $skip_cache  1;
}


fastcgi_cache            cgi_one;
fastcgi_cache_methods    GET;
fastcgi_cache_key        "$scheme$request_method$host$request_uri";
fastcgi_cache_valid      200 302 1d;
fastcgi_cache_use_stale  error timeout invalid_header http_500;
add_header               X-Cache "$upstream_cache_status";
fastcgi_no_cache $skip_cache;
fastcgi_cache_bypass $skip_cache;
include   fastcgi_params;

1.关闭虚拟机
2.虚拟机右键-设置-选项-共享文件夹-启用
3.添加目录 后开机
cc.png

#安装vm-tools
#运行 vmware-hgfsclient 查看共享的目录 
[root@shw-xuniji mnt]# vmware-hgfsclient
web
mount -t vmhgfs .host:/web /mnt/hgfs
#之后
ls /mnt/hgfs #就看到文件了。

这样,可以把代码目录和站点配置文件放在这里,在外部就能随时编辑了。
个人习惯,做一个软链接

ln -s /mnt/hgfs /home/public_html
#nginx httpd段加一个配置 include /home/public_html/vhost/*.conf;
mkdir /home/public_html/vhost

测试了几个不同环境,成功顺利完成 自动 安装,启动,配置开机自动启动

#!/bin/sh
yum -y install make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip libcap lsof cmake automake autoconf zlib zlib-devel glibc glibc-devel glib2 libxml glib2-devel libxml2 libxml2-devel bzip2 bzip2-devel libXpm libXpm-devel libidn libidn-devel libtool libtool-ltdl-devel* libmcrypt libmcrypt-devel libevent-devel libmcrypt* curl curl-devel perl perl-Net-SSLeay pcre pcre-devel openldap openldap-devel openldap-clients openldap-servers libjpeg libpng libjpeg-devel libjpeg-6b libjpeg-devel-6b libpng-devel libtiff-devel freetype freetype-devel gd gd-devel
wget https://www.isres.com/file/redis-4.0.1.tar.gz
tar -zxvf redis-4.0.1.tar.gz
cd redis-4.0.1
make
cd src
make install PREFIX=/usr/local/redis
#将配置文件移动到redis目录
cd  ../
mv redis.conf /usr/local/redis/redis.conf
cp /usr/local/redis/redis.conf /usr/local/redis/redis.conf.bak
#redis数据默认目录/data/redisdb
sed -i 's/dir .\//dir \/data\/redisdb/g' /usr/local/redis/redis.conf
mkdir -p /data/redisdb
#后台运行
sed -i 's/daemonize no/daemonize yes/g' /usr/local/redis/redis.conf
#开机启动配置
echo  "/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf" >> /etc/rc.local
#启动redis
/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf

install_redis.zip