Bo's Oracle Station

查看: 1831|回复: 1

课程第28次:2020-04-01星期三

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-4-1 20:16:09 | 显示全部楼层 |阅读模式
1. DDL : CREATE TABLE
1.1
  1. MariaDB [inventory]> create table product ( id  int(11)  primary key auto_increment ,
  2.     ->                                      name varchar(100)  not null,
  3.     ->                                      price double  not null,
  4.     ->                                      stock int(11),
  5.     ->                                      id_category int(11),
  6.     ->                                      id_manufacturer int(11) ) ;
  7. Query OK, 0 rows affected (0.018 sec)

  8. MariaDB [inventory]>
复制代码
  1. MariaDB [inventory]> alter table product  add constraint check ( id_category  is not null ) ;
  2. Query OK, 1 row affected (0.043 sec)               
  3. Records: 1  Duplicates: 0  Warnings: 0
复制代码
  1. MariaDB [inventory]> alter table product modify stock int(11) not null;
  2. Query OK, 0 rows affected (0.246 sec)
  3. Records: 0  Duplicates: 0  Warnings: 0
复制代码



2. DML (CRUD)
2.1  
  1. MariaDB [inventory]> insert into product (name, price, stock, id_category, id_manufacturer) values
  2.     ->                     ('SDSSDP-128G-G25 2.5', 82.04 , 30 , 3,1);
  3. Query OK, 1 row affected (0.003 sec)
复制代码
  1. MariaDB [inventory]> update product  set price=92.04, stock=31 where id=1;
  2. Query OK, 1 row affected (0.004 sec)
  3. Rows matched: 1  Changed: 1  Warnings: 0
复制代码
  1. MariaDB [inventory]> insert into product (name, price, stock, id_category, id_manufacturer) values                     ('CPU A', 1000.04 , 30 , 3,10);
  2. Query OK, 1 row affected (0.003 sec)

  3. MariaDB [inventory]> select  * from product;
  4. +----+---------------------+---------+-------+-------------+-----------------+
  5. | id | name                | price   | stock | id_category | id_manufacturer |
  6. +----+---------------------+---------+-------+-------------+-----------------+
  7. |  1 | SDSSDP-128G-G25 2.5 |   92.04 |    31 |           3 |               1 |
  8. |  2 | CPU A               | 1000.04 |    30 |           3 |              10 |
  9. +----+---------------------+---------+-------+-------------+-----------------+
  10. 2 rows in set (0.001 sec)

  11. MariaDB [inventory]> delete from product where id=2;
  12. Query OK, 1 row affected (0.004 sec)

  13. MariaDB [inventory]> select  * from product;
  14. +----+---------------------+-------+-------+-------------+-----------------+
  15. | id | name                | price | stock | id_category | id_manufacturer |
  16. +----+---------------------+-------+-------+-------------+-----------------+
  17. |  1 | SDSSDP-128G-G25 2.5 | 92.04 |    31 |           3 |               1 |
  18. +----+---------------------+-------+-------+-------------+-----------------+
  19. 1 row in set (0.001 sec)

  20. MariaDB [inventory]>
复制代码
3. DCL :GRANT:
  1. MariaDB [inventory]> grant select  on  inventory.* to mobius@'%';
  2. Query OK, 0 rows affected (0.001 sec)
复制代码

4. Apache:
  1. <VirtualHost *:80>
  2.     ServerAdmin root@server4.example.com
  3.     DocumentRoot "/var/www/html"
  4.     <Directory "/var/www/html">
  5.       Options Indexes FollowSymLinks
  6.       AllowOverride None
  7.       Require all granted
  8.     </Directory>
  9.     ServerName server4.example.com
  10.     ErrorLog "/var/log/httpd/server4.example.com-error.log"
  11.     CustomLog "/var/log/httpd/server4.example.com-access.log" common
  12. </VirtualHost>

  13. <VirtualHost *:80>
  14.     ServerAdmin root@www4.example.com
  15.     DocumentRoot "/var/www/virtual"
  16.     <Directory "/var/www/virtual">
  17.       Options FollowSymLinks
  18.       AllowOverride None
  19.       Require all granted
  20.     </Directory>
  21.     ServerName www4.example.com
  22.     ErrorLog "/var/log/httpd/www4.example.com-error.log"
  23.     CustomLog "/var/log/httpd/www4.example.com-access.log" common
  24. </VirtualHost>
复制代码

