搭建lamp架構及部署phpmyadmin

来源:https://www.cnblogs.com/Their-own/archive/2022/08/03/16543616.html
-Advertisement-
Play Games

搭建lamp架構 1.LAMP架構介紹 所謂lamp,其實就是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一組動態網站或者伺服器的開源軟體,除Linux外其它各部件本身都是各自獨立的程式,但是因為經常被放在一起使用,擁有了越來越高的相容度,共同組成了一個強 ...


搭建lamp架構

目錄

1.LAMP架構介紹

所謂lamp,其實就是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一組動態網站或者伺服器的開源軟體,除Linux外其它各部件本身都是各自獨立的程式,但是因為經常被放在一起使用,擁有了越來越高的相容度,共同組成了一個強大的Web應用程式平臺。

LAMP指的是Linux(操作系統)、Apache(HTTP伺服器)、MySQL(也指MariaDB,資料庫軟體)和PHP(有時也是指Perl或Python)的第一個字母,一般用來建立web應用平臺。

2.架構說明

LAMP架構說明.png

apache主要實現如下功能:

第一:處理http的請求、構建響應報文等自身服務;

第二:配置讓Apache支持PHP程式的響應(通過PHP模塊或FPM);

第三:配置Apache具體處理php程式的方法,如通過反向代理將php程式交給fcgi處理。

mariadb主要實現如下功能:

第一:提供PHP程式對數據的存儲;

第二:提供PHP程式對數據的讀取(通常情況下從性能的角度考慮,儘量實現資料庫的讀寫分離)。

php主要實現如下功能:

第一:提供apache的訪問介面,即CGI或Fast CGI(FPM);

第二:提供PHP程式的解釋器;

第三:提供mairadb資料庫的連接函數的基本環境。

由此可知,要實現LAMP在配置每一個服務時,安裝功能需求進行配置,即可實現LAMP的架構,當然apache、mariadb和php服務都可配置為獨立服務,安裝在不同伺服器之上。

3.lamp平臺搭建

環境說明

系統平臺 IP 需要安裝的服務
centos8 192.168.111.135 http
mysql
php
php-mysql

lamp平臺軟體安裝次序:

http - - > mysql - - > php			//順序不可逆

阿裡雲

配置一下倉庫源

[root@localhost ~]# cd /etc/yum.repo.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# cd
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
[root@localhost ~]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@localhost ~]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@localhost ~]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

3.1 編譯安裝httpd

//先下載需要的依賴包
[root@localhost ~]# dnf -y groupinstall "Development Tools" --allowerasing
[root@localhost ~]# dnf -y install wget openssl-devel pcre-devel expat-devel libtool libxml2-devel make gcc gcc-c++

//創建一個apache的用戶
[root@localhost ~]# useradd -r -M -s /sbin/nologin apache
[root@localhost ~]# id apache
uid=994(apache) gid=991(apache) groups=991(apache)

//wget下載安裝httpd所需要的包
[root@localhost ~]# wget https://downloads.apache.org/apr/apr-1.7.0.tar.gz https://downloads.apache.org/apr/apr-util-1.6.1.tar.gz https://downloads.apache.org/httpd/httpd-2.4.54.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg  apr-1.7.0.tar.gz  apr-util-1.6.1.tar.gz  httpd-2.4.54.tar.gz

//解壓並編譯
[root@localhost ~]# tar xf apr-1.7.0.tar.gz 
[root@localhost ~]# tar xf apr-util-1.6.1.tar.gz 
[root@localhost ~]# tar xf httpd-2.4.54.tar.gz 
[root@localhost ~]# ls
anaconda-ks.cfg  apr-1.7.0  apr-1.7.0.tar.gz  apr-util-1.6.1  apr-util-1.6.1.tar.gz  httpd-2.4.54  httpd-2.4.54.tar.gz

//進入apr-1.7.0的configure刪除這一行或者註釋這一行
[root@localhost ~]# cd apr-1.7.0
[root@localhost apr-1.7.0]# vim configure
cfgfile=${ofile}T
    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
    #$RM "$cfgfile"			//註釋這行

//編譯apr
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
[root@localhost apr-1.7.0]# make && make install

//編譯apr-util
[root@localhost httpd-2.4.54]# cd ../apr-util-1.6.1
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
[root@localhost apr-util-1.6.1]# make && make install

//編譯httpd
[root@localhost ~]# cd httpd-2.4.54
[root@localhost httpd-2.4.54]# ./configure --prefix=/usr/local/apache --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-rpm=prefork
[root@localhost httpd-2.4.54]# make && make install

//配置環境變數
[root@localhost ~]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/apache.sh
[root@localhost ~]# source /etc/profile.d/apache.sh
[root@localhost ~]# which apachectl
/usr/local/apache/bin/apachectl

//創建頭文件軟連接
[root@localhost ~]# ln -s /usr/local/apache/include/ /usr/include/apache

//添加幫助文檔
[root@localhost ~]# vim /etc/man_db.conf 
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
MANDATORY_MANPATH                       /usr/local/apache/man		//添加

//取消警報
[root@localhost ~]# vim /usr/local/apache/conf/httpd.conf
ServerName www.example.com:80 		//取消這行註釋

//編寫控制腳本
[root@localhost ~]# cd /usr/lib/systemd/system/
[root@localhost system]# cp sshd.service httpd.service
[root@localhost system]# vim httpd.service 
[Unit]
Description=httpd server daemon
After=network.target sshd-keygen.target

[Service]
Type=forking
ExecStart=/usr/local/apache/bin/apachectl start
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/local/apache/bin/apachectl stop

[Install]
WantedBy=multi-user.target
[root@localhost ~]# systemctl daemon-reload			//刷新一下

//設置開機自啟動
[root@localhost ~]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# ss -anlt
State            Recv-Q           Send-Q                     Local Address:Port                     Peer Address:Port           Process           
LISTEN           0                128                              0.0.0.0:22                            0.0.0.0:*                                
LISTEN           0                128                                    *:80                                  *:*                                
LISTEN           0                128                                 [::]:22                               [::]:*                                

//關閉防火牆和selinux
[root@localhost ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# vim /etc/selinux/config 
SELINUX=disabled
[root@localhost ~]# setenforce 0

3.2 二進位安裝mysql

//安裝依賴包
[root@localhost ~]# yum -y install ncurses-devel openssl-devel openssl cmake mariadb-devel ncurses-compat-libs

//創建用戶
[root@localhost ~]# useradd -r -M -s /sbin/nologin mysql
[root@localhost ~]# id mysql
uid=993(mysql) gid=990(mysql) groups=990(mysql)

//下載二進位包
[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz

//解壓軟體包
[root@localhost src]# tar xf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz -C /usr/local/

//更改軟體名,更改屬主屬組
[root@localhost src]# cd /usr/local/
[root@localhost local]# mv mysql-5.7.38-linux-glibc2.12-x86_64 mysql
[root@localhost local]# chown -R mysql.mysql mysql*
[root@localhost local]# ll -d mysql
drwxr-xr-x. 9 mysql mysql 129 Aug  2 19:08 mysql

//配置環境變數
[root@localhost local]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@localhost local]# source /etc/profile.d/mysql.sh

//創建頭文件
[root@localhost local]# ln -s /usr/local/mysql/include /usr/include/mysql

//添加幫助文檔
[root@localhost ~]# vim /etc/man_db.conf 
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
MANDATORY_MANPATH                       /usr/local/apache/man
MANDATORY_MANPATH                       /usr/local/mysql/man		//添加

//創建庫文件
[root@localhost ~]# vim /etc/ld.so.conf.d/mysql.conf
[root@localhost ~]# cat /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib/
[root@localhost ~]# ldconfig 

//創建數據存放目錄
[root@localhost ~]# mkdir /opt/data
[root@localhost ~]# chown -R mysql.mysql /opt/data/
[root@localhost ~]# ll -d /opt/data/
drwxr-xr-x. 2 mysql mysql 6 Aug  2 19:13 /opt/data/

//初始化
[root@localhost ~]# mysqld --initialize --user mysql --datadir /opt/data/
2022-08-02T11:33:30.837163Z 0 [Warning] CA certificate ca.pem is self signed.
2022-08-02T11:33:30.882575Z 1 [Note] A temporary password is generated for root@localhost: ,%//ikYZV3tZ		//最後一行會生成臨時密碼
[root@localhost ~]# echo ',%//ikYZV3tZ' > passwd		//記錄一下密碼

//編寫配置文件
[root@localhost ~]# dnf -y remove mariadb*
[root@localhost ~]# vim /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /opt/data
socket = /tmp/mysql.sock
port = 3306
pid-file = /opt/data/mysql.pid
user = mysql
skip-name-resolve

//編寫服務控制腳本
[root@localhost ~]# cd /usr/lib/systemd/system/
[root@localhost system]# cp httpd.service mysqld.service
[root@localhost system]# vim mysqld.service 
[Unit]
Description=mysql server daemon
After=network.target sshd-keygen.target

[Service]
Type=forking
ExecStart=/usr/local/mysql/support-files/mysql.server start
ExecStop=/usr/local/mysql/support-files/mysql.server stop
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
[root@localhost ~]# systemctl daemon-reload		//刷新一下

//設置開機自啟
[root@localhost ~]# systemctl enable --now mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service.
[root@localhost ~]# ss -anlt
State            Recv-Q           Send-Q                     Local Address:Port                     Peer Address:Port           Process           
LISTEN           0                128                              0.0.0.0:22                            0.0.0.0:*                                
LISTEN           0                80                                     *:3306                                *:*                                
LISTEN           0                128                                    *:80                                  *:*                                
LISTEN           0                128                                 [::]:22                               [::]:*                                

//設置密碼
[root@localhost ~]# cat passwd 
,%//ikYZV3tZ
[root@localhost ~]# mysql -uroot -p',%//ikYZV3tZ'
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.38

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> set password = password('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)

//登錄查看是否修改成功
[root@localhost ~]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.38 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> 

3.3 編譯安裝php

//下載php軟體包
[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget https://www.php.net/distributions/php-7.4.30.tar.gz

//解壓軟體包
[root@localhost src]# tar xf php-7.4.30.tar.gz 
[root@localhost src]# ls
debug  kernels  mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz  php-7.4.30  php-7.4.30.tar.gz

//安裝依賴包
[root@localhost ~]# dnf -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libicu-devel libjpeg libjpeg-devel libpng libpng-devel openldap-devel  pcre-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel mhash mhash-devel php-mysqlnd
[root@localhost ~]# dnf -y install http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/oniguruma-devel-6.8.2-2.el8.x86_64.rpm
[root@localhost ~]# dnf -y install libsqlite3x-devel
[root@localhost ~]# dnf -y install libzip-devel

//編譯安裝
[root@localhost ~]# cd /usr/src/
[root@localhost src]# cd php-7.4.30
[root@localhost php-7.4.30]# ./configure --prefix=/usr/local/php7  \
--with-config-file-path=/etc \
--enable-fpm \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-soap \
--with-openssl \
--enable-bcmath \
--with-iconv \
--with-bz2 \
--enable-calendar \
--with-curl \
--enable-exif  \
--enable-ftp \
--enable-gd \
--with-jpeg \
--with-zlib-dir \
--with-freetype \
--with-gettext \
--enable-json \
--enable-mbstring \
--enable-pdo \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-readline \
--enable-shmop \
--enable-simplexml \
--enable-sockets \
--with-zip \
--enable-mysqlnd-compression-support \
--with-pear \
--enable-pcntl \
--enable-posix
[root@localhost php-7.4.30]# make && make install

//配置環境變數
[root@localhost local]# echo 'export PATH=/usr/local/php7/bin:$PATH' > /etc/profile.d/php.sh
[root@localhost local]# source /etc/profile.d/php.sh
[root@localhost local]# which php
/usr/local/php7/bin/php
[root@localhost php-7.4.30]# php -v
PHP 7.4.30 (cli) (built: Aug  2 2022 22:27:01) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

//配置php-fpm
[root@localhost php-7.4.30]# cp php.ini-production /etc/php.ini
cp: overwrite '/etc/php.ini'? y
[root@localhost php-7.4.30]# cd sapi/fpm/
[root@localhost fpm]# file init.d.php-fpm
init.d.php-fpm: POSIX shell script, ASCII text executable
[root@localhost fpm]# cp init.d.php-fpm /etc/init.d/php-fpm
[root@localhost fpm]# chmod +x /etc/init.d/php-fpm
[root@localhost fpm]# cd /usr/local/php7/
[root@localhost php7]# ls
bin  etc  include  lib  php  sbin  var
[root@localhost php7]# cd etc/
[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf
[root@localhost etc]# ls
pear.conf  php-fpm.conf  php-fpm.conf.default  php-fpm.d
[root@localhost etc]# cd php-fpm.d/
[root@localhost php-fpm.d]# ls
www.conf.default
[root@localhost php-fpm.d]# cp www.conf.default www.conf
[root@localhost php-fpm.d]# ls
www.conf  www.conf.default

//編輯php-fpm的配置文件(/usr/local/php7/etc/php-fpm.conf):
//配置fpm的相關選項為你所需要的值:
[root@localhost ~]# vim /usr/local/php7/etc/php-fpm.conf
[root@localhost ~]# tail /usr/local/php7/etc/php-fpm.conf
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
;  - the global prefix if it's been set (-p argument)
;  - /usr/local/php7 otherwise
include=/usr/local/php7/etc/php-fpm.d/*.conf
pm.max_children = 50		//最多同時提供50個進程提供50個併發服務
pm.start_servers = 5		//啟動時啟動5個進程
pm.min_spare_servers = 2	//最小空閑進程數
pm.max_spare_servers = 8	//最大空閑進程數

//取消httpd.conf的註釋,啟動httpd的相關模塊
[root@localhost php-fpm.d]# vim /usr/local/apache/conf/httpd.conf 
#LoadModule proxy_module modules/mod_proxy.so				//取消井號
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so		//取消井號

//編寫測試文件
[root@localhost ~]# mkdir -p /usr/local/apache/htdocs/runtime
[root@localhost ~]# vim /usr/local/apache/htdocs/runtime/index.php
<?php
   phpinfo();
?>
[root@localhost ~]# chown -R apache.apache /usr/local/apache/htdocs/
[root@localhost ~]# ll -d /usr/local/apache/htdocs/
drwxr-xr-x. 3 apache apache 39 Aug  2 22:45 /usr/local/apache/htdocs/

//配置虛擬主機
[root@localhost extra]# vim /usr/local/apache/conf/extra/httpd-vhosts.conf 
//在配置文件的最後加入以下內容
<VirtualHost *:80>
    DocumentRoot "/usr/local/apache/htdocs/runtime"
    ServerName runtime.example.com
    ErrorLog "logs/runtime.example.com-error_log"
    CustomLog "logs/runtime.example.com-access_log" common
    ProxyRequests Off
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/runtime/$1
    <Directory "/usr/local/apache/htdocs/runtime">
        Options none
        AllowOverride none
        Require all granted
    </Directory>
</VirtualHost>


[root@localhost ~]# vim /usr/local/apache/conf/httpd.conf 
//搜索ADDType,添加以下內容
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php				//添加此行
    AddType application/x-httpd-php-source .phps		//添加此行

 DirectoryIndex index.php index.html  		//在前面添加一個index.php

#Include conf/extra/httpd-vhosts.conf		//取消註釋

//啟動php httpd
[root@localhost local]# service php-fpm start
[root@localhost ~]# chkconfig --add php-fpm		//開機自啟動
[root@localhost local]# systemctl restart httpd
[root@localhost local]# ss -anlt
State            Recv-Q           Send-Q                     Local Address:Port                     Peer Address:Port           Process           
LISTEN           0                128                            127.0.0.1:9000                          0.0.0.0:*                                
LISTEN           0                128                              0.0.0.0:22                            0.0.0.0:*                                
LISTEN           0                80                                     *:3306                                *:*                                
LISTEN           0                128                                    *:80                                  *:*                                
LISTEN           0                128                                 [::]:22                               [::]:*                                

3.4 查看結果

image

4. lamp架構上部署phpmyadmin

4.1 先在資料庫中創建一個用戶並授權

[root@localhost ~]# mysql -uroot -p123456

mysql> grant all on admin.* to 'admin'@'%' identified by '123456';
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> grant all on admin.* to 'admin'@'localhost' identified by '123456';
Query OK, 0 rows affected, 2 warnings (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

4.2 下載phpmyadmin並解壓和配置

[root@localhost ~]# wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
[root@localhost ~]# tar xf phpMyAdmin-5.2.0-all-languages.tar.gz -C /usr/local/apache/htdocs/runtime/
[root@localhost ~]# cd /usr/local/apache/htdocs/runtime/
[root@localhost runtime]# ls
index.php  phpMyAdmin-5.2.0-all-languages
[root@localhost runtime]# mv phpMyAdmin-5.2.0-all-languages/* .
mv: overwrite './index.php'? y
[root@localhost runtime]# systemctl restart httpd

4.3 查看結果

image

image


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 如何基於WPF實現一款資料庫文檔管理工具?SmartSQL正式基於WPF寫的這樣一款開源的資料庫文檔管理工具,包含的技術組件有HandyControl、SqlSugar、RazorEngine、iTextSharp、ZetaLongPaths等,用到的資料庫有SqlServer、MySql、Post... ...
  • 今天我們來瞭解一下ASP.NET MCV的基礎知識,ASP.NET是一種構建Web應用程式的框架,它將通常的MVC(Model-View-Controller)模式應用於ASP.NET框架。 ...
  • 有什麼大病。 粘包和半包問題是數據傳輸中比較常見的問題,所謂的粘包問題是指數據在傳輸時,在一條消息中讀取到了另一條消息的部分數據,這種現象就叫做粘包。 比如發送了兩條消息,分別為“ABC”和“DEF”,那麼正常情況下接收端也應該收到兩條消息“ABC”和“DEF”,但接收端卻收到的是“ABCD”,像這 ...
  • 好久沒寫文章了,有些同學問我公眾號是不是廢了?其實並沒有。其實想寫的東西很多很多,主要是最近公司比較忙,以及一些其他個人原因沒有時間來更新文章。這幾天抽空寫了一點點東西,證明公眾號還活著。 長久以來的認知,對於托管代碼 .NET / JAVA ,都是需要在伺服器上安裝 SDK 或者運行時的。比如 . ...
  • JetbrAIns Rider 2022 中文版是一個強大的跨平臺.Net開發IDE,可以與.NET Framework和.NET Core一起使用,也可以與Mono項目一起使用。因此,您可以使用rider 2022來創建類和庫,Web應用程式,獨立實用程式等。rider mac版是基於Intell ...
  • Linux系統基礎(二) 1、重定向 重定向 //將輸出的內容重定向到某個文件 //系統設定: 預設輸入設備 //標準輸入,STDIN,0 (鍵盤) 預設輸出設備 //標準輸出(顯示器) 標準正確輸出 //STDOUT,1 標準錯誤輸出 //STDERR,2 //I/O重定向: >:覆蓋輸出重定向 ...
  • SElinux: 是Linux的一個強制訪問控制的安全模塊 SElinux的相關概念: 對象:文件、目錄、進程、埠等 主體:進程稱為主體 SElinux將所有的文件都賦予一個type類型的標簽,所有的進程也賦予一個domain類型的標簽。domain標簽能夠執行的操作由安全策略里定義 #ubunt ...
  • 修改日期時間的工具 date hwclock timedatectl date工具的使用 作用:顯示和設置系統時間 選項: -d <字元串> 顯示字元串所指的日期與時間,比如:"-1 day" 表示當前日期的前一天,必須要加雙引號 -s <字元串> 設置當前的時間和日期 #年月日使用(-)分隔,時分 ...
一周排行
    -Advertisement-
    Play Games
  • 前言 在我們開發過程中基本上不可或缺的用到一些敏感機密數據,比如SQL伺服器的連接串或者是OAuth2的Secret等,這些敏感數據在代碼中是不太安全的,我們不應該在源代碼中存儲密碼和其他的敏感數據,一種推薦的方式是通過Asp.Net Core的機密管理器。 機密管理器 在 ASP.NET Core ...
  • 新改進提供的Taurus Rpc 功能,可以簡化微服務間的調用,同時可以不用再手動輸出模塊名稱,或調用路徑,包括負載均衡,這一切,由框架實現並提供了。新的Taurus Rpc 功能,將使得服務間的調用,更加輕鬆、簡約、高效。 ...
  • 順序棧的介面程式 目錄順序棧的介面程式頭文件創建順序棧入棧出棧利用棧將10進位轉16進位數驗證 頭文件 #include <stdio.h> #include <stdbool.h> #include <stdlib.h> 創建順序棧 // 指的是順序棧中的元素的數據類型,用戶可以根據需要進行修改 ...
  • 前言 整理這個官方翻譯的系列,原因是網上大部分的 tomcat 版本比較舊,此版本為 v11 最新的版本。 開源項目 從零手寫實現 tomcat minicat 別稱【嗅虎】心有猛虎,輕嗅薔薇。 系列文章 web server apache tomcat11-01-官方文檔入門介紹 web serv ...
  • C總結與剖析:關鍵字篇 -- <<C語言深度解剖>> 目錄C總結與剖析:關鍵字篇 -- <<C語言深度解剖>>程式的本質:二進位文件變數1.變數:記憶體上的某個位置開闢的空間2.變數的初始化3.為什麼要有變數4.局部變數與全局變數5.變數的大小由類型決定6.任何一個變數,記憶體賦值都是從低地址開始往高地 ...
  • 如果讓你來做一個有狀態流式應用的故障恢復,你會如何來做呢? 單機和多機會遇到什麼不同的問題? Flink Checkpoint 是做什麼用的?原理是什麼? ...
  • C++ 多級繼承 多級繼承是一種面向對象編程(OOP)特性,允許一個類從多個基類繼承屬性和方法。它使代碼更易於組織和維護,並促進代碼重用。 多級繼承的語法 在 C++ 中,使用 : 符號來指定繼承關係。多級繼承的語法如下: class DerivedClass : public BaseClass1 ...
  • 前言 什麼是SpringCloud? Spring Cloud 是一系列框架的有序集合,它利用 Spring Boot 的開發便利性簡化了分散式系統的開發,比如服務註冊、服務發現、網關、路由、鏈路追蹤等。Spring Cloud 並不是重覆造輪子,而是將市面上開發得比較好的模塊集成進去,進行封裝,從 ...
  • class_template 類模板和函數模板的定義和使用類似,我們已經進行了介紹。有時,有兩個或多個類,其功能是相同的,僅僅是數據類型不同。類模板用於實現類所需數據的類型參數化 template<class NameType, class AgeType> class Person { publi ...
  • 目錄system v IPC簡介共用記憶體需要用到的函數介面shmget函數--獲取對象IDshmat函數--獲得映射空間shmctl函數--釋放資源共用記憶體實現思路註意 system v IPC簡介 消息隊列、共用記憶體和信號量統稱為system v IPC(進程間通信機制),V是羅馬數字5,是UNI ...