Oracle Linux 安装1panel

Oracle Linux 安装1panel

根据1panel 官网安装命令

​**curl -sSL https**​://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sh quick_start.sh

后面的quick_start.sh 需要使用sudo执行

即修改为

​**curl -sSL https**​://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && sudo sh quick_start.sh

然后,执行出错

# Executing docker install script, commit: e5543d473431b782227f8908005543bb4389b8de

ERROR: Unsupported distribution 'ol'

[1Panel Log]: ... 启动 docker
Failed to enable unit: Unit file docker.service does not exist.
Failed to start docker.service: Unit docker.service not found.

看起来是docker 安装失败,查看get-docker.sh 文件,判断/etc/os-release文件的ID属性,orcacle linux 为ol,

修改为centos即可

BT面板安装php5.6失败

环境:Ubuntu 16.04 

安装PHP5.6 几次都失败

搜索一通,都是直接安装PHP5.6,而不是编译安装

参考:

https://stackoverflow.com/questions/11741976/getting-error-char16-t-and-char32-t-undeclared

看 src 目录下,一直有相关的Makefile,直接make,就会报错

把 –std=c++11 添加到CXXFLAGS,没有起作用

仔细看一下,原来没有使用,只是使用在COMMONFLAGS,没有包含CXXFLAGS

添加到

CPPFLAGS = –std=c++11

重新

make

make install

make install-fpm

 

目前看来,php.ini, fpm.conf 都没有,从现有的php 72目录下拷贝过来。

wordpress 离线升级

aabite.com 不知道是被谁盯上了,被黑了。服务器懒得折腾,换到了virmach,结果,昨天收到邮件说,IO 超了,vps被shutdown。

今天去看了一下,重启vps,就又可以访问了,可是,刚起来Apache,就一大堆的访问,觉得是不是被当成中间代理了。

把aabite.com 下线,充Apache disable

然后下载了最新的wordpress 包,原wordpress里面,删除wp-admin和wp-includes,然后,从新的wordpress里面拷贝过来,

wordpress根目录下的文件,全部替换成最新的。

查看一下wp-config-sample.php,确认没什么更新的

重新启用aabite.com

访问时,发现wp-admin页面进不去

log 发现

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 3958207 bytes) in /var/www/aabite.com/wp-includes/wp-db.php on line 2066

解决办法:

参考 https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/

即 

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

重新访问即可。

hostodo ip 被墙

一场倒墙风波过后,我不怎么使用的vps ip也都被ban了,包括hostodo和vultr。

简单的检测方法:ping.chinaz.com

如果国内都不通,国外的通,很明显了。

解决办法:

hostodo 发了个service ticket,说vps cannot access via ssh

当天晚上就发mail,给了个新ip。

服务还是不错的。

vultr 需要新创建实例,然后把旧实例数据restore过去就好。

zsh和oh my zsh 配置

zsh 设置

