使用PolarDB和ECS搭建门户网站
一、创建PolarDB数据库账号
1.通过阿里云提供的ECS账号, 在 阿里云控制台首页 左侧导航栏,依次单击 产品与服务 > 云数据库PolarDB ,进入 云数据库PolarDB管理控制台

发布于 2020-09-27 182 次阅读
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
返回结果如下图所示
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
wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld
yum -y install git
cd ~ && git clone https://gitee.com/hnaoyun/PbootCMS.git
cp -r PbootCMS/* /var/www/html/
chmod -R a+w /var/www/html
sql_file="/var/www/html/static/backup/sql/"$(ls /var/www/html/static/backup/sql/) && mysql -h数据库连接地址 -utest_user -pPassword1213 -Dpbootcms < $sql_file
若提示MySQL ERROR 1044,则需要手动新建一个pbootcms数据库,然后分配这个数据库的权限的给已创建的用户
cat > /var/www/html/config/database.php << EOF array(
'type' => 'mysqli', // 数据库连接驱动类型: mysqli,sqlite,pdo_mysql,pdo_sqlite
'host' => '数据库连接地址', // PolarDB数据库链接地址
'user' => 'test_user', // PolarDB数据库的用户名
'passwd' => 'Password1213', // PolarDB数据库的密码
'port' => '3306', // 数据库端口
'dbname' => 'pbootcms' //数据库名称
)
);
EOF
确保安全组开放了80端口访问,否则无法访问已搭建的门户网站
systemctl restart httpd
返回结果如下图所示
Comments | NOTHING