SSL.conf的完整:
  1. #
  2. # When we also provide SSL we have to listen to the
  3. # standard HTTPS port in addition.
  4. #
  5. Listen 443 https

  6. ##
  7. ##  SSL Global Context
  8. ##
  9. ##  All SSL configuration in this context applies both to
  10. ##  the main server and all SSL-enabled virtual hosts.
  11. ##

  12. #   Pass Phrase Dialog:
  13. #   Configure the pass phrase gathering process.
  14. #   The filtering dialog program (`builtin' is a internal
  15. #   terminal dialog) has to provide the pass phrase on stdout.
  16. SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog

  17. #   Inter-Process Session Cache:
  18. #   Configure the SSL Session Cache: First the mechanism
  19. #   to use and second the expiring timeout (in seconds).
  20. SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
  21. SSLSessionCacheTimeout  300

  22. #
  23. # Use "SSLCryptoDevice" to enable any supported hardware
  24. # accelerators. Use "openssl engine -v" to list supported
  25. # engine names.  NOTE: If you enable an accelerator and the
  26. # server does not start, consult the error logs and ensure
  27. # your accelerator is functioning properly.
  28. #
  29. SSLCryptoDevice builtin
  30. #SSLCryptoDevice ubsec

  31. ##
  32. ## SSL Virtual Host Context
  33. ##

  34. <VirtualHost _default_:443>
  35. ServerAdmin root@server4.example.com
  36.     WSGIScriptAlias / /var/www/html/special.wsgi
  37.     ServerName server4.example.com
  38.     ErrorLog "/var/log/httpd/https_server4.example.com-error.log"
  39.     CustomLog "/var/log/httpd/https_server4.example.com-access.log" common
  40. SSLEngine on
  41. SSLProtocol all -SSLv3
  42. SSLHonorCipherOrder on
  43. SSLCipherSuite PROFILE=SYSTEM
  44. SSLProxyCipherSuite PROFILE=SYSTEM
  45. SSLCertificateFile /etc/pki/tls/certs/server4.crt
  46. SSLCertificateKeyFile /etc/pki/tls/private/server4.key
  47. SSLCACertificateFile /etc/pki/tls/certs/example-ca.crt
  48. </VirtualHost>

  49. <VirtualHost _default_:443>
  50. ServerAdmin root@www4.example.com
  51.     DocumentRoot "/var/www/virtual"
  52.     ScriptAlias  /cgi-bin/ '/var/www/cgi-bin/'
  53.     <Directory "/var/www/virtual">
  54.       Options Indexes FollowSymLinks
  55.       AllowOverride None
  56.       Require all granted
  57.     </Directory>

  58.      <Directory "/var/www/virtual/money">
  59.       Options Indexes FollowSymLinks
  60.       AllowOverride None
  61.       Require all denied
  62.       Require local
  63.     </Directory>
  64.    
  65.     ServerName www4.example.com
  66.     ErrorLog "/var/log/httpd/https_www4.example.com-error.log"
  67.     CustomLog "/var/log/httpd/https_www4.example.com-access.log" common
  68. SSLEngine on
  69. SSLProtocol all -SSLv3
  70. SSLHonorCipherOrder on
  71. SSLCipherSuite PROFILE=SYSTEM
  72. SSLProxyCipherSuite PROFILE=SYSTEM
  73. SSLCertificateFile /etc/pki/tls/certs/server4.crt
  74. SSLCertificateKeyFile /etc/pki/tls/private/server4.key
  75. SSLCACertificateFile /etc/pki/tls/certs/example-ca.crt
  76. </VirtualHost>

复制代码









回复

使用道具 举报

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
 楼主| 发表于 2020-4-4 20:17:13 | 显示全部楼层
补充视频:
1. IPv6 LOCAL LINK不用设置就有:
  1. [root@cracker133 ~]# ifconfig ens33
  2. ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
  3.         inet 192.168.1.133  netmask 255.255.255.0  broadcast 192.168.1.255
  4.         inet6 fe80::20c:29ff:fefc:1ec4  prefixlen 64  scopeid 0x20<link>
  5.         ether 00:0c:29:fc:1e:c4  txqueuelen 1000  (Ethernet)
  6.         RX packets 154  bytes 23675 (23.1 KiB)
  7.         RX errors 0  dropped 0  overruns 0  frame 0
  8.         TX packets 197  bytes 20834 (20.3 KiB)
  9.         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
复制代码
inet6 fe80::20c:29ff:fefc:1ec4
ether 00:0c:29:fc:1e:c4
这个IPv6地址是MAC地址变来的:MAC48bit需要填充ff:fe形成64bit的IPv6主机部分,加上64bit:fe80::2,构成128bit的本地链IPv6地址
2. IPv6没有192.168/172.16/10这些RFC1918, 而只有fd00::/8这个RFC4193


3. IPv6的 DHCP要用:ff00::/8 (ff02::1)

4. LOCAL LINK 地址在ssh时要写%, 而2000的地址不能
  1. [root@server5 ~]# ssh  2003:ac18::305
  2. The authenticity of host '2003:ac18::305 (<no hostip for proxy command>)' can't be established.
  3. ECDSA key fingerprint is SHA256:mh2gX29DHW4YsRvJsbyBbbwWbMLKfltjuyzZE1HNHBk.
  4. Are you sure you want to continue connecting (yes/no)? ^C
  5. [root@server5 ~]# ssh  2003:ac18::305
  6. The authenticity of host '2003:ac18::305 (<no hostip for proxy command>)' can't be established.
  7. ECDSA key fingerprint is SHA256:mh2gX29DHW4YsRvJsbyBbbwWbMLKfltjuyzZE1HNHBk.
  8. Are you sure you want to continue connecting (yes/no)? ^C
  9. [root@server5 ~]# ssh   fe80::d032:ed47:17aa:b962
  10. ssh_exchange_identification: Connection closed by remote host
复制代码


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-4 01:14 , Processed in 0.031192 second(s), 25 queries .

快速回复 返回顶部 返回列表