VMware Workstation is the most popular Virtualization software used at the desktop level on Linux like operating systems and Microsoft Windows. It allows the us to create and run multiple Virtual machines simultaneously. VMware Workstation is not an open source or free software so we need to buy its license key, though we can use its trail version for 30 days then later you can apply its license key. Continue reading “How To Install VMware Workstation on Ubuntu 16.04 LTS”
How to use Linux and Unix TAR Command
The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or tar, gzip and bzip in Linux. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to anther disk or machine to machine. The main purpose of this article is to provide various tar command examples that might be helpful you to understand and become expert in tar archive manipulation. In this tutorial we will learn how to use Linux and UNIX TAR command.
Linux and Unix TAR Command
Create tar Archive File
Example command create a tar archive file wpcademy.tar for a directory /home/wpcademy in current working directory.
#tar -cvf wpcademy.tar /home/wpcademy/ /home/wpcademy/ /home/wpcademy/install.sh /home/wpcademy/openvpn-2.0.9-1.tar.gz
Create tar.gz Archive File
Example command create a compressed gzip archive file wpcademy.tar for a directory /home/wpcademy in current working directory.
#tar cvzf Mythemes.tar.gz /home/wpcademy /home/wpcademy/ /home/wpcademy/kardun /home/wpcademy/eleganthemes /home/wpcademy/adsready
Untar a tar File or gzip-bz2 tar File
#tar xvzf wpcademy.gz - for uncompress a gzip tar file (.tgz or .tar.gz) #tar xvjf wpcademy.tar.bz2 - for uncompress a bzip2 tar file (.tbz or .tar.bz2) #tar xvf wpcademy.tar - for uncompressed tar file (.tar)
Tar Command Options
c – create a archive file. x – extract a archive file. v – show the progress of archive file. f – filename of archive file. t – viewing content of archive file. j – filter archive through bzip2. z – filter archive through gzip. r – append or update files or directories to existing archive file. W – Verify a archive file.
How To Install and Configure Squid 3 on Ubuntu
Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. Squid proxy is used by various organisation and internet providers to reduce bandwidth and to increase response time. In this tutorial we will show you how to install and configuration of Squid on your Ubuntu server.
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Squid on Ubuntu server.
Install and Configure Squid 3 on Ubuntu
Step 1. To install, first you must update yum repository and packages by typing the below command:
apt-get -y update
Step 2. Installing Squid proxy server.
Install squid package and dependencies using the below command:
apt-get -y install squid3
Step 3. Edit squid configuration file ‘/etc/squid/squid.conf’
nano /etc/squid3/squid.conf
# Recommended minimum configuration: auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid3/squid_passwd acl ncsa_users proxy_auth REQUIRED http_access allow ncsa_users acl manager proto cache_object acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl SSL_ports port 9001 # webmin acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access deny all http_port 3128 #Setting up multiple outgoing IP addresses #acl godet myip 192.168.1.100 #tcp_outgoing_address 192.168.1.100 godet #acl jaran myip 192.168.1.101 #tcp_outgoing_address 192.168.1.101 jaran hierarchy_stoplist cgi-bin ? coredump_dir /var/spool/squid3 cache deny all refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern . 0 20% 4320 icp_port 3130 forwarded_for off request_header_access Allow allow all request_header_access Authorization allow all request_header_access Proxy-Authorization allow all request_header_access Proxy-Authenticate allow all request_header_access Cache-Control allow all request_header_access Content-Encoding allow all request_header_access Content-Length allow all request_header_access Content-Type allow all request_header_access Date allow all request_header_access Expires allow all request_header_access Host allow all request_header_access If-Modified-Since allow all request_header_access Last-Modified allow all request_header_access Location allow all request_header_access Pragma allow all request_header_access Accept allow all request_header_access Accept-Charset allow all request_header_access Accept-Encoding allow all request_header_access Accept-Language allow all request_header_access Content-Language allow all request_header_access Mime-Version allow all request_header_access Retry-After allow all request_header_access Title allow all request_header_access Connection allow all request_header_access Proxy-Connection allow all request_header_access User-Agent allow all request_header_access Cookie allow all request_header_access All deny all visible_hostname wpcademy.com
Step 4. Create our authentication file which Squid can use to verify for user authentications:
#htpasswd -b /etc/squid3/squid_passwd username password
Example:
htpasswd -b -c /etc/squid3/squid_passwd ranty ratna
Step 5. After making changes to the config file, save the file and restart the squid server service to effect the changes using the following command entered at a terminal prompt:
service squid3 restart
If you experience any problems, you can check the access.log for more information:
sudo tail -f /var/log/squid3/access.log
So you have successfully installed Squid . Thanks for using this tutorial for installing Squid caching proxy in Ubuntu system. For additional help or useful information, we recommend you to check the official Squid web site.
How To Install FFmpeg and FFmpeg-PHP Extension on CentOS
FFmpeg is a cross-platform solution for streaming audio and video as well as recording and conversion. There’s also a great PHP package called ffmpeg-php that allows for easy use of FFmpeg from inside PHP scripts. In this tutorial we will learn Install FFmpeg and FFmpeg-PHP Extension on CentOS server.
Install FFmpeg on CentOS
Step 1. To install, first you must add the DAG yum repository information corresponding to your CentOS/RHEL version to yum:
#nano /etc/yum.repos.d/dag.repo
Add the following text to the file and save:
[dag] name=DAG RPM Repository baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1
Step 2. After add Dag repository, Use yum to install ffmpeg using following command.
#<code>rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt #yum install ffmpeg ffmpeg-devel ffmpeg-libpostproc
FFmpeg Basic Commands
#ffmpeg -version: show version #ffmpeg -formats: show available formats #ffmpeg -codecs: show available codecs #ffmpeg -decoders: show available decoders #ffmpeg -encoders: show available encoders #ffmpeg -bsfs: show available bit stream filters #ffmpeg -protocols: show available protocols #ffmpeg -pix_fmts: show available pixel formats #ffmpeg -layouts: show standard channel layouts #ffmpeg -sample_fmts: show available audio sample formats #ffmpeg -filters: show available filters
Install FFmpeg-PHP Extension on CentOS
Step 1.
#yum install php-gd php-devel
Step 2.Download the latest ffmpeg-php release
#wget http://nchc.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 #tar -xjf ffmpeg-php-0.6.0.tbz2 #cd ffmpeg-php-0.6.0 #phpize #./configure #make #make install
If you get [ffmpeg_movie.lo] Error 1 when compiling ffmpeg-php, then you will need to do:
#nano ffmpeg_movie.c Changes in ffmpeg_movie.c: #row 311: list_entry *le; to zend_rsrc_list_entry *le; #row 346: list_entry new_le; to zend_rsrc_list_entry new_le; #row 360: hashkey_length+1, (void *)&new_le, sizeof(list_entry), to hashkey_length+1, (void *)&new_le,sizeof(zend_rsrc_list_entry),
Step 3. Copy the ffmpeg.so module in php default module location. Now you have to edit php.ini file to enable ffmpeg-php support in it by using ffmpeg.so module.
#nano /etc/php.ini
Put the below two lines at the end of the php.ini file
[ffmpeg] extension=ffmpeg.so
FFmpeg-PHP extension should now be installed. You can check by creating a file called info.php in /var/www/html/ with the following content:
<?php phpinfo(); ?>
How To Backup and Restore MySQL Database Using Command Line
This tutorial guide will show you two easy ways to Backup and Restore MySQL Database Using Command Line – mysqldump. You can also use this process to move your data to a new web server. We assume that you already have MySQL installed on Linux system with administrative privileges and we assume that you already have a small amount of knowledge on MySQL.
The parameters of the said command as follows.
- [uname] Your database username.
- [passwd] The password for your database (note there is no space between -p and the password).
- [dbname] The name of your database.
- [backupdb.sql] The filename for your database backup.
Backup and Restore MySQL Database Using Command Line
Backup MySQL database
First, you can check MySQL databases from your server:
#mysql -h localhost -u root -p #mysql> show databases;
The following command will dump all databases to an sql file. Replace pass with your root database password and filename with the name of the file you wish to create such as backupdb.sql
Back up multiple databases in MySQL
#mysqldump –u[uname] –p[passwd] [database name 1] [database name 2] > backup.sql
Example:
#mysqldump –u root –pidroidus chedelics radiks > backup.sql
Backup all databases in MySQL
#mysqldump –u [uname] –p[passwd] –all-databases > backup.sql
Example:
#mysqldump –u root –pidroidus –all-databases > backup.sql
Back up your MySQL Database with Compress
#mysqldump -u root -p[passwd] --databases [dbname] | gzip > backup.sql.gz
Example:
#mysqldump -u root -pidroidus --databases | gzip > backup.sql.gz
Restore MySQL database from a backup file
Above we backup the Tutorials database into backupdb.sql file. To re-create the Tutorials database you should follow two steps:
- Create an appropriately named database on the target machine
- Load the file using the mysql command:
#mysqladmin -u root -p create [dbname]
#gzip -d backupdb.sql.gz #mysql -uroot -p[passwd] [dbname] < backupdb.sql
Example:
#mysqladmin -u root -p create chedelics #gzip -d backupdb.sql.gz #backupdb.sql #mysql -uroot -pidroidus chedelics < backupdb.sql
How To Configure Nginx With SSL
Transport Layer Security (TLS) and Secure Socket Layer (SSL) provide an easy method to encrypt connections between end-users and web servers. SSL uses a certificate authority system to provide identity verification in order to prevent websites from falsely claiming to be another organization or website. This tutorial shows you how to set up strong SSL security on the nginx webserver. In this tutorial we will learn how to install and configuration of Nginx with SSL on your Linux server.
Configure Nginx With SSL
Required:
- Assuming you’ve installed webserver nginx.
- I use Namecheap as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
Step 1. Create a directory
mkdir -p /etc/nginx/ssl/wpcademy.com
Step 2. Generating Your SSL Key and CSR
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate. For Common Name enter your intended domain name without ‘www’ i.e. wpcademy.com. If it’s a Wildcard SSL, use *.wpcademy.net.
openssl req -nodes -newkey rsa:2048 -keyout wpcademy.net.key -out wpcademy.com.csr
Step 3. Create a certificate bundle
After purchase the certificate, You’ll eventually get an email with your SSL Certificate. It contains a zip file with the following:
- AddTrustExternalCARoot.crt
- COMODORSAAddTrustCA.crt
- COMODORSADomainValidationSecureServerCA.crt
- wpcademy.com.crt
cat wpcademy_net.crt AddTrustExternalCARoot.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt >> ssl-bundle.crt
Once create a certificate bundle you can move it to your Nginx SSL directory.
mv ssl-bundle.crt /etc/nginx/ssl/wpcademy.com/
Step 4. Configure the Certificate for nginx
Go to nginx virtual host configuration, using SSL with nginx requires a modification to the listen directive and three ssl-related directives as shown in the following examples:
nano /etc/nginx/conf.d/ssl.conf
server {
listen 443 ssl spdy;
server_name www.wpcademy.com wpcademy.com;
root /var/www/wpcademy.com/public_html;
index index.php index.html index.htm;
server_tokens off;
#SSL CONF
ssl on;
ssl_certificate /etc/nginx/ssl/wpcademy.com/ssl-bundle.crt;
ssl_certificate_key /etc/nginx/ssl/wpcademy.com/wpcademy.us.key;
#SSL
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 10s;
# permalink
location / {
try_files $uri $uri/ /index.php?$args;
}
# php-script handler
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
root /var/www/wpcademy.com/public_html;
fastcgi_param SCRIPT_FILENAME /var/www/wpcademy.com/public_html$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Step 5. Redirect HTTP Virtual Hosts to HTTPS
return 301 https://wpcademy.com$request_uri;
Step 6. Restart/reload nginx
/etc/init.d/nginx restart
Congratulation’s! You have successfully installed Nginx with SSL. Thanks for using this tutorial for installing and configuration Nginx with SSL on Linux system. For additional help or useful information, we recommend you to check the official Nginx web site
How To Install Orangescrum on Ubuntu 18.04 LTS
Orangescrum is a free, open source, flexible project management web application written using CakePHP. It helps you to manage projects, teams, documents, and tasks, all in one place. Orangescrum provides various features like agile project management, collaboration, issue tracking, notifications, reporting, task management, and traditional project management functionality for small/medium businesses. Continue reading “How To Install Orangescrum on Ubuntu 18.04 LTS”