[CentOS 7] LAMP主機安裝

指令教學

參考網址:https://goo.gl/Bz1F4h

# rpm -qa | grep php //查詢安裝軟體,EX:查 php 安裝軟體

更新檔案

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm //映像檔
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm  //映像檔
# yum update -y

安裝 VIM (編輯器)

# yum install vim-enhanced -y
# mv /bin/vi /bin/vi.bak
# ln -s /usr/bin/vim /bin/vi
# echo "set nu" >> /etc/vimrc //顯示行數

修改 Linux 預設的 Language 以免 Putty 顯示不出中文

# vi /etc/sysconfig/selinux
SELINUX=disabled //關閉

開啟 NTP 自動校時服務

# yum install ntp -y
# systemctl start ntpd
# systemctl enable ntpd
# ntpdate tick.stdtime.gov.tw
# systemctl restart ntpd

安裝Server使用工具

# yum install wget rsyslog telnet -y

安裝 PHP

# yum install php71w-pdo php71w-mbstring php71w-xml php71w-common php71w-mysqlnd php71w-gd php71w-devel php71w-soap php71w php71w-cli php71w-xmlrpc php71w-mcrypt -y

設定

修改 php.ini 的配置

#vi /etc/php.ini

short_open_tag = On
max_execution_time = 300
max_input_time = 600
memory_limit = 128M
display_errors = Off
log_errors = On
ignore_repeated_errors = On
ignore_repeated_source = On
post_max_size = 20M
upload_max_filesize = 16M
date.timezone = Asia/Taipei

httpd.conf 設定

# vi /etc/httpd/conf/httpd.conf

ServerAdmin root@localhost	# 調整成管理者 Email
<Directory />
	AllowOverride ALL
	Require all denied
</Directory>

<Directory "/var/www">
	AllowOverride ALL
	# Allow open access:
	Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
	#
	# Possible values for the Options directive are "None",     "All",
	# or any combination of:
	#   Indexes Includes FollowSymLinks SymLinksifOwnerMatc    h ExecCGI MultiViews
	#
	# Note that "MultiViews" must be named *explicitly* ---     "Options All"
	# doesn't give it to you.
	#
	# The Options directive is both complicated and importa    nt.  Please see
	# http://httpd.apache.org/docs/2.4/mod/core.html#option    s
	# for more information.
	#
	Options FollowSymLinks
	
	#
	# AllowOverride controls what directives may be placed     in .htaccess files.
	# It can be "All", "None", or any combination of the ke    ywords:
	#   Options FileInfo AuthConfig Limit
	#
	AllowOverride ALL
	
	#
	# Controls who can get stuff from this server.
	#
	Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm
</IfModule>

<Directory "/var/www/cgi-bin">
	AllowOverride ALL
	Options FollowSymLinks
	Require all granted
</Directory>

<IfModule prefork.c>
StartServers			8		# 啟動 httpd 時,喚醒幾個 PID 來處理服務的意思
MinSpareServers			5		# 最小的預備使用的 PID 數量
MaxSpareServers			20		# 最大的預備使用的 PID 數量
ServerLimit				10000	# 伺服器的限制
MaxClients				256		# 最多可以容許多少個用戶端同時連線到 httpd 的意思
MaxRequestsPerChild  500
</IfModule>


<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

# systemctl restart httpd	# 設定完需重啟Apache

設定 virtual.conf 檔案

# vi /etc/httpd/conf.d/virtual.conf	# 第一次會沒有這檔案,直接新增

NameVirtualHost *:80				# virtual.conf 檔案最上面放置一次即可

<Directory "/var/www/test">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<VirtualHost *:80>
    ServerName    test.test.com
    DocumentRoot  /var/www/test
    CustomLog     /var/log/httpd/test.access_log combined
    ErrorLog      /var/log/httpd/test_error_log
</VirtualHost>

# systemctl restart httpd				# 設定完需重啟Apache

服務設定
啟用服務並開機自動啟用

# systemctl start httpd
# systemctl enable httpd

防火牆
設定 firewall 允許 http(80 Port)、https(443 Port)封包通行

# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload

檢設 firewall 的設定

# firewall-cmd --zone=public --list-all
回饋
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: dhcpv6-client ssh http https
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

安裝 MariaDB

# yum install mariadb-server mariadb -y

初始化設定

須先啟用服務,才可進行初始化

# systemctl start mariadb

進行初始化設定

# mysql_secure_installation

/usr/bin/mysql_secure_installation: line 379: find_mysql_client:命令找不到
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): 

