Trying to fugure out a problem with jQuery JSON. What I found.

Generate json in server side scripting —

$myObj->status = “success”; $myObj->message = “Doctor added..”;

Call from client side -\

var result = jQuery.parseJSON(data); alert (result.status);

Installing Wordpress on existing LAMP server.

  1. Create a DB
  2. Create user
  3. Download latest Wordpress.
$ sudo curl -O https://wordpress.org/latest.tar.gz

4. Update the PHP

$ sudo apt update
$ sudo apt install php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
$ sudo tar -xvf latest.tar.gz
$ cd wordpress
$ sudo mv wp-config-sample.php wp-config.php

5. Edit again wp-config.php. Copy and paste from the response.

5. Edit wp-config.php. Copy and paste from the response.

$ sudo curl -s https://api.wordpress.org/secret-key/1.1/salt/

6. Copy the index.php from the installed folder to <HTDOCS> folder.

/* Loads the WordPress Environment and Template */require ‘./wordpress/wp-blog-header.php’;

Bitnami server

Obtain the status of a service:

sudo /opt/bitnami/ctlscript.sh status

Call it without any service name arguments to start all services:

sudo /opt/bitnami/ctlscript.sh start

Or use it to restart a single service, such as Apache only, by passing the service name as argument:

sudo /opt/bitnami/ctlscript.sh restart apache

Use this script to stop all services:

sudo /opt/bitnami/ctlscript.sh stop

Restart the services by running the script without any arguments:

sudo /opt/bitnami/ctlscript.sh restartmysqldump -u [username] -p [database name] > [database name].sqlCREATE DATABASE newdatabase;

Then log out of the MySQL shell and type the following on the command line:

mysql -u [username] -p newdatabase < [database name].sql

Writing

sudo mkdir /var/backup/db

# (1) set up all the mysqldump variablesDATE=`date +"%d_%b_%Y_%H%M"`SQLFILE=/var/backup/db/db_backup_${DATE}.sqlDATABASE=<database_name>USER=<db_user>PASSWORD=<db_user_password># (2) in case you run this more than once a day,# remove the previous version of the fileunalias rm     2> /dev/nullrm ${SQLFILE}     2> /dev/nullrm ${SQLFILE}.gz  2> /dev/null# (3) do the mysql database backup (dump)sudo mysqldump -u ${USER} -p${PASSWORD} ${DATABASE}|gzip > ${SQLFILE}.gz

sudo crontab -e

0 1 * * * /var/backup/script.sh

To delete the old files -

sudo find /var/backup/db/. -mtime +7 -exec rm {} \;

To get the application credential in AWS Lightsail

sudo cat /home/bitnami/bitnami_credentials

CREATE USER ‘<USER_NAME>’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘<PASSWORD>’;
GRANT USAGE ON *.* TO ‘<USER_NAME>’@’localhost’;ALTER USER ‘<USER_NAME>’@’localhost’ REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT ALL PRIVILEGES ON `sroy`.* TO ‘<USER_NAME>’@’localhost’;

Now unzip the .gz file gzip -d file.gz

Adding security Certificate. Step-1 — openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out myserver.csr. Now copy the text from the generated .csr file to create the certificate request. Once the certificates are created, see the e-mail and download the <domain>.crt file.

Enable the line in httpd.conf file. LoadModule ssl_module modules/mod_ssl.so unblock or add this line Include conf/extra/httpd-ssl.conf (This settings are already present in the server setting). Add the lines in httpd-ssl.conf SSLCertificateFile “/opt/bitnami/apache/conf/bitnami/certs/myeprescription_in.crt” and SSLCertificateKeyFile “/opt/bitnami/apache/conf/bitnami/certs/myserver.key”

Senior MDM Architect | Cloud Compute Enthusiasts