install nodejs in ubuntu

sudo apt-get install curl

 

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

OR
 

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -

OR
 

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

OR

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -

sudo apt-get install nodejs

node -v

npm -v

Git Commands

  1. Git Initialization – $ git init
  2. Git Clone – $ git clone <repository url>
  3. Git Clone From an branch – $ git clone -b <branch name> <repository url>
  4. For view branch – $ git branch , $git branch -a
  5. For checkout new branch – $ git checkout <branch name>
  6. for create and checkout new branch – $ git checkout -b <branch name>
  7. for file changes – $ git status
  8. Add file for commit – $ git add <file or folder name>
  9. Commit message – $ git commit -m “commit message”
  10. for pull code from repository – $ git pull <repository url or remote name like – origin / destination> <branch name>
  11. for push code from repository – $ git push <repository url or remote name like – origin / destination> <branch name>

Create ssl in ubuntu, centos and linux

  1. sudo openssl req -new -newkey rsa:2048 -nodes -keyout domain-name.key -out domain-name.csr
Generating a 2048 bit RSA private key
…………………..+++
………………….+++
writing new private key to ‘domain-name.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:Country Code
State or Province Name (full name) [Some-State]:state name
Locality Name (eg, city) []:City Name
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Company name
Organizational Unit Name (eg, section) []:Unit name
Common Name (e.g. server FQDN or YOUR name) []: domain name
Email Address []:email address
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

2. copy csr file and paste third party ssl provider website, then verify domain

3. After verify domain third party given certificate file (like cert.crt), bundle file(like bundle.crt or bundle.ca-bundle)

4. edit in apache sites conf file

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerName domain-name
                ServerAlias www.domain-name
                DocumentRoot document
                SSLEngine on
                SSLCertificateFile /etc/ssl/cert.crt #certificate file full path
                SSLCertificateKeyFile /etc/ssl/domain-name.key #key file full path
                SSLCertificateChainFile /etc/ssl/bundle.ca-bundle #bundle file full path
        </VirtualHost>
</IfModule>

Install vsftpd and create new Ftp user with specific directory in ubuntu

  1. sudo apt-get update
  2. sudo apt-get install vsftpd
  3. sudo vim /etc/vsftpd.confuncomment write_enable=YES
    uncomment chroot_local_user=YES

    Add at last in file
    user_sub_token=$USER

    allow_writeable_chroot=YES

  4. sudo mkdir directory-path
  5. sudo adduser –home=directory-path username
  6. sudo chmod -R 0777 directory-path
  7. sudo chown nobody:nogroup directory-path
  8. sudo chown username:username directory-path
  9. sudo chmod a-w directory-path
  10. sudo service vsftpd restart

Run Python Project On Port 80 Apache2 Configuration

<VirtualHost *:80>

ServerName domain.com
ServerAlias www.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/(python project folder Name)

<Directory /var/www/html/(python project folder Name)>
AllowOverride All
</Directory>
Alias /static /var/www/html/(python project folder Name)/static
<Directory /var/www/html/(python project folder Name)/static>
Require all granted
</Directory>
Alias /static /var/www/html/(python project folder Name)/media
<Directory /var/www/html/(python project folder Name)/media>
Require all granted
</Directory>
<Directory /var/www/html/(python project folder Name)/(python project folder Name)>
<Files wsgi.py>
Require all granted
</Files>
Require all granted
</Directory>

LoadModule wsgi_module “/var/www/html/myenv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so”

WSGIDaemonProcess myenv1 python-path=/var/www/html/(python project folder Name):/var/www/html/myenv/lib/python3.6/site-packages
WSGIProcessGroup myenv1
WSGIScriptAlias / /var/www/(python project folder Name)/(python project folder Name)/wsgi.py

WSGIPassAuthorization On
WSGIApplicationGroup %{GLOBAL}

</VirtualHost>