# 輸入目前 MariaDB 的 root 密碼(第一次設定應該是空的,所以直接「ENTER」即可)

OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n]

# 直接「ENTER」

New password:

# 設定新的密碼

Re-enter new password:

# 再次確認密碼

Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] 

# 是否要移除 anonymous user 的資料,直接「ENTER」

... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] 

# 是否只允許讓 root 從 localhost 登入,無法從其他的網路登入,直接「ENTER」

... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] 

# 是否移除 test 的資料庫,直接「ENTER」

- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] 

# 是否要重新載入權限的 table 資訊,直接「ENTER」

... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

服務設定
啟用服務並開機自動啟用

# systemctl start mariadb
# systemctl enable mariadb

安裝 MC (GUI介面)

參考網址:https://goo.gl/hiqCUq

# yum install mc -y

安裝 ZIP (壓縮軟體)

# yum install zip unzip -y

安裝 nmap (查 Port 軟體)

# yum install nmap -y
# nmap -sT -O localhost

[CentOS 7] 安裝 PHP 5.6 Memcached 結合 Codeigniter 2.2

memcached 是一套分散式的快取系統,由 LiveJournal 的 Brad Fitzpatrick 開發,但目前被許多網站使用。這是一套開放原始碼軟體,以 BSD license 授權釋出。

memcached 缺乏認證以及安全管制,這代表應該將 memcached 伺服器放置在防火牆後。

memcached 的API使用三十二位元的循環冗餘校驗(CRC-32)計算鍵值後,將資料分散在不同的機器上。當表格滿了以後,接下來新增的資料會以 LRU 機制替換掉。由於 memcached 通常只是當作快取系統使用,所以使用 memcached 的應用程式在寫回較慢的系統時(像是後端的資料庫)需要額外的程式碼更新 memcached 內的資料。

1. 安裝 Memcached

在 CentOS 7 直接使用 yum 直接安裝

# yum install memcached -y

2. 設定 Memcached

開啟 Memcached 設定檔

# vi /etc/sysconfig/memcached

Memcached 預設埠號 11211, 記憶體為 512M

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""

3. 啟動 Memcached 且開機後自動啟動

Memcached 預設埠號 11211, 記憶體為 512M

# systemctl enable memcached
# systemctl start memcached

4. 開啟防火牆埠號

將防火牆 11211 埠號對外開啟

# firewall-cmd --zone=public --add-port=11211/tcp --permanent
# firewall-cmd --reload

5. 安裝 Memcached 的 PHP 模組

安裝相關 PHP 模組, 才可以使用 Memcached 功能

# yum install php56w-pecl-memcache -y

安裝後請重新啟動 memcached 及 httpd

# systemctl restart memcached
# systemctl restart httpd

安裝成功後查看 phpinfo 會出現如下資訊

6. 設定 Codeigniter 2.2

在 /application/config/ 新增一隻檔案 memcached.php, 內容如下:

if (! defined ( 'BASEPATH' )) exit ( 'No direct script access allowed' );

$config['memcached'] = array(
	'hostname' => '127.0.0.1',	//主機位置
	'port' => 11211,			//主機埠號
	'weight' => 1
);

修改 /system/libraries/Cache/drivers/Cache_memcached.php

原始如下:

$this->_memcached = new Memcached();

調整如下:

if (class_exists("Memcached")) {
  $this->_memcached = new Memcached();
} else {
  $this->_memcached = new Memcache();
}

因此檔案宣告變數是錯誤故而調整

原始如下:

foreach ($this->_memcache_conf as $name => $cache_server)
{
	if ( ! array_key_exists('hostname', $cache_server))
	{
		$cache_server['hostname'] = $this->_default_options['default_host'];
	}

	if ( ! array_key_exists('port', $cache_server))
	{
		$cache_server['port'] = $this->_default_options['default_port'];
	}

	if ( ! array_key_exists('weight', $cache_server))
	{
		$cache_server['weight'] = $this->_default_options['default_weight'];
	}

	$this->_memcached->addServer(
			$cache_server['hostname'], $cache_server['port'], $cache_server['weight']
	);
}

調整如下:

foreach ($this->_memcache_conf as $name => $cache_server)
{
	if ( ! array_key_exists('hostname', $cache_server))
	{
		$cache_server['hostname'] = $this->_memcache_conf['default_host'];
	}

	if ( ! array_key_exists('port', $cache_server))
	{
		$cache_server['port'] = $this->_memcache_conf['default_port'];
	}

	if ( ! array_key_exists('weight', $cache_server))
	{
		$cache_server['weight'] = $this->_memcache_conf['default_weight'];
	}

	$this->_memcached->addServer(
			$cache_server['hostname'], $cache_server['port'], $cache_server['weight']
	);
}

