记录管理亚马逊云服务器的过程

之所以要写这个,是因为这两天走了弯路,记下,走弯路的过程
1.首先登陆 云服务器
https://lightsail.aws.amazon.com/ls/webapp/home/instances

2.创建实例

注意,上面可以选服务位置,新加坡离中国最近,下面这里我选了有系统加APP,(这里回想起来,假设我选 个ubuntu,不加应用,不知会不会更好一点)

3.注意,一个月后是要收费的,收费前记得删除

4.当初以为建好了,什么都有,有个初始的帐号密码,什么都能用,仅仅只是以为,这些可能阿里云或者腾讯云才有的,国外真垃圾,首先吸SSH连接能用,暂时用着吧,

先解释下文件结构
当前用户是bitnami,
html 的文件放在 /opt/bitnami/apache2/htdocs
phpmyadmin 放在/opt/bitnami/phpmyadmin/

5. 这是最坑的一件事就是要改mysql密码

原来说好的初始密码是bitnami呢

参考方法https://docs.bitnami.com/aws/infrastructure/lamp/administration/change-reset-password/

  • Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):
    UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
    FLUSH PRIVILEGES;
    

    If your stack ships MySQL v5.7.x, use the following content instead of that shown above:

    UPDATE mysql.user SET authentication_string=PASSWORD('NEW_PASSWORD') WHERE User='root';
    FLUSH PRIVILEGES;
    

    TIP: Check the MySQL version with the command `/opt/bitnami/mysql/bin/mysqladmin --version or /opt/bitnami/mysql/bin/mysqld \--version

  • Stop the MySQL server:
    sudo /opt/bitnami/ctlscript.sh stop mysql
    
  • Start MySQL with the following command:
    sudo /opt/bitnami/mysql/bin/mysqld_safe --pid-file=/opt/bitnami/mysql/data/mysqld.pid --datadir=/opt/bitnami/mysql/data --init-file=/home/bitnami/mysql-init 2> /dev/null &
    
  • Restart the MySQL server:
    sudo /opt/bitnami/ctlscript.sh restart mysql
    
  • Remove the script:
    rm /home/bitnami/mysql-init

最后成功能 修改了mysql的密码。

 

大概内容先记下来,

phpmyadmin不能上传,不知道,是什么原因,我通过ssh wget下来,再修改config

另外htdocs 一定要chmod 777,不然很麻烦

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注