- First Check You site is working on nginx then check apache2 enable or not.
- Fire command sudo service apache2 status
- After you have to fire disable apache2 service using below command
Command : sudo systemctl disable apache2 - After Checked /etc/nginx/sites-available/ in this there are same
Domain two virtual host then you have remove one.in my
Case example.com virtual host and in default file we have also
Same thing, so I have changed the default file server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /var/www/html; index index.html index.htm index.nginx-debian.html; location / { try_files $uri $uri/ =404; } } - Next step is stop service of nginx
Command : sudo systemctl stop nginx - In nginx some time issue happen nginx not stop so we have toKill process below command check how many service working on
Ubuntu. you have check any nginx service is running or not if service is running
then please remove port sudo lsof -i :80 sudo lsof -i :443 - Next step is we have to remove process of 80 and 433 Command for 80 : sudo lsof -i :80 | awk 'NR>1 {print $2}' | xargs sudo kill Command for 443 : sudo lsof -i :443 | awk 'NR>1 {print $2}' | xargs sudo kill
- If still not clear process then we have option to process kill forcefully|
sudo lsof -i :80 | awk 'NR>1 {print $2}' | xargs sudo kill -9
sudo lsof -i :443 | awk 'NR>1 {print $2}' | xargs sudo kill -9 - renew letsencrypt certificate Command : sudo certbot renew --verbose
- Next is start nginx Command : sudo systemctl status nginx
- Use the following command to renew your SSL certificate. The --force-renewal flag tells Certbot to renew the certificate Command : sudo certbot renew --force-renewal
- Look for certbot.timer in the list. If it is not present, you can add a cron job manually Command : sudo systemctl list-timers
- Check all virtual host certificate information below command is used Command : sudo certbot certificates
My Information
Tuesday, 2 July 2024
let's encrypt ssl certificate update issue in apache2 and nginx in ubuntu
Monday, 11 March 2024
javascript or jquery or angular or React copy table clipboard data with html and css
This code snippet represents an HTML structure with a button, a table, and a script. Let's break down the components:
<button style="float: right;" id="btnCopy" type="submit" class="btn btn-primary btn-rounded text-white font-weight-bold m-0 w-20 copyButton" onclick="contentsSelectElement( document.getElementById('copyTable'))">Copy Data</button> |
This button has the text "Copy Data" displayed on it.
It has an ID attribute btnCopy.
It has inline styles for alignment (float: right;) and some Bootstrap classes (btn, btn-primary, etc.) for styling.
<style> |
This part defines the table's styling, specifying that the table, table header cells (th), and table data cells (td) should have a black border of 1px width and collapsed borders.
Table Content:
The table has a structure with headers (<thead>) and body (<tbody>). It contains rows and columns of data.
<script type="text/javascript"> |
This script defines a function contentsSelectElement(el) that's called when the button is clicked.
It's designed to copy the contents of an HTML element (el) to the clipboard.
It checks for the browser's capability to use modern selection APIs (document.createRange and window.getSelection).
If supported, it creates a selection range, selects the content, and executes the copy command.
It also handles copying for older versions of Internet Explorer using createTextRange.
After copying, it shows an alert notifying the user that the content has been successfully copied.
Overall, this code provides functionality for copying the content of a table to the clipboard when the "Copy Data" button is clicked. It utilizes modern JavaScript APIs for selection and copying, with a fallback mechanism for older browser versions.
Full Code Example :
<button style="float: right;" id="btnCopy" type="submit" class="btn btn-primary btn-rounded text-white font-weight-bold m-0 w-20 copyButton" onclick="contentsSelectElement( document.getElementById('copyTable'))">Copy Data</button> |
Angular
copy-table.component.ts |
import { Component } from '@angular/core'; |
copy-table.component.html |
<button style="float: right;" type="button" class="btn btn-primary btn-rounded text-white font-weight-bold m-0 w-20 copyButton" (click)="copyData(copyTable)"> |
In this code:
The Angular component class CopyTableComponent contains a method copyData that handles copying data from the table. It selects the contents of the table element and copies it to the clipboard.
In the HTML template, (click)="copyData(copyTable)" is used to trigger the copyData method when the button is clicked.
The #copyTable template reference variable is used to reference the table element in the component class.
Styles are included within the component's template for simplicity. However, you can move them to a separate CSS file and import it into the component if needed.
React js
import React from 'react'; |
This code defines a React component named CopyTableComponent. It renders the table and button elements, and it handles the click event of the button to copy the table data. The ref attribute is used to reference the table element so that its content can be selected for copying.