原始如下:

if ( ! extension_loaded('memcached'))

調整如下:

if (!extension_loaded('memcached') && !extension_loaded('memcache'))

7. 使用範例

&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Test_model extends MY_Model {
	public function __construct(){
		parent::__construct();
		$this->from = 'test';
		$this->id = 'test_id';
		$this->listSelect = 'test_id, test_name';
		$this->rowSelect = '*';
		$this->abrv = 'test_';
		$this->orderBy = 'created_date';
	}

	public function getList($queryData=array()) {
        $this->load->driver('cache');
        $result = $this->cache->memcached->get('key');				//key
        if (!$result) {
			$this->db->select($this->listSelect)
					 ->from($this->from)
					 ->where($this->abrv.$this->is_del, 0)
					 ->order_by($this->abrv.$this->orderBy, $this->orderType);

			if( isset($queryData['keyword']) && $queryData['keyword'] ){
				$this->db->where("( `test_name` LIKE '%" . $queryData['keyword'] . "%')", NULL, FALSE);
			}

			$result = $this->db->get();
			$result = $result->result_array();
			$this->cache->memcached->save('key', $result, 60);		//key, value, time(s)
		}
		return $result;
	}
}

[CentOS 7] 安裝 GIT

1. 查詢 yum 套件包的 GIT 版本

# yum info git

截至目前 yum 套件包中最新的 GIT 版本才 1.8.3.1,
而查看最新 GIT 發布版本是 v2.18.0-rc2。

2. 安裝相關依附套件

# yum install gcc gcc-g++ g++ make -y
# yum install openssl openssl-devel zlib-devel libcurl libcurl-devel -y
# yum install expat-devel.x86_64 -y

※若無安裝相關依附套件可能發生錯誤訊息如下

make: *** [credential-store.o] Error 127
make: *** [credential-store.o] Error 1
make: *** [http-push.o] Error 1

3. 刪除版本低的 GIT 套件

通過指令:git –-version 查看系统带的版本,
GIT 版本是:1.8.3.1,
所以要先刪除版本低的 GIT

# yum remove git

4. 下载新版的 GIT 壓縮檔

# wget https://github.com/git/git/archive/v2.18.0-rc2.zip

新版 GIT 壓縮檔會以官方發版的版本有所改變

5. 解壓縮檔案

# unzip v2.18.0-rc2.zip

6. 安装 GIT

# cd git-2.18.0-rc2
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install

7. 增加到環境變數

# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc //立即生效

8. 查看版本号

# git --version

用此指令可查看現在 CentOS 7 是否已更新到最新版本

[CentOS 7] LNMP主機安裝

指令教學

參考網址:https://goo.gl/Bz1F4h

# rpm -qa | grep php //查詢安裝軟體,EX:查 php 安裝軟體

更新檔案

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm //映像檔
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm  //映像檔
# yum update -y

安裝 VIM (編輯器)

# yum install vim-enhanced -y
# mv /bin/vi /bin/vi.bak
# ln -s /usr/bin/vim /bin/vi
# echo "set nu" >> /etc/vimrc //顯示行數

修改 Linux 預設的 Language 以免 Putty 顯示不出中文

# vi /etc/sysconfig/selinux
SELINUX=disabled //關閉

開啟 NTP 自動校時服務

# yum install ntp -y
# systemctl start ntpd
# systemctl enable ntpd
# ntpdate tick.stdtime.gov.tw
# systemctl restart ntpd

安裝Server使用工具

# yum install wget rsyslog telnet -y

安裝 PHP

# yum install php71w-pdo php71w-mbstring php71w-xml php71w-common php71w-mysqlnd php71w-gd php71w-devel php71w-soap php71w php71w-cli php71w-xmlrpc php71w-mcrypt -y

設定

修改 php.ini 的配置

#vi /etc/php.ini

short_open_tag = On
max_execution_time = 300
max_input_time = 600
memory_limit = 128M
display_errors = Off
log_errors = On
ignore_repeated_errors = On
ignore_repeated_source = On
post_max_size = 20M
upload_max_filesize = 16M
date.timezone = Asia/Taipei

安裝 Nginx

CentOS 7.1 中,Nginx 並未被正式收錄在 yum,因此無法安裝,可自行加入 Nginx 官方提供的 CentOS 7 yum repository,即可直接安裝。

# rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
# yum install nginx -y

