AWS 라이트세일 Bitnami WordPress 에 HTTPS 적용하기

도메인을 붙여 뒀다면, 아주 쉽게 https 를 적용할 수 있다.

SSH 접속한 이후, 아래 명령을 치면 그냥 된다.

몇가지 질문이 나오지만 기본적인 도메인 정보가 넣고 Yes 몇번하면 된다.

Prerequisites and limitations

  • Make sure that the domain in the DNS records points to the IP address of your Lightsail instance.
  • Certificate creation for wildcard domains isn’t possible using the bncert-tool.

Run the following command to launch the Bitnami HTTPS configuration tool:

sudo /opt/bitnami/bncert-tool

For more information on using or downloading the HTTPS Configuration Tool, see Learn about the Bitnami HTTPS configuration tool on the Bitnami documentation website.

https://aws.amazon.com/premiumsupport/knowledge-center/linux-lightsail-ssl-bitnami/Bitnami Stacks for Amazon Lightsail에 SSL 인증서 설치닫기 Ciara 씨의 동영상을 통해 자세히 알아보기(6:52)aws.amazon.com

예제로 내가 해놓은 것을 일단 로그만 남겨둔다

The following domains were not included: www.devbj.com. Do you want to add them? [Y/n]: Y

----------------------------------------------------------------------------
Enable/disable redirections

Please select the redirections you wish to enable or disable on your Bitnami 
installation.



Enable HTTP to HTTPS redirection [Y/n]: Y




Enable non-www to www redirection [Y/n]: n




Enable www to non-www redirection [y/N]: y


----------------------------------------------------------------------------
Changes to perform

The following changes will be performed to your Bitnami installation:

1. Stop web server
2. Configure web server to use a free Let's Encrypt certificate for the domains: 
devbj.com www.devbj.com
3. Configure a cron job to automatically renew the certificate each month
4. Configure web server name to: devbj.com
5. Enable HTTP to HTTPS redirection (example: redirect http://devbj.com to 
https://devbj.com)
6. Enable www to non-www redirection (example: redirect www.devbj.com to 
devbj.com)
7. Start web server once all changes have been performed



Do you agree to these changes? [Y/n]: 


----------------------------------------------------------------------------
Create a free HTTPS certificate with Let's Encrypt

Please provide a valid e-mail address for which to associate your Let's Encrypt 
certificate.

Domain list: devbj.com www.devbj.com

Server name: devbj.com

E-mail address []: bxxxxxx@gmail.com

The Let's Encrypt Subscriber Agreement can be found at:

https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf

Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: 


----------------------------------------------------------------------------
Performing changes to your installation

The Bitnami HTTPS Configuration Tool will perform any necessary actions to your 
Bitnami installation. This may take some time, please be patient.

----------------------------------------------------------------------------
Success

The Bitnami HTTPS Configuration Tool succeeded in modifying your installation.

The configuration report is shown below.

Backup files:
* /opt/bitnami/apache/conf/httpd.conf.back.202212160608
* /opt/bitnami/apache/conf/bitnami/bitnami.conf.back.202212160608
* /opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf.back.202212160608
* /opt/bitnami/apache/conf/vhosts/wordpress-https-vhost.conf.back.202212160608
* /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf.back.202212160608

Find more details in the log file:

/tmp/bncert-202212160608.log

If you find any issues, please check Bitnami Support forums at:

https://github.com/bitnami/vms

Press [Enter] to continue:

bitnami@ip-172-26-1-237:~$

끝.

워드프레스 – 업로드 파일 타입 추가 on AWS Lightsail

AWS 라이트세일에서 제공하는 bitnami 워드프레스 머신에서

업로드 가능한 파일 확장자를 추가하려고 한다.

파일 용량은 이미 80메가로 충분히 되어 있어 변경할 필요성을 못 느낌!

일단 아래글을 참고

워드프레스 4.7 이후 업로드 파일 확장자 추가하기

[워드프레스] 4.7 버전 이후 업로드 파일 확장자 추가하기 : 죄송합니다. 이 파일 유형은 보안상의워드프레스에 업로드 파일 확장자를 추가하여보겠습니다. 워드프레스에 hwp, exe 등 파일을 업로드하려고 하면 아래와 같이 안내창이 ‘죄송합니다. 이 파일 유형은 보안상의 이유로 허용하지 않investechnews.com

업로드 파일 확장자 추가하기

wp-config.php 에 아래와 같이 한 줄 추가하고

// 20221214 BJ add file upload 
define('ALLOW_UNFILTERED_UPLOADS', true);
/* That's all, stop editing! Happy publishing. */

"wp-config.php" 209L, 4481B written

테마 소스 수정에서 functions.php 에 아래 내용을 또 추가하고,

/** 20221214 BJ add custom mimes */
<strong>function</strong> <strong>add_custom_mime_types</strong> ( $mimes ) {
        $mimes['gz'] = 'application/gzip';
//         $mimes['hwp'] = 'application/hangul';
        <strong>return</strong> $mimes;
}
add_filter('upload_mimes', 'add_custom_mime_types');

서비스 재시작~~

bitnami@ip-:~/stack/wordpress$ sudo apachectl configtest
Syntax OK
bitnami@ip-:~/stack/wordpress$ sudo /opt/bitnami/ctlscript.sh restart
Restarting services..

sudo apachectl configtest
sudo /opt/bitnami/ctlscript.sh restart

![](assets/images/2023/01/image.png?resize=1024%2C469&ssl=1)

간단하게 functions.php 파일 수정을 그림으로 캡쳐해둠

파이썬 – QMessageBox text 복사 가능하게

메시지 박스의 텍스트를 복사해서 쓰려고 했더니, 기본적인 메시지 박스는 마우스 드래그가 불가능!

솔루션이 있을까 검색 후, 결과 남기기

                    msgBox = QMessageBox(self)
                    msgBox.setIcon(QMessageBox.Information)
                    msgBox.setText(f"Loaded config data from {fileName[0]}.\n" + _skip_message)
                    msgBox.setWindowTitle("Information")
                    msgBox.setTextInteractionFlags(Qt.TextSelectableByMouse)
                    msgBox.setStandardButtons(QMessageBox.Ok)
                    msgBox.show()

그냥 띄우지 말고, msgBox.setTextInteractionFlags(Qt.TextSelectableByMouse) 이 옵션을 주면 메시지 부분을 긁어서 복사할 수 있다.

![](assets/images/2022/12/image-10.png?resize=502%2C218&ssl=1)
텍스트 복사 가능한 QMessageBox

참고 사이트

  • https://stackoverflow.com/questions/32589776/qmessagebox-you-can-select-text-from
  • https://pythonbasics.org/pyqt-qmessagebox/
  • https://www.programcreek.com/python/example/108068/PyQt5.QtWidgets.QMessageBox <- 스코롤 까지 가능하게끔 하는 코드, 페이지에서 scroll을 검색하시오.
## Call to Action
템플릿 블록 테스트 까지
버튼
![woman sitting on rock](assets/images/2022/12/fvp40xpr0ak-1024x768.jpg?resize=1024%2C768)