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

 

shell下生成随机字符

openssl :

openssl passwd -stdin < <(echo)

urandom:

10 位的md5 字符串

cat /dev/urandom | head -n 10 | md5sum | head -c 10  

linux uuid:

cat /proc/sys/kernel/random/uuid | cksum | cut -f1 -d " "

date产生随机数:

date +%s%N

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的pxe网启服务器

Links:
https://help.ubuntu.com/community/PXEInstallMultiDistro

http://oss.netfarm.it/guides/pxe.php

https://www.centos.org/forums/viewtopic.php?f=47&t=49520 ###CENTOS BOOTISSUE

http://drbl.nchc.org.tw/fine-print.php?path=./advanced/01_DRBL/08-drbl-sanboot.faq#08-drbl-sanboot.faq

Basic setup
tftpd-hpa syslinux isc-dhcp-server(optional:if you do not have a dhcp server) tftp-hpa(optional:just to test tftpd)

阅读更多 基于debian的pxe网启服务器

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