RHEL/CentOS – How to install NGINX

Pre-requisites:

make sure EPEL is enabled – see here.

Once that is done just issue:

yum install nginx

and when installed enable the service so it starts with they OS:

[root]# chkconfig nginx
Note: Forwarding request to 'systemctl is-enabled nginx.service'.
disabled
[root]# chkconfig nginx on
Note: Forwarding request to 'systemctl enable nginx.service'.
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
[root]# chkconfig nginx
Note: Forwarding request to 'systemctl is-enabled nginx.service'.
enabled

Install LibreOffice 5.0 in Linux Mint via PPA

To be able to update LibreOffice to version 5.0 via PPA, you need to create a file called “libreoffice-libreoffice-5-0.pref” under /etc/apt/preferences.d/ – to do this automatically, use the following command:

nano /etc/apt/preferences.d/libreoffice-libreoffice-5-0.pref

and in this file, paste this:

Package: *
Pin: release o=LP-PPA-libreoffice-libreoffice-5-0
Pin-Priority: 701

than

sudo add-apt-repository ppa:libreoffice/libreoffice-5-0
sudo apt-get update
sudo apt-get dist-upgrade

Lastly start Mint Software Manager and install LibreOffice

Debian – setting up iptables

Iptables is installed by default on many modern linux distros.

A good starting point is to list the current rules that are configured for iptables. It is done with the -L flag:

sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

 

Setting it up

I am going to start with the rule that explicitly accepts current SSH connection:

sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

then I will allow SSH

sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT

 

meaning of the options:

-A INPUT: The -A flag appends a rule to the end of a chain. This is the portion of the command that tells iptables that we wish to add a new rule, that we want that rule added to the end of the chain, and that the chain we want to operate on is the INPUT chain

-p tcp: This option matches packets if the protocol being used is TCP. This is a connection-based protocol that will be used by most applications because it allows for reliable communication.

–dport: This option is available if the -p tcp flag is given. It gives a further requirement of matching the destination port for the matching packet. The first rule matches for TCP packets destined for port 22, while the second rule matches TCP traffic pointed towards port 80.

-j ACCEPT: This specifies the target of matching packets. Here, we tell iptables that packets that match the preceding criteria should be accepted and allowed through.

 

There is one more accept rule that we need to ensure that our server can function correctly. Often, services on the computer communicate with each other by sending network packets to each other. They do this by utilizing a pseudo network interface called the loopback device, which directs traffic back to itself rather than to other computers:

sudo iptables -I INPUT 1 -i lo -j ACCEPT

-I INPUT 1: The -I flag tells iptables to insert a rule. This is different than the -A flag which appends a rule to the end. The -I flag takes a chain and the rule position where you want to insert the new rule.

To see my current rules, I use the -S flag. This is because the -L flag doesn’t include some information, like the interface that a rule is tied to:
sudo iptables -S

-P INPUT ACCEPT
 -P FORWARD ACCEPT
 -P OUTPUT ACCEPT
 -A INPUT -i lo -j ACCEPT
 -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
 -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT

With my current setup the firewall isn’t actually blocking anything so one last thing to implement is the Drop Rule:
sudo iptables -P INPUT DROP

This will catch any packets that fall through our INPUT chain, and drop them. This is what we call a default drop policy.

In case I need to add more rules:

iptables -L --line-numbers

that will give you output listing line numbers – so if for example I have 20 existing rules and I want to add this rule at the end I would type:

iptables -I INPUT 21 ...........

for example:

iptables -I INPUT 21 -p tcp -m tcp --dport 25 -j ACCEPT

Saving it all

 

To keep the config we need to save it. First install the bits we will need:

apt-get install iptables-persistent

that will install and setup iptables-persistent service

the iptables config will be saved to:

/etc/iptables/rules.v4

the command to save the config is:

iptables-save > /etc/iptables/rules.v4

 

Job Done

VM Tools – install

Installing and Upgrading VMware Tools

