Categories AWS Linux

Basic Knowledge about Apache Server

Để kiểm tra compile variables của apache server (ở đó có apache version, server document root,…):

httpd -V

Để kiểm tra các modules được load:

httpd -M

Để kiểm tra các virtual hosts:

httpd -S

virtual host của wordpress có document root ở /opt/bitnami/wordpress. Có thể sửa source code ở đó hoặc ở trang admin (sửa template ở Appearance, Theme File Editor, sửa plugin ở Plugin File Editor), muốn sửa mạnh hơn thì tải WP File Manager Plugin hoặc sửa bằng SSH Remote Extension của Visual Studio Code.

Thường thì main config file nằm ở /opt/bitnami/apache/conf/httpd.conf,

Đăng nhập vào phpmyadmin bằng cách ssh forwarding:

ssh -L 8888:127.0.0.1:80 -N -f -i "C:\Users\MSI\Downloads\LightSailCustomKey.pem" bitnami@blogtholab.de

Sau đó đăng nhập vào http://127.0.0.1:8888/phpmyadmin. Tài khoản đăng nhập lấy ở wp-config.php

Để enable directories listing thì thêm Options +IndexesDirectory directive. -MultiViews để tắt content negotiation.

  ErrorDocument 403 "For security reasons, this URL is only accessible using 
  localhost (127.0.0.1) as the hostname."
  AuthType Basic
  AuthName "Restricted Area"
  AuthUserFile /etc/apache2/.htpasswd
  Require valid-user

Tạo file mật khẩu bằng lệnh htpasswd -c /etc/apache2/.htpasswd <username>.

More From Author

Leave a Reply

Your email address will not be published. Required fields are marked *