在克隆虚拟机(centos 6.5)的机器开机后启动后,ifconfig 查看网卡只有一个lo 回环的网卡
如何让eth0 正常显示使用:注释掉网卡配置文件中的uuid 和hwaddr这2栏,然后再删除70-persistent-net.rules 文件,重启机器。[root@localhost ~]# rm -rf /etc/udev/rules.d...
·
技术积累
·
Nginx
nginx 后端获取用户访问的真实ip
nginx前端配置server {
......
upstream fuzai{
server xx.xx.xx.xx;
}
......
location / {
proxy_pass http://fuzai ;
proxy_set_header Host $host;
pr...
·
技术积累
·
Nginx
修改你的nginx 配置文件:
http {
......
fastcgi_intercept_errors on; #开启自定义错误页面
......
server {
......
error_page 404 /404.html; #这里404 后面和路径之间不要用等号。用空格分隔,否则看到状态码是200
......
}
}
·
技术积累
·
Iptables
iptables 安全参数:-I 添加到最前面一条
-A 添加到最后面一条具体例子:1.允许状态类链接通过
iptables -I INPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
2.开放ssh 端口
iptables -I INPUT -p tcp --dport 22 -j AC...
·
技术积累
·
Nginx
在你需要的配置文件中加上此段:location ^~ /admin/ { #你禁止其他人访问的目录
allow 192.168.1.1; #允许的ip,也可以是网段使用掩码方式
deny all; #拒绝所有
#转发php
fastcgi_pass 127.0.0.1:9000;
fastc...
·
技术积累
·
SSH
centos 下面使用yum方式安装sshpass
远程登录其他机器执行命令,之前一直用export 脚本的方式。现在感觉用这个更加方便一点,但是不安全,不建议在生产环境中使用此命令!
安装epel源wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.rep...
·
技术积累
·
Nginx
修改你需要调整nginx配置文件server {
......
if ($server_port = 80){
return 301 https://$server_name$request_uri;}
if ($scheme = http){
return 301 https://$server_name$request_uri;}
error...
·
技术积累
·
Redis
centos7下安装redis下载:redis-3.2.3wget http://download.redis.io/releases/redis-3.2.3.tar.gz
tar -xf redis-3.2.3.tar.gz
cd redis-3.2.3
make
make install
cd utils
./install_server.sh如果...
·
技术积累
·
PHP Redis
给php7安装下redis扩展
下载扩展:
phpredis-php7unzip phpredis-php7.zip
cd phpredis-php7
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
make
make ins...