Eric Tu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
MySQL === # MYSQL SETTING ``` [root@localhost conf.d]# sudo service mysqld start Redirecting to /bin/systemctl start mysqld.service [root@localhost conf.d]# sudo grep 'temporary password' /var/log/mysqld.log 2017-05-03T05:55:14.109793Z 1 [Note] A temporary password is generated for root@localhost: TaiOnb;3!B3k [root@localhost conf.d]# ``` ``` [root@localhost conf.d]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 5.7.18 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Eric_tu168'; ``` ``` mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Eric_tu'; ERROR 1819 (HY000): Your password does not satisfy the current policy requirements mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Eric_tu168'; Query OK, 0 rows affected (0.01 sec) mysql> SHOW databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.05 sec) mysql> ``` If something goes wrong during installation, you might find debug information in the error log file /var/log/mysqld.log. ``` mysql> CREATE DATABASE msgbaord; Query OK, 1 row affected (0.00 sec) mysql> USE msgboard ERROR 1049 (42000): Unknown database 'msgboard' mysql> DROP DATABASE msgbaord; Query OK, 0 rows affected (0.06 sec) mysql> CREATE DATABASE msgboard; Query OK, 1 row affected (0.01 sec) mysql> USE msgboard; Database changed ``` --- ``` mysql> CREATE TABLE msglist ( user VARCHAR(25) NOT NULL , text VARCHAR(128) NOT NULL ) ENGINE = InnoDB; Query OK, 0 rows affected (0.08 sec) ``` ``` 2017/05/04 04:01:55 [error] 58831#0: *56 FastCGI sent in stderr: "PHP message: PHP Warning: mysql_connect(): Headers and client library minor version mismatch. Headers: 50550 Library: 50631 in /usr/share/nginx/html/msg_board/dbconfig.php on line 6" while reading response header from upstream, client: 192.168.171.1, server: test123, request: "POST /msg_board/add_data.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "test123", referrer: "http://test123/msg_board/add_data.php" ``` 版本不符合 http://stackoverflow.com/questions/10759334/headers-and-client-library-minor-version-mismatch 先將PHP的資訊列出來 ```bash= php -i > log.txt vim log.txt ``` /API 可以發現 ``` Client API library version => 5.6.31 Client API header version => 5.5.50-MariaDB ``` ``` [root@localhost nginx]# mysql -V mysql Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using EditLine wrapper [root@localhost nginx]# php -v PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02) ``` --- ```bash= yum list|grep -i mysql php-mysqlnd.x86_64 5.4.16-42.el7 base ``` 更新PHP 5.4 到 5.6 後各種設定跑掉 確定一下php-fpm 各種設定 nginx 應該不用動 不過要重啟 權限要設定好 更改 conf.d/default 中的 user 從apache 到 nginx ``` systemctl disable firewalld systemctl stop firewalld systemctl status firewalld ``` # https://kknews.cc/other/qye96lb.html 詳細 # How to Fix PHP Error: Call to undefined function posix_getpwuid() ```bash= yum install php-posix ``` 解決無法用ssh連入的問題 ``` Connecting to 172.17.11.147:22... Could not connect to '172.17.11.147' (port 22): Connection failed. Type `help' to learn how to use Xshell prompt. Xshell:\> ``` 先關掉防火牆重啟看看 ``` 出现这种情况的原因: 1.服务器端防火墙关闭了22端口,没有开启ssh服务; 2.没有安装ssh; 解决原因1:使用netstat,查看是否启动shh服务; 开启ssh服务:service sshd start 关闭ssh服务:service sshd stop 重启ssh服务:servcie sshd restart SSH服务开机自动启动:chkconfig sshd on 取消开机自启动:chkconfig sshd off 开启服务后,检查服务状态:service sshd status 解决原因2:安装ssh: yum install openssh-server ``` 沒用 service ssh status ``` sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled) Active: activating (auto-restart) (Result: exit-code) since Thu 2016-05-05 03:30:48 UTC; 2s ago Process: 10938 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS) Process: 10944 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=255) Main PID: 10944 (code=exited, status=255) May 05 03:30:48 ixnetwork-uk1 systemd[1]: sshd.service: main process exited, code=exited, status=255/n/a May 05 03:30:48 ixnetwork-uk1 systemd[1]: Unit sshd.service entered failed state. ``` # SELinux https://blog.ixnet.work/2016/05/05/change-centos-ssh-port/ https://serverfault.com/questions/538037/sshd-service-fails-to-start http://asherwang.blog.51cto.com/11255017/1894122 yum provides /usr/sbin/semanage yum -y install policycoreutils-python semanage port -l | grep ssh 只允許port 22 http://sharadchhetri.com/2014/10/15/centos-7-rhel-7-change-openssh-port-number-selinux-enabled/ 去修改ssd_config port 然後新增規則 # 永久性的關掉 selinux $ sudo vi /etc/sysconfig/selinux 找到 SELINUX=enforcing 然後修改為 SELINUX=disabled 要重新開機 reboot / restart 後才會套用 http://blog.xuite.net/tolarku/blog/195633562-CentOS+%E9%97%9C%E9%96%89+selinux 終於成功了QQ 解決403問題 從 nginx log 發現可能是 php-fpm 的問題 再看到 php-fpm log ``` [22-May-2017 08:43:38] WARNING: [pool www] child 2037 said into stderr: "ERROR: Unable to set php_value 'soap.wsdl_cache_dir'"~ ``` 找到 php-fpm.d/www.conf ``` ; Set session path to a directory owned by process user~ 224 php_value[session.save_handler] = files~ 225 php_value[session.save_path] = /var/lib/php/session~ 226 php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache~ ``` ```bash= yum install php56w-soap ``` # Primary script unknown because nginx doesn't have the right to access dir http://stackoverflow.com/questions/24208139/nginx-php-fpm-file-not-found --- 6 down vote If you checked every thing and it's correct configured, then there is last point i got: check that correct username if mentioned in file /etc/php-fpm.d/www.conf shareimprove this answer answered Feb 24 '15 at 13:11 Nazir 1,4451419 2 Exactly this problem on OS X Yosemite with PHP 5.6 installed via Homebrew. It's quite tricky to debug because neither the Nginx error log or the php-fpm error log, even in "Debug" mode, apparently won't give you any further details than "Primary Script Unknown". The default user/group is _www:_www, which may well be not what you want (I use [myname]:staff). To restart use sudo /usr/local/opt/php56/sbin/php56-fpm restart. – William Turrell Aug 2 '15 at 15:13 This helped me after wasting an hour trying to find a solution. Thanx – Sahil May 1 '16 at 22:48 ---

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully