本場景基于PolarDB和ECS實現(xiàn)搭建門戶網(wǎng)站。背景知識PolarDB數(shù)據(jù)庫簡介 PolarDB是阿里云自研的下一代關(guān)系型云數(shù)據(jù)庫,有三個獨(dú)立的引擎,分別可以100%兼容MySQL、100%兼容Post" />
時間:2023-08-01 07:03:01 | 來源:網(wǎng)站運(yùn)營
時間:2023-08-01 07:03:01 來源:網(wǎng)站運(yùn)營
基于PolarDB和ECS實現(xiàn)搭建門戶網(wǎng)站:ssh -V
如果顯示SSH版本則表示已安裝,如下圖所示。 ssh root@123.123.123.123
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
返回類似如下圖結(jié)果則表示安裝成功。 yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap
3.執(zhí)行以下命令下載并安裝MySQL。wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpmyum -y install mysql57-community-release-el7-10.noarch.rpmyum -y install mysql-community-server
4.執(zhí)行以下命令啟動MySQL數(shù)據(jù)庫。systemctl start mysqld
yum -y install git
2.在ECS服務(wù)器上,執(zhí)行以下命令下載PbootCMS源碼文件。cd ~ && git clone https://gitee.com/hnaoyun/PbootCMS.git
3.執(zhí)行以下命令將安裝包拷貝到Apache的wwwroot目錄下。cp -r PbootCMS/* /var/www/html/
4.執(zhí)行以下命令修改站點(diǎn)根目錄文件權(quán)限。chmod -R a+w /var/www/html
5.向數(shù)據(jù)庫中導(dǎo)入CMS的初始數(shù)據(jù)。 執(zhí)行以下命令初始化數(shù)據(jù)庫pbootcms的表結(jié)構(gòu)和數(shù)據(jù)。 說明: 在執(zhí)行命令前,請修改一下三個參數(shù)。sql_file="/var/www/html/static/backup/sql/"$(ls /var/www/html/static/backup/sql/) &&mysql -h數(shù)據(jù)庫連接地址 -utest_user -pPassword1213 -Dpbootcms < $sql_file
6.執(zhí)行以下命令,修改CMS系統(tǒng)數(shù)據(jù)庫配置。 說明: 在執(zhí)行命令前,請根據(jù)參數(shù)說明替換您的數(shù)據(jù)庫配置。cat > /var/www/html/config/database.php << EOF<?phpreturn array( 'database' => array( 'type' => 'mysqli', // 數(shù)據(jù)庫連接驅(qū)動類型: mysqli,sqlite,pdo_mysql,pdo_sqlite 'host' => '數(shù)據(jù)庫連接地址', // PolarDB數(shù)據(jù)庫鏈接地址 'user' => 'test_user', // PolarDB數(shù)據(jù)庫的用戶名 'passwd' => 'Password1213', // PolarDB數(shù)據(jù)庫的密碼 'port' => '3306', // 數(shù)據(jù)庫端口 'dbname' => 'pbootcms' //數(shù)據(jù)庫名稱 ));EOF
7.返回ECS控制臺,在ECS實例列表頁面,單擊已創(chuàng)建的ECS實例ID鏈接進(jìn)入ECS詳情頁。 8. 在左側(cè)導(dǎo)航欄,單擊 本實例安全組 ,然后單擊安全組的ID鏈接查看安全組配置。systemctl restart httpd
在瀏覽器地址欄輸入云服務(wù)器的公網(wǎng)IP地址,進(jìn)入門戶網(wǎng)站首頁。關(guān)鍵詞:門戶,實現(xiàn)
客戶&案例
微信公眾號
版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。