Cent os 5 可用的备用源(5.11)

修改/etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/5.11/extras/$basearch/

gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

 

Nextcloud issues

The test with getenv(“PATH”) only returns an empty response

修改php-fpm中www.conf,将下面行的内容注释取消,重启php

;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

nextcloud在nginx中的伪静态规则,在站点配置中添加一下内容:

location
~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}

The “Strict-Transport-Security” HTTP header is not configured to least “15552000” seconds. For enhanced security we recommend enabling HSTS as described in our security tips.

在站点SSL配置文件添加一下内容(apache2: a2enmod headers)

NGINX:

add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

APACHE:

 Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

 

Something wordpress

php:
/etc/php5/fpm/pool.d/www.conf >>
listen = 127.0.0.1:9000 (#listen = /var/run/php5-fpm.sock)
listen.allowed_clients = 127.0.0.1

Nginx Site Config


location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;

 

# NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini

# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

WordPress Rewrite

add content to

location /{
if (!-e $request_filename) {
rewrite (.*) /index.php;
}
}

 

DataBase

CREATE DATABASE wp;

GRANT ALL PRIVILEGES ON wp.* TO "wpuser"@"localhost" IDENTIFIED BY "password";

 

debian 从wheezy升级至jessie

前两天入手一kvm机器,没有debian jessie的安装模板,只有wheezy,也不支持自定义安装。为了直接装上4.9内核,所以要将其手动手动升级至jessie。

如果机器上有重要文件的话,先备份一下,没有的话,就直接开始吧。

先在wheezy下,确认源列表没问题,将系统包升级至最新

编辑/etc/apt/source.list 源:

deb http://ftp.de.debian.org/debian wheezy main contrib non-free
deb-src http://ftp.de.debian.org/debian wheezy main contrib non-free
deb http://ftp.de.debian.org/debian wheezy-updates main contrib non-free
deb http://ftp.de.debian.org/debian-security wheezy/updates main contrib non-free

然后执行更新

apt-get update
apt-get upgrade
apt-get dist-upgrade

更新完之后检查一下系统包的完整性

dpkg --audit
dpkg --get-selections | grep hold

如果没有任何返回的话,就可以操作继续将debian升级至jessie了。

将源修改为jessie ,然后更新

sed -i 's/wheezy/jessie/' /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get dist-upgrade

更新完之后重启,用lsb_release -a 查看系统版本,也可以查看/etc/os-release

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.7 (jessie)
Release:	8.7
Codename:	jessie

 

wr703n openwrt 改8M flash

前些天没事发现wr703n能刷openwrt,于是就将其从他人手上回收回来了。

按网上说的刷完openwrt之后,开装luci却发现no enough space left。原来flash容量太小了,刷完openwrt之后仅剩200多k的可用空间。

于是将原来的flash提取了出来,直接烧到新的8M flash上去,然后重新通电,以太网口还是正常工作的,但是wifi却用不了。

http://blog.sina.com.cn/s/blog_776596a50101kbvg.html说到,art信息丢失所以wifi不可用了。按照此文,重新合并rom文件。

因为改的flash大小不一样,只是生成art前文件大小有所变动,另自己早用dd生成文件时,发现若使用单位为M的话,似乎生成的文件大小不正确,故使用字节为单位。

一、在原来的flash上刷好openwrt并登录,备份mtd分区:

#cd /tmp

#cat /dev/mtdblock0 > uboot.bin

#cat /dev/mtdblock4 > art.bin

#cat /dev/mtdblock5 > firmware.bin

备份完的三个文件,可以直接合成为4M flash可用的固件:cat uboot.bin firmware.bin art.bin > wr703n.bin

二、合成8M flash可用固件:

首先生成一个内容为全0xFF 4M大的文件:

tr ‘\000’ ‘\377’ /dev/zero dd of=0xFF_4MB.bin bs=1024 count=4096

然后再合成8M flash可用固件:

cat uboot.bin firmware.bin 0xFF_4MB.bin art.bin > wr703n_8M.bin

最后直接将合成的文件用编程器刷进8M flash,换上flash。

关于配置,参考http://blog.csdn.net/qinpeng_zbdx/article/details/8570488