markdown Amazon LightSail设置帮助

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Amazon LightSail设置帮助相关的知识,希望对你有一定的参考价值。

### SSH Into Server
Be in the foler that the certificate is in or else write the path to certificate.
Dont include '[ ]'

CD into folder containing SSH Key

```
ssh bitnami@[ip-address] -i [name-of-certificate]
```

If you get an error about the certificate being insecure, cd into the directory that the certificate is located in and run the following:

```
sudo chmod 600 [name-of-the-cert]` (Remove the brackets when writing in terminal)
```

Then try the first instruction again.

### Check Admin Password

```
cat bitnami_application_password
```
### Accessing PhpMyAdmin on Linux and Mac OSX

1. `ssh -N -L 8888:127.0.0.1:80 -i KEYFILE bitnami@SERVER-IP`

2. Then go to: http://127.0.0.1:8888/phpmyadmin/

3. Login with username: root and password is the bitnami application password in the bitnami folder on the server. FTP into the server to get it. It will be different for every instance.

4. Once in the database, create a new database for wordpress and a user for the database

### Permissions Overall (Must do to get image uploading, plugin updates)

Every Folder in wp-content ( Root ) 775 bitnami:daemon

cd into the root directory

```
sudo chown -R daemon:bitnami htdocs/
sudo find htdocs/ -type d -exec chmod 775 {} \;
sudo find htdocs/ -type f -exec chmod 664 {} \;
```

### Email Setup MX Records
Emails do not use www in their domain lookup, so you must specify the root domain

- Type MX
- Subdomain: (no www) - domain.com
- Priority: 1
- Destination: Mail Server

### Start/Stop Web Server
Stop Server `sudo /opt/bitnami/ctlscript.sh stop`

Start Server `sudo /opt/bitnami/ctlscript.sh start`

### Caching during development
By default lightsail has a pretty hardcore cache which is one of the reasons its so fast. During development this is annoying because the files take a while to refresh after a new upload to the ftp. During development edit line 1906 of the php.ini file to have the opcache.enable=0 instead of 1. Once going live this should be turned back on with a value of 1. 

Location of php.ini
`/opt/bitnamii/php/etc/php.ini`

Location of httpd.conf
`/opt/bitnami/apache2/conf/httpd.conf`

comment out lines 526 and 527

`Include conf/pagespeed.conf`

`Include conf/pagespeed_libraries.conf`

Now restart the Server

### Lets Encrypt SSL Setup
https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/

If you want to use (www) in your domain then you need specify www.example.com for any reference of DOMAIN in the instructions above.

### Lets Encrypt SSL Renewal Setup

1. SSH into the server ssh `bitnami@server-ip -i keyfile`
2. Stop the server `sudo /opt/bitnami/ctlscript.sh stop`
3. Run pico editor `sudo pico`
4. Enter This info
```
sudo /opt/bitnami/ctlscript.sh stop apache
sudo /usr/local/bin/lego --email="EMAIL-ADDRESS" --domains="DOMAIN" --path="/etc/lego" renew
sudo /opt/bitnami/ctlscript.sh start apache
```
6. Make the script excuitible `sudo chmod +x ./renew-certificate.sh`
7. Move the script to the lego folder `sudo mv ./renew-certificate.sh /etc/lego/renew-certificate.sh`
8. Set up cron job open contrab `sudo crontab -e`
9. Set the job in the file and save it `0 0 1 * * /etc/lego/renew-certificate.sh 2> /dev/null`
10. Start server `sudo /opt/bitnami/ctlscript.sh start`

以上是关于markdown Amazon LightSail设置帮助的主要内容,如果未能解决你的问题,请参考以下文章

Amazon Lightsail 实例是不是托管/自动更新?

无法再访问 Amazon Lightsail LAMP 应用程序站点

如何从我的 Mac 连接到新的 Amazon Lightsail 实例?

有没有办法将多个静态 IP 分配给 Amazon Lightsail 实例?

Amazon Lightsail:Bitnami LAMP 服务器网站托管:sudo service apache2 restart

markdown Lightsail命令