as published on
http://pubs.vmware.com/vi35u2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=admin&file=BSA_Creating_VMs.14.8.html
VMware Tools is a suite of utilities that enhances the performance of the virtual machine’s guest operating system and improves management of the virtual machine. Installing VMware Tools in the guest operating system is vital. Although the guest operating system can run without VMware Tools, you lose important functionality and convenience.
The VMware Tools service (VMwareService.exe on Windows guests or vmware-guestd on Linux and Solaris guests). This service synchronizes the time in the guest operating system with the time in the host operating system. On Windows guests, it also controls grabbing and releaseing the mouse cursor.
A set of VMware device drivers, including an SVGA display driver, the vmxnet networking driver for some guest operating systems, the BusLogic SCSI driver for some guest operating systems, the memory control driver for efficient memory allocation between virtual machines, the sync driver to quiesce I/O for Consolidated Backup, and the VMware mouse driver.
A set of scripts that helps you to automate guest operating system operations. The scripts run when the virtual machine’s power state changes if you configure them to do so.
The VMware user process (VMwareUser.exe on Windows guests or vmware-user on Linux and Solaris guests), which enables you to copy and paste text between the guest and managed host operating systems.
The VMware Tools user process is not installed on NetWare operating systems. Instead, the vmwtool program is installed. It controls the grabbing and releasing of the mouse cursor. It also allows you copy and paste text.
You can optionally install WYSE Multimedia Redirector, which improves streaming video performance in Windows guest operating systems running on WYSE thin client devices.
Configure the guest operating system before installing or reinstalling VMware Tools. This enables VMware tools to determine the correct mouse configuration and module configuration.
Note If the guest operating system is installed but not correctly configured when you install VMware Tools, the VMware Tools installation does not work correctly. This can cause the guest operating system to crash.
Note If you do not have VMware Tools installed in your virtual machine, you cannot use the shutdown or restart options. You can use only the Power options. If you want to shut down the guest operating system, shut it down from within the virtual machine console before you power off the virtual machine.
The installers for VMware Tools for Windows, Linux, Solaris, and NetWare guest operating systems are built into ESX Server as ISO image files. An ISO image file looks like a CD-ROM to your guest operating system and even appears as a CD-ROM disc in Windows Explorer. You do not use an actual CD-ROM disc to install VMware Tools, nor do you need to download the CD-ROM image or burn a physical CD-ROM of this image file.
When you choose to install VMware Tools, VMware VirtualCenter temporarily connects the virtual machine’s first virtual CD-ROM disk drive to the ISO image file that contains the VMware Tools installer for your guest operating system. You are ready to begin the installation process.
Note If you are using a WYSE thin client device and want to install WYSE Multimedia Support along with VMware Tools, see Custom VMware Tools Installation. You must use the custom installation path in order to install WYSE Multimedia Support.
4
From inside the virtual machine, click OK to confirm that you want to install VMware Tools and launch the InstallShield wizard.
If you have autorun enabled in your guest operating system (the default setting for Windows operating systems), a dialog box appears.
If autorun is not enabled, run the VMware Tools installer. Click Start > Run and enter D:setup.exe, where D: is your first virtual CD-ROM drive.
After you install VMware Tools, Windows 2000 and Windows XP guest operating systems must be rebooted to use the new driver.
If you see a VMware Tools CD icon on the desktop, double-click it, and after it opens, double-click the RPM installer in the root of the CD-ROM.
In some Linux distributions, the VMware Tools CD icon might fail to appear. In this case, continue install VMware Tools from the command line.
6
Click Continue when the installer presents a dialog box that shows Completed System Preparation.
A dialog box appears with a progress bar. When the installer is done, VMware Tools is installed. There is no confirmation or finish button.
7
In an X terminal, as root (su –), run the following file to configure VMware Tools:
4
As root (su –), mount the VMware Tools virtual CD-ROM image and change to a working directory (for example, /tmp), as follows.
Note Some Linux distributions automatically mount CD-ROMs. If your distribution uses automounting, do not use the mount and umount commands described in this procedure. You still must untar the VMware Tools installer to /tmp.
Some Linux distributions use different device names or organize the /dev directory differently. Modify the following commands to reflect the conventions used by your distribution:
Note If you have a previous installation, delete the previous vmware-tools-distrib directory before installing. The default location of this directory is:
Where is the build/revision number of the Workstation release.
Where is the build/revision number of the Workstation release.
Note If you attempt to install an rpm installation over a tar installation—or the reverse—the installer detects the previous installation and must convert the installer database format before continuing.
4
Log in as root (su –) and, if necessary, mount the VMware Tools virtual CD-ROM image, as follows.
Usually, the Solaris volume managervold—mounts the CD-ROM under /cdrom/vmwaretools. If the CD-ROM is not mounted, restart the volume manager using the following commands:
When the installation finishes, the message VMware Tools for NetWare are now running appears in the Logger Screen (NetWare 6.5 and NetWare 6.0 guests) or the Console Screen (NetWare 5.1 guests).