ohmyzsh安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git extras[https://github.com/tj/git-extras]安装

$ git clone https://github.com/tj/git-extras.git
$ cd git-extras
# checkout the latest tag
$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ [sudo] make install

bash complete

when building android source, need to source >build/envsetup.sh
will complain "complete not found"

because android build use bash as default,complete is bash embed function

add below to .zshrc
bash
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

if build android source still error, and using bash is ok,
try to use

emulate bash

before make.

just ensure you have "#!/usr/bin/env bash" at the first line of your script

emulate sh -c '. ./myscript.sh'

git 命令卡死,cpu 占用率到100%

http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
添加到.zshrc
bash
__git_files () {
_wanted files expl 'local files' _files
}

autojump

autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

https://github.com/wting/autojump
bash
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py or ./uninstall.py

add the following line(s) to ~/.zshrc:

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

vps + onedrive 挂载实验

参考(https://www.moerats.com/archives/491/)

教程写得很详细,按照步骤来即可。
中间碰到几个问题

  1. rclone authorize 获取校验
    vps上没有办法启动browser,只能使用no,手动校验

因为使用的是mac,安装mac版的rclone
macos-installation-from-precompiled-binary

教程很详细,基本上,全部copy即可。

在mac上运行,rclone authorize "onedrive"
浏览器跳出授权校验,然后rclone即可显示key

Waiting for code…
Got code
Paste the following into your remote machine —>
{"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlNTUWRoSTFjS3ZoUUVEU0p4RTJnR1lzNDBRMCIsImtpZCI6IlNTUWRoSTFjS3ZoUUVEU0p4RTJnR1lzNDBRMCJ9.eyJhdWQiOiJodHRwczovL2FwaS5vZmZpY2UuY29tL2Rpc2NvdmVyeS8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC85OGQ0YmE1ZC1lM2RlLTRkZDMtODc5ZC0wNzAwYjhiZDY2NTAvIiwiaWF0IjoxNTIxMTI4MTEwLCJuYmYiOjE1MjExMjgxMTAsImV4cCI6MTUyMTEzMjAxMCwiYWNyIjoiMSIsImFpbyI6IlkYtMjc0OC00YTVlLWJlOTYtOTIwZjQ2MTNhMDYwIiwib25wcmVtX3NpZCI6IlMtMS01LTIxLTI3NjU5ODg3ODYtMjQ4MTA1MzIyMy00MDkxOTg3MTMtNTUyMzU3IiwicHVpZCI6IjEwMDMzRkZGQTdFMDlDNDciLCJzY3AiOiJNeUZpbGVzLlJlYWQgTXlGaWxlcy5Xcml0ZSBVc2VyLlJlYWQiLCJzdWIiOiI1ZjB4c0Q0U1VJSkRTOUdhZ3JRdXU1UlBmRF9EZi1KdEs2SzBLcnEzVWU0IiwidGlkIjoiOThkNGJhNWQtZTNkZS00ZGQzLTg3OWQtMDcwMGI4YmQ2NjUwIiwidW5pcXVlX25hbWUiOiJ3bWluZ3lhbmdAc3R1ZGVudC5jY2MuZWR1IiwidXBuIjoid21pbmd5YW5nQHN0dWRlbnQuY2NjLmVkdSIsInV0aSI6ImRxandYT0xoTDBxbGEwbHRBRFZlQUEiLCJ2ZXIiOiIxLjAifQ.lCWSGusZhaFoIf-1Funf3rCugguFWFY-KxgMCA80YegHqgZLRuvWWI6In3wYNwySh0iK4KPFns1CMlvmIZWatT7Fsd93si_UQMntfJ3LJPRkvdt4OdwepBjAQxb8wlBc8l00ffGPwI5tWOzsFBgmQIx6dzN8lj__o7k5uWTNlIMEi7fZbWkDrm98dBvtHInalBId-U-GWTXZuwgslf0mBQy6oBfdQXigUa1_2rk7oj0QUbnWY0mX7zEno57jmzyY_4uia9S4QfDT42bsG6jDzXE72r9kW8rNQa4T_DgRfO9Msgm5Ea-9cY0xXxE8LrfD-eJvhG7ZNoYB8C59gIp-NQ","token_type":"Bearer","refresh_token":"AQABAAAAAABHh4kmS_aKT5XrjzxRAtHzR4InVUf4plQaM9x9UOZCVY1cKJ98cyPT3RpmmzYTxT83V_fYngu18vNrxMVemhzmm1ymSIV8sON9xPI37DycKgWOndvnxB7Cwpp-KojRTVTqPplii_3j2DbgXzXJzpFTQLb8s55PhfCLL8E_8E3-91cptM0sZHHOZrBvNnV4IC1JURAa2p4edOH6km5r7Xi_ZZXLBTMZ1Y0DKwU_LrR5yNSLKwzq8oBCWgkgSIG2w81wbVxwOjsf_6wQ8Thi4XZE4kp4McBqwheJWv7c06IKBlzMPxZwuQE5gW2BMXHkILTGhTrMm8rACDxkAiJMuFP68AVylh0GaSeE_w6TSa0DNJTiqR2cd4uMf3xDm8Pr__QlnZSAA","expiry":"2018-03-16T00:40:09.97948688+08:00"}
<—End paste%

把大括号里面的内容粘贴到vps上的rclone上,即可配置完成。

  1. mount的时候,参数需要修改
    >rclone mount onedrive_ccc:ebooks /opt/onedrive –copy-links –no-gzip-encoding –no-check-certificate –allow-other –allow-non-empty –umask 000

报错,才发现,只有kvm的vps才行,openVZ的不行,只好换了bwg的

  1. 然后顺利配置自动启动,一路顺利。

  2. 测试写入文件到vps的目录下,onedrive即可看到。

linux-server 安装依赖错误

user@XM4002951:~$ sudo apt-get install linux-server

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages will be upgraded:

  linux-server

1 upgraded, 0 newly installed, 0 to remove and 382 not upgraded.

1 not fully installed or removed.

Need to get 0 B/1,734 B of archives.

After this operation, 1,024 B of additional disk space will be used.

dpkg: dependency problems prevent configuration of linux-server:

linux-server depends on linux-image-server (= 3.2.0.76.90); however:

  Version of linux-image-server on system is 3.2.0.84.98.

linux-server depends on linux-headers-server (= 3.2.0.76.90); however:

  Version of linux-headers-server on system is 3.2.0.84.98.

dpkg: error processing linux-server (–configure):

dependency problems – leaving unconfigured

No apport report written because the error message indicates its a followup error from a previous failure.

                                                                                                          Errors were encountered while processing:

linux-server

E: Sub-process /usr/bin/dpkg returned an error code (1)

user@XM4002951:~$ sudo dpkg-reconfigure linux-server

/usr/sbin/dpkg-reconfigure: linux-server is broken or not fully installed

继续阅读