Bitnami

From DikapediaV2
Jump to: navigation, search

List all of Bitnami's configuration files and scripts.

Bitnami CTL script


Controls the stack (mysql, php-fpm, apache)

$ sudo /opt/bitnami/ctlscript.sh start/restart/stop/status

$ sudo /opt/bitnami/ctlscript.sh status
apache already running
mariadb already running
php-fpm already running

To restart individual services:

$ sudo /opt/bitnami/ctlscript.sh restart php-fpm
$ sudo /opt/bitnami/ctlscript.sh restart apache
$ sudo /opt/bitnami/ctlscript.sh restart mariadb


Logs location


(system logs)

/var/log/syslog 

(apache error logs)

/opt/bitnami/apache2/logs/error_log 
/opt/bitnami/apache2/logs/access_log

(mysql logs)

/opt/bitnami/mysql/data/mysqld.log 

(php logs)

/opt/bitnami/php/var/log/php-fpm.log 


Install SSL on Bitnami using bncert-tool


https://docs.bitnami.com/aws/how-to/understand-bncert/

$ wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run
$ sudo mkdir /opt/bitnami/bncert
$ sudo mv bncert-linux-x64.run /opt/bitnami/bncert/
$ sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run
$ sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool

$ sudo /opt/bitnami/bncert-tool
  • Then you just have to list the domains you want to cover.
  • HTTP -> HTTPS redirect? y/n
  • non-www -> www redirect? y/n


WordPress Config file


/opt/bitnami/apps/wordpress/htdocs/wp-config.php


Php Config file and log


/opt/bitnami/php/etc/php.ini.
/opt/bitnami/php/var/log/php-fpm.log 


Apache Config file


https://docs.bitnami.com/aws/apps/wordpress/get-started/understand-config/


MySQL Config file


MySQL Version

mysqld --version

MySQL Configuration File

/opt/bitnami/mysql/my.cnf

Some configuration overrides are stored in

/opt/bitnami/mysql/bitnami/my.cnf.

MySQL Socket - On Unix, MySQL clients can connect to the server in the local machine using an Unix socket file at

/opt/bitnami/mysql/tmp/mysql.sock

MySQL Process Identification Number - The MySQL .pid file allows other programs to find out the PID (Process Identification Number) of a running script. Find it at

/opt/bitnami/mysql/data/mysqld.pid

MySQL Error Log - The log-error file contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running. If mysqld notices a table that needs to be automatically checked or repaired, it writes a message to the error log.

/opt/bitnami/mysql/data/mysqld.log


Reference: https://docs.bitnami.com/bch/infrastructure/mysql/get-started/understand-default-config/


Start the stack automatically on boot


https://docs.bitnami.com/installer/faq/linux-faq/administration/autostart-linux/


How to Install a Second WordPress Site in a Subdirectory



1) Get the password for WP application and MySQL. Make note of this password as you will use it later during the WP installation:

   $ cat bitnami_application_password

2) Run the following commands to download the latest version of the Bitnami WordPress module and install it:

   $ curl -LJO "https://downloads.bitnami.com/files/stacks/wordpress/5.2.3-0/bitnami-wordpress-5.2.3-0-module-linux-x64-installer.run"
   $ chmod +x ./bitnami-wordpress-5.2.3-0-module-linux-x64-installer.run
   $ sudo ./bitnami-wordpress-5.2.3-0-module-linux-x64-installer.run --wordpress_instance_name resources
       language:                   1
       Installation folder:        /opt/bitnami
       Login [user]:               Press [enter] to use the default [user]
       Real name:                  name
       Email address:              email@address.com
       MySQL password for "root":  Enter the output of '$ cat bitnami_application_password' which was ran earlier
       Blog name:                  Resources
       Mail support?               n
       Installation type:          Choose Dev or Prod, Prod [2] is default.
       Setup is now ready to install bitnami wordpress module on your computer, do you want to continue? y
       Installation has finished, Launch bitnami wordpress module: y

3) You can confirm there are now two separate sites:

   http://<public-ip>/
   http://<public-ip>/wp-admin
   http://<public-ip>/resources/
   http://<public-ip>/resources/wp-login
   [+] First/original WordPress folder location:
           /opt/bitnami/apps/wordpress/htdocs
   [+] Second WordPress folder location:
           /opt/bitnami/apps/resources/htdocs

[1] How to Install a Second WordPress Site in a Subdirectory (Google Cloud) https://community.bitnami.com/t/how-to-install-a-second-wordpress-site-in-a-subdirectory-google-cloud/70956


How to Backup and Restore Bitnami Mysql Database


https://docs.bitnami.com/ibm/apps/redmine/administration/backup-restore-mysql-mariadb/

Backup

To back up just the application database, create a dump file using the mysqldump tool. In this example, the database is named bitnami_app; replace this with the name of the database you wish to export.

mysqldump -u root -p bitnami_app > backup.sql

To back up all the databases, use this command instead:

mysqldump -A -u root -p > backup.sql

This operation could take some time depending on the database sizes.

   NOTE: The steps previously described will only back up the data contained inside your databases. There may be other files that you should take into account when performing a full backup, such as files that may have been uploaded to your application. Refer to your application’s documentation for more details.

Restore

Once you have the backup file, you can restore the data with a command like the one below:

mysql -u root -p < backup.sql

To restore the data to a specific database, include the database name in the command, as shown below. For example, to import the data to a database named bitnami_app, use this command:

mysql -u root -p -D bitnami_app < backup.sql