Nginx 相關檔案位置:
所有設定檔:/etc/nginx/
主要設定檔:/etc/nginx/nginx.conf
預設設定檔:/etc/nginx/conf.d/default.conf
程序設定檔:/usr/sbin/nginx
log 檔:/var/log/nginx/

主要設定檔
Nginx 服務的主要設定檔

# vi /etc/nginx/nginx.conf

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
    worker_connections 1024;
}
http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;
    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    # 讀取此目錄的檔案為 .conf 結尾做 Virtual Host
    include /etc/nginx/conf.d/*.conf;
    # 設定可上傳最大檔案容量 (依需求而定)
    client_max_body_size 30m;
#    server {
#        listen       80 default_server;
#        listen       [::]:80 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }
#
# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2 default_server;
#        listen       [::]:443 ssl http2 default_server;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        location / {
#        }
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }
}

虛擬主機設定檔
Nginx 預設的主機設定檔

# vi /etc/nginx/conf.d/phpadmin.conf

server {
    # 這個主機的 Port
    listen       80;
    # 這個主機的名稱
    server_name  phpadmin.system.com.tw;
    # 設定預設編碼,但通常都是由網頁 來定義,因此預設註解
    #charset koi8-r;
    # 針對這個主機的 log 檔位置
    #access_log  /var/log/nginx/log/host.access.log  main;
    # html 檔
    location / {
        # 網站的根目錄位置
        root   /usr/share/nginx/html/phpadmin/;
        # 使用「瀏覽器」瀏覽根目錄時,未指定檔名時預設使用的檔案
        index  index.php index.html index.htm;
        # [須手動新增] 在瀏覽器呈現目錄樹為 on;反之 off,正試上線最好設成 off(預設值 off)
        autoindex off;
    }
    # 發生 404 指定導向哪個網頁
    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}
    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    # php 檔 (與 PHP-FPM 連動)
    location ~ \.php$ {
        # 網站的根目錄位置
        root           /usr/share/nginx/html/phpadmin;
        # 要使用 FastCGI 解析的檔案位置
        fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
        # 使用「瀏覽器」瀏覽根目錄時,未指定檔名時預設使用的檔案
        fastcgi_index  index.php;
        try_files $uri =404;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

服務設定
啟用服務並開機自動啟用

# systemctl start nginx
# systemctl enable nginx

防火牆
設定 firewall 允許 http(80 Port)、https(443 Port)封包通行

# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload

檢設 firewall 的設定

# firewall-cmd --zone=public --list-all
回饋
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: dhcpv6-client ssh http https
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

安裝 PHP-FPM

php-fpm:也就是 FastCGI,透過它來讓 Nginx 與 PHP 之間交互連動

# yum install php71w-fpm -y

設定
修改 php-fpm 的配置

# vi /etc/php-fpm.d/www.conf

;user = apache
user = nginx

;group = apache
group = nginx

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock

//預設帳戶、群組,為正在運作的帳戶
;listen.owner = nobody
listen.owner = nginx

;listen.group = nobody
listen.group = nginx

//權限(預設為 0666)
;listen.mode = 0660
listen.mode = 0666

; session 的路徑
php_value[session.save_path] = /var/lib/php/session

修改 session 路徑的擁有者、群組為 nginx

# chown nginx:nginx /var/lib/php/session/

修改網站根目錄的擁有者、群組為 nginx

# chown -R nginx:nginx /usr/share/nginx/html

重啟 Nginx 服務

# systemctl restart nginx

服務設定

# systemctl start php-fpm
# systemctl enable php-fpm

安裝 MariaDB

# yum install mariadb-server mariadb -y

初始化設定

須先啟用服務,才可進行初始化

# systemctl start mariadb

進行初始化設定

# mysql_secure_installation

/usr/bin/mysql_secure_installation: line 379: find_mysql_client:命令找不到
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): # 輸入目前 MariaDB 的 root 密碼(第一次設定應該是空的,所以直接「ENTER」即可)
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] # 直接「ENTER」
New password: # 設定新的密碼
Re-enter new password: # 再次確認密碼
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] # 是否要移除 anonymous user 的資料,直接「ENTER」
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] # 是否只允許讓 root 從 localhost 登入,無法從其他的網路登入,直接「ENTER」
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] # 是否移除 test 的資料庫,直接「ENTER」
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] # 是否要重新載入權限的 table 資訊,直接「ENTER」
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

安裝 MC (GUI介面)

參考網址:https://goo.gl/hiqCUq

# yum install mc -y

安裝 ZIP (壓縮軟體)

# yum install zip unzip -y

安裝 nmap (查 Port 軟體)

# yum install nmap -y
# nmap -sT -O localhost