How to Download CentOS 7 ISO

Download CentOS 7 ISO

In July 2014, a welcome version of CentOS 7 which tagged as 1406 (CentOS 7.0) officially released. As of end-March 2015, the second CentOS 7 release tagged as 1503 (CentOS 7.1) is available for download and CentOS 7.2  that was tagged as 1511 was released on 14 December 2015.

As of end-March 2015, the second CentOS 7 release tagged as 1503 (CentOS 7.1) is available for download and CentOS 7.2  that was tagged as 1511 was released on 14 December 2015.

The latest release supersedes all previously released content for CentOS 7, therefore it is recommended for all users to upgrade their CentOS machines. This article will list the URL to download CentOS 7 ISO images.

CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public by Red Hat.For those who do not want to perform

For those who do not want to perform fresh install of CentOS 7 on the existing machine, you also can get CentOS 7 running by following the upgrade path from CentOS-6 to CentOS-7.

But this path is only supported from the latest version of CentOS-6 (being 6.7 at the time of writing) to the latest version of CentOS-7.

Mirror list to download CentOS 7 ISO images available :

a) Download centos 7 64 bit (4.0GB)
b) Download centos 7 64 bit Everything (7.1GB)
c) Download centos 7 netinstall
d) Download centos 7 live cd

The following alternate mirrors should also have the ISO images available.

Before you download, you also can read the Major Changes for CentOS 7.0 (1406) :
As with every first major release most of the packages have changed and have been updated to more recent versions. It would exceed the scope of this document to list them all. Most notable changes are:

  • Kernel updated to 3.10.0
  • Support for Linux Containers
  • Open VMware Tools and 3D graphics drivers out of the box
  • OpenJDK-7 as default JDK
  • In Place Upgrade from 6.5 to 7.0 (as already mentioned)
  • LVM-snapshots with ext4 and XFS
  • Switch to systemd, firewalld and GRUB2
  • XFS as default file system
  • iSCSI and FCoE in kernel space
  • Support for PTPv2
  • Support for 40G Ethernet Cards
  • Supports installations in UEFI Secure Boot mode on compatible hardware

Major Changes for CentOS 7.1 (1503)

  • As of March 2015 ABRT (>= 2.1.11-19.el7.centos.0.1) can report bugs directly to bugs.centos.org. You can find information about that feature at this page
  • Support for new processors (Intel Broadwell) and graphics (AMD Hawaii)
  • Full support for LVM cache
  • Ability to mount ceph block devices
  • Updated Hyper-V network drivers
  • New libguestfs features
  • Full support for OpenJDK-1.8.0
  • Improved clock stability (for PTP and NTP)
  • Updated Networkmanager packages to version 1.0
  • Updated docker to 1.4.1
  • Updated OpenSSH to 6.6.1
  • New package: Mozilla Thunderbird
  • Update to numerous storage, network and graphics drivers
  • Technology Preview: Support of the Btrfs file system, OverlayFS and the Cisco VIC kernel driver

Major Changes for CentOS 7.2 (1511)

  • Since release 1503 (abrt>= 2.1.11-19.el7.centos.0.1) CentOS-7 can report bugs directly to bugs.centos.org. You can find information about that feature at this page
  • sudo is now capable of verifying command checksums
  • A Kerberos https proxy is now available for identity management
  • NSS no longer accepts DH key parameters < 768 nor RSA/DSA certificates with key sizes < 1024 bits, NSS also now enables TLS1.1/1.2 by default
  • various packages now support TLS1.1/1.2 and EC ciphers
  • The maximum number of SCSI LUNs has been increased
  • The virt-v2v command line tool is now fully supported
  • dd can now show transfer progress
  • OpenJDK7 now supports ECC for TLS connections
  • TPM version 2.0 driver level support has been added
  • tcpdump now supports nanosecond timestamps
  • Various updates to the networking stack (i.e. VXLANs, Data Center TCP, TCP/IP Stack, IPSec, …)
  • Various atomic related packages have been updated
  • Update to the libATA, FCoE and DCB storage drivers
  • Updates to various storage, network and graphics drivers
  • Anaconda now supports NFS when adding additional repos during install
  • Major rebases for the following: Gnome from 3.8 to 3.14, KDE from 4.3 to 4.14, Xorg-X11-Server from 1.15 to 1.17, libreoffice from 4.2.8 to 4.3.7. openldap from 2.4.39 to 2.4.40 and more.

Read more on CentOS 7 Release Notes

I hope this article gives you some ideas and quick guide on where you can download CentOS 7 ISO.

 

How to Setup Linux Login Banner on CentOS 6 / CentOS 7

Linux Login Banner

Most system administrators have applied linux login banner on their servers. The purpose of this linux login banner is to show some messages or warnings when ssh session connected and before entry. The message displayed in the linux login banner is dedicated either to the system administrator who wants to perform routine system maintenance or intruders who want to launch brute force attacks on the server.

Linux Login Banner on CentOS 6 / CentOS 7 / RHEl 7 / Oracle Linux 7

To enable this in ssh you have to follow this simple steps:

1. Create a /etc/mybanner file and fill it with your desired message as below

# vi /etc/mybanner
Unauthorized access to this machine is prohibited
Only authorized System Administrator can access to this system
Press  if you are not an authorized user

Save and Quit the mybanner file.

Optionally you can give warning as below if it is involved a server with highly confidential information:

This service is restricted to authorized System Administrator only. All activities on this system are logged. Unauthorized access will be fully investigated and reported to the appropriate law enforcement agencies.

2. Edit /etc/ssh/sshd_config, to look like this Banner /etc/mybanner

113
114
115 # default banner path
116 Banner /etc/mybanner
117
118

3. Restart sshd service sshd restart

4. Test your session

login as: root
Unauthorized access to this machine is prohibited
Only authorized System Administrator can access to this system
Press  if you are not an authorized user
root@192.168.2.5's password:

I hope this article gives you some ideas and essential guidance on how to setup linux Login Banner on RHEL 7 / CentOS 7/ Oracle Linux 7

 

How to Configure FTP Server in Linux RHEL 6

In this post i will show how to install Very Secure FTP (Vsftpd) and how to configure ftp server in linux Red Hat Enterprise Linux 6 (RHEL 6). Vsftpd is a GPL licensed FTP server for UNIX systems, including Linux. It is secure and extremely fast and it is stable.

As an example I will install and configure the vsftpd server and will also transfer files from the clients running on the Windows XP command prompt.

-A linux server with ip address 192.168.1.43 running on RHEL 6 Operating system
-A window client with ip address 192.168.1.52 running on Windows XP Pro
-RHEL 6 server Running portmap/rpcbind and xinetd services
-Firewall and SElinux should be off on server

how to configure ftp server in linux

How to Install FTP Server in Linux ?

1. Install vsftpd, rpcbind and xinetd service using the following command :

# yum install vsftpd rpcbind xinetd -y

2. Check vsftpd, xinetd and rpcbind/portmap exist and installed on the server :

# rpm -qa vsftpd
vsftpd-2.2.2-6.el6.i686

# rpm -qa xinetd
xinetd-2.3.14-29.el6.i686

# rpm -qa rpcbind
rpcbind-0.2.0-8.el6.i686

3. Make all these services auto start at boot :

# chkconfig vsftpd on
# chkconfig xinetd on
# chkconfig rpcbind on

4. Check the xinetd and rpcbind status :

# service xinetd status
xinetd (pid  1326) is running...

# service rpcbind status
rpcbind (pid  1178) is running...

5. Create the a new user named ftpuser and set password :

# useradd ftpuser
# passwd ftpuser
Changing password for user ftpuser.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

6. Login as ftpuser on other terminal and create a new files named “files”.

# su - ftpuser
[ftpuser@rhel6 ~]$ cat > files
This is file created on RHEL 6 ftp server

7. Start the vsftpd service :

# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]

8. Stop the iptables linux firewall and disabled selinux :

# service ip6tables stop
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]

# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
# setenforce 0
setenforce: SELinux is disabled

How to Configure FTP Server in Linux ?

9. It’s good to make backup of your original configuration file.

[root@rhel6 ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-bak

10. login from user account and download the files :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): ftpuser
331 Please specify the password.
Password:
230 Login successful.
ftp> get files
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for files (42 bytes).
226 Transfer complete.
ftp: 42 bytes received in 0.00Seconds 42000.00Kbytes/sec.
ftp> quit
221 Goodbye.

11. Check the contain of downloaded files :

D:\>type files
This is file created on RHEL 6 ftp server

12. By default root account is not allowed to login the vsftpd server as it’s exist in /etc/vsftpd/ftpusers.

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): root
530 Permission denied.
Login failed.
ftp>

13. Open /etc/vsftpd/ftpusers file. Remove or comment out the line for user “root” and add “ftpuser” instead. Users whose name are set in this file will not allowed to login from ftp.

[root@rhel6 ~]# vi /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
#root
ftpuser
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

14. Open /etc/vsftpd/user_list file. Remove or comment out entry in /etc/vsftpd/user_list files. Remove or comment out the line for user “root” and add “ftpuser” instead. Users whose names are set in this file are also not allowed to login from ftp even they are not prompt for password.

# vi /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
ftpuser
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

15. Root now allowed to access ftp server :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): root
331 Please specify the password.
Password:
230 Login successful.
ftp> quit
221 Goodbye.

16. ftpuser now not allowed to access ftp server :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 (vsFTPd 2.2.2)
User (192.168.1.43:(none)): ftpuser
530 Permission denied.
Login failed.
ftp>

17. How to set login banner for ftp server :
Open /etc/vsftpd/vsftpd.conf look for “ftpd_banner” :

# vi /etc/vsftpd/vsftpd.conf

Uncomment ftpd_banner and customize the login banner string as below :

# You may fully customise the login banner string:
ftpd_banner=Welcome to eHowStuff.com RHEL6 FTP server
#

18 Restart the ftp service :

# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]

19. Try login to ftp server. Check the banner, it will appear before user login as below :

D:\>ftp 192.168.1.43
Connected to 192.168.1.43.
220 Welcome to eHowStuff.com RHEL6 FTP server
User (192.168.1.43:(none)):

If you encounter any issues on how to configure ftp server in linux, you can put a few questions in the comments below.

How to Install FTP Server Linux using ProFTPd

FTP Server Linux

Proftpd is one of the most popular FTP server, secure and reliable for the Linux operating system. Proftpd using a single configuration file and it is very easy to set up. The purpose of this article is to show you how easy it is to install FTP Server Linux ProFTPd server in CentOS 6 Linux.

What is FTP Server Linux?

FTP, which stands for File Transfer Protocol is a standard for exchanging program and data files across a network. The network could be the World Wide Web or simply a local area network (LAN).

Prerequisite :
How to Add the RPMforge Repository on CentOS 6/RHEL 6 Linux Server

1. Simply run this command to install FTP server linux, ProFTPd on CentOS 6 :

# yum install proftpd -y

2. How to start proftpd service :

# /etc/init.d/proftpd start

3. How to stop proftpd service :

# /etc/init.d/proftpd stop

4. How to restart proftpd service :

# /etc/init.d/proftpd restart

5. Configure proftpd start at boot :

[root@centos62 ~]# chkconfig proftpd on

If you encountered any issues while installing FTP Server Linux using proftpd, you can put a few questions in the comments below.

 

How to Install Linux FTP Server using Vsftpd

Vsftpd stands for Very Secure FTP Daemon. Vsftpd is not just another popular Unix / Linux FTP Server, but vsftpd delivering outstanding performance by taking less memory. It is running under xinetd and allows you run one process less because xinetd is shared among various other small services. For those webmasters or blogger who intend to run web server on Virtual Private Server (VPS) or Dedicated Server, Vsftpd would be the best choice. It is easy to install and can perform all that we expect from an FTP daemon while maintaining a higher level of security if configured properly. This article focuses on and covers the installation and configuration of the FTP server Vsftpd on CentOS Linux VPS.

1. Installing Linux FTP Server, vsftpd using yum command :

# yum install vsftpd -y

2. Makesure that xinetd has been installed :

# rpm -qa xinetd

If not installed, execute the following command :

# yum install xinetd -y

3. Make xinetd and Vsftpd daemon start at boot :

# chkconfig vsftpd on
# chkconfig xinetd on

4. It is recommended to do backup of your original configuration file, before do changes :

# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf-bak

5. Configure Vsftpd :

# vi /etc/vsftpd/vsftpd.conf

a) Uncomment ftpd_banner and customize the login banner string as below :

# You may fully customise the login banner string:
ftpd_banner=Welcome to Linux FTP service.
#

b) This step is to configure not allowed users. By default root account is not allowed to login the vsftpd server as it’s existed on /etc/vsftpd/ftpusers. To allow it, open /etc/vsftpd/ftpusers files and remove or comment on the line of a user “root”. Users whose name are set in this file will not allow to login from ftp.

# cat /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

6. Test root login from windows command prompt at client PC using user, ehowstuff :

C:\>ftp 192.168.2.54
Connected to 192.168.2.54.
220 Welcome to Linux CentOS FTP service.
User (192.168.2.54:(none)): ehowstuff
331 Please specify the password.
Password:
230 Login successful.
ftp>

If you encounter any issues when setting up linux ftp server, you can put a few questions in the comments below.

linux ftp server

Credit : www.unixmen.com

 

How to a Add and Remove User Account on RHEL 6/7, CentOS 6/7, Oracle Linux 6/7

This article will explain and share how to add and remove user account with useradd(add) and userdel (remove) from the command-line on linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7 server.

1. Adding a New User to an Linux System.

a) Get the useradd manual :

# man useradd
useradd - create a new user or update default new user information

b) To creates the new account and the /home/john home directory :

# useradd --home /home/ehowstuff ehowstuff

c) useraddd command does not set any valid password by default, and user cannot log in until a password is set.To set the password user the following command :

# passwd ehowstuff
Changing password for user ehowstuff.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

d) Verify the values in /etc/password :

# cat /etc/passwd | grep ehowstuff
ehowstuff:x:501:501::/home/ehowstuff:/bin/bash

e) Verify the values in /etc/group :

# cat /etc/group | grep ehowstuff
ehowstuff:x:501:

f) Verify email user created for id ehowstuff :

# ls /var/spool/mail | grep ehowstuff
ehowstuff

More useradd options :

-c, –comment COMMENT
Add a value, such as a full name, to the GECOS field.

-g, –gid GROUP
Specify the primary group for the user account.

-G, –groups GROUPS
Specify a list if supplementary groups for the user account.

-a, –append
Used with the -G option to append the user to the supplemental groups mentioned without removing the user from other groups.

-d, –home HOME_DIR
Specify a new home directory to a new location. Must be used with the -d option.

-m, –move-home
Move a user home directory to a new location. Must be used with the -d option.

-s, –shell SHELL
Specify a new login shell for the user account.

-L, –lock
Lock a user account.

-U, –unlock
Unlock a user account.

2. Deleting a User from an Linux System.

a) Get userdel manual :

# man userdel
userdel - delete a user account and related files

b) userdel username removes the user from /etc/passwd, but leaves the home directory intact by default. Proper command to remove the user’s account, user’s home directory and mail spool as part of the deletion process :

# userdel --remove ehowstuff

or

# userdel -r ehowstuff

Warning :
When a user is removed with userdel without the -r option specified, the system will have files that are owned by an unassigned user ID number. This can also happen when files created by a deleted user exist outside their home directory. This situation can lead to information leakage and other security issues.

 

How to Install and Configure TigerVNC Server on CentOS 7.1 / RHEL 7.1 / Oracle Linux 7

The following article explain how to Install and configure TigerVNC Server on CentOS 7.1 or Red Hat Enterprise Linux (RHEL 7.1) or Oracle Linux 7. TigerVNC (Tiger Virtual Network Computing) is a remote access utility that allows you to control other computers that running graphical desktop sharing in separate sessions in parallel. It is works on the client-server principle: a server shares its output (vncserver) and a client (vncviewer) connects to the server. TigerVNC in RHEL 7 or CentOS 7 or Oracle Linux 7 uses the systemd system management daemon for its configuration. The /etc/sysconfig/vncserver configuration file has been replaced by /etc/systemd/system/vncserver@.service.

Install and Configure TigerVNC Server on Linux

1. Install tigervnc-server

# yum install tigervnc-server -y

2. Copy this file to /etc/systemd/system/vncserver@:.service :

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

3. Edit and vncserver parameters appropriately

# vi /etc/systemd/system/vncserver@:1.service

Replace with actual user hat exist on the linux (e.g ehowstuff)

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l ehowstuff -c "/usr/bin/vncserver %i"
PIDFile=/home/ehowstuff/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

4. Run `systemctl daemon-reload` to make the changes take effect immediately :

# systemctl daemon-reload

5. Set the password for the user or users defined in the configuration file. Note that you need to switch from root to USER first.

# su - ehowstuff
$ vncpasswd
Password:
Verify:

6. To start the service, specify the display number directly in the command :

# systemctl start vncserver@:1.service

7. Enable the service to start automatically at system start

# systemctl enable vncserver@:1.service

8. Add firewall rules to allow the VNC connection :

# firewall-cmd --permanent --zone=public --add-port 5901/tcp
# systemctl restart firewalld.service

9. Run VNC viewer :
Configure TigerVNC Server

How to Change RunLevel on CentOS 7 / RHEL 7

Old method to change the runlevel via /etc/inittab in Redhat Enterprise Linux version and CentOS server has become obsolete on RHEL 7 and CentOS 7. This latest Linux operating system uses systemd system management daemon and relies on systemctl command in order to change the runlevel. RunLevel is set with linking to /etc/systemd/system/default.target. Please make sure you have already install Gnome GUI before you proceed to change runlevel.

1. Check the current runlevel :

# runlevel
N 3

or

# systemctl get-default
multi-user.target

2. We can display the default.target by using list command :

# ll /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 Sep  1  2014 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target

3. For example to list all currently loaded targets :

# systemctl list-units -t target
UNIT                LOAD   ACTIVE SUB    DESCRIPTION
basic.target        loaded active active Basic System
cryptsetup.target   loaded active active Encrypted Volumes
getty.target        loaded active active Login Prompts
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target     loaded active active Local File Systems
multi-user.target   loaded active active Multi-User System
network.target      loaded active active Network
paths.target        loaded active active Paths
remote-fs.target    loaded active active Remote File Systems
slices.target       loaded active active Slices
sockets.target      loaded active active Sockets
swap.target         loaded active active Swap
sysinit.target      loaded active active System Initialization
timers.target       loaded active active Timers

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

14 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

4. Type the following command to change the RunLevel to Graphical-login :

# systemctl set-default graphical.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'

5. Verify the changed runlevel :

# runlevel
N 5

or

# systemctl get-default
graphical.target

6. Reboot the server to login to GNOME gui.

redhat-banner

How to Fix GNOME License Not Accepted Issue on CentOS 7

This post assume that you have just finished the Gnome GUI installation on CentOS 7 by using “yum groupinstall “GNOME Desktop” “Graphical Administration Tools” -y” command. Previously you are running a minimum CentOS 7, only with command line via terminal. But after you reboot the server you get the following screen.

Initial setup of CentOS Linux 7 (core)
1) [x] Creat user 2) [!] License information
(no user will be created) (license not accepted)
Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]:

Gnome-Gui-License-1

To fix the issue, you have to perform the following :

a) Press 1
b) Press 2 in order to change [ ] to [x] in front of 2) I accept the license agreement
c) Press q
d) Accept license menu does not prompt anymore at boot.

Gnome-Gui-License-2

How to Install and Setup Apache Tomcat 8 on CentOS 7 / RHEL 7

What is Tomcat Server and What is Apache Tomcat used for ?

Apache Tomcat version 8 is an open source web server and servlet container developed by the Apache Software Foundation (ASF).

It provides a web server environment for Java based source code and used to deploy Java Servlets and JSPs.

Basically Apache is an HTTP Server, serving HTTP. Tomcat is a Servlet and JSP Server serving Java technologies.

Tomcat 8 is the first Apache Tomcat release to support the Servlet 3.1, JSP 2.3, EL 2.3, and WebSocket specifications.

This article will describes how to install and configure Tomcat 8 on CentOS 7, RHEL 7 and Oracle Linux 7.

1. Install Oracle java :

2. How to download Apache Tomcat 8 :

To download Apache tomcat 8, go to the apache tomcat mirror

# cd /opt
# wget http://apache.arvixe.com/tomcat/tomcat-8/v8.0.22/bin/apache-tomcat-8.0.22.tar.gz

3. Extract the downloaded files :

# tar xzvf apache-tomcat-8.0.22.tar.gz

4. Create tomcat8 group and add user tomcat8 to that group:

# groupadd tomcat8
# useradd -s /bin/bash -g tomcat8 tomcat8

5. Create a symbolic link of tomcat directory to /opt/tomcat and assign permission :

# ln -s /opt/apache-tomcat-8.0.22 /opt/tomcat
# chown -R tomcat8:tomcat8 /opt/tomcat /opt/apache-tomcat-8.0.22

6. Create a Systemd Setting file :

# vi /usr/lib/systemd/system/tomcat8.service

Add the following :

[Unit]
Description=Apache Tomcat 8
After=network.target

[Service]
Type=oneshot
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
RemainAfterExit=yes
User=tomcat8
Group=tomcat8

[Install]
WantedBy=multi-user.target

7. How to start tomcat server and make it auto start at boot :

# systemctl start tomcat8
# systemctl enable tomcat8

8. Tomcat server works on port 8080 default. You can access from your browser using the url :

http://serverURL:8080

setup-tomcat-centos7-1

9. There are changes on the user roles on Tomcat 8. By default, no users or passwords are created for the Tomcat manager roles. To set roles, user name(s) and password(s), we need to configure the tomcat-users.xml file located at $CATALINA_HOME/conf/tomcat-users.xml.

# vi /opt/tomcat/conf/tomcat-users.xml

Add the following :

<!-- user manager can access only manager section -->
<role rolename="manager-gui"></role>
<user username="manager" password="password" roles="manager-gui"></user>

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui"></role>
<user username="admin" password="password" roles="manager-gui,admin-gui"></user>

Read here on the different between Apache Web Server and Apache Tomcat server.

How to Show Mailbox Size on Zimbra via Bash Script

Q. How to show mailbox Size on Zimbra via bash script ?

A. There are two script available to show mailbox size of the zimbra users :

Option A

1. Create the scripts directory to keep the bash file and give zimbra ownership to the folder :
# mkdir -p /opt/zimbra/backup/scripts
# chown -R zimbra:zimbra /opt/zimbra/backup/scripts
2. Create bash script as below :
# vi /opt/zimbra/backup/scripts/mailboxsize1.sh

Add the following :

#!/bin/bash
all_account=`zmprov -l gaa`;
for account in ${all_account}
do
    mb_size=`zmmailbox -z -m ${account} gms`;
    echo "Mailbox size of ${account} = ${mb_size}";
done
3. Give ownership to zimbra group and user and make the script executable :
# chown -R zimbra:zimbra /opt/zimbra/backup/scripts/mailboxsize1.sh
# chmod +x /opt/zimbra/backup/scripts/mailboxsize1.sh
4. As a zimbra user run the following script :
# su - zimbra
$ /opt/zimbra/backup/scripts/mailboxsize1.sh

Sample output :

Mailbox size of admin@ehowstuff.local = 217.23 KB
Mailbox size of spam.wc5ohhoylp@ehowstuff.local = 0 B
Mailbox size of ham.ypxiyleoyj@ehowstuff.local = 0 B
Mailbox size of virus-quarantine.kl6ejsnmd@ehowstuff.local = 0 B
Mailbox size of galsync.vtfk6uwt@ehowstuff.local = 0 B
Mailbox size of user1@ehowstuff.local = 375.28 KB
Mailbox size of user2@ehowstuff.local = 24.97 KB

Option B

1. Create the scripts directory to keep the bash file and give zimbra ownership to the folder :
# mkdir -p /opt/zimbra/backup/scripts
# chown -R zimbra:zimbra /opt/zimbra/backup/scripts
2. Create bash script as below :
# vi /opt/zimbra/backup/scripts/mailboxsize2.sh

Add the following :

#!/bin/bash
output="/tmp/accountusage"
domain="ehowstuff.local"

rm -f $output
touch $output

server=`zmhostname`
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line
do
usage=`echo $line|cut -f2 -d " "`
quota=`echo $line|cut -f3 -d " "`
user=`echo $line|cut -f1 -d " "`
status=`/opt/zimbra/bin/zmprov ga $user | grep  ^zimbraAccountStatus | cut -f2 -d " "`
echo "$user `expr $usage / 1024 / 1024`Mb `expr $quota / 1024 / 1024`Mb ($status account)" >> $output
done

cat $output
3. Give ownership to zimbra group and user and make the script executable :
# chown -R zimbra:zimbra /opt/zimbra/backup/scripts/mailboxsize2.sh
# chmod +x /opt/zimbra/backup/scripts/mailboxsize2.sh
4. As a zimbra user run the following script :
# su - zimbra
$ /opt/zimbra/backup/scripts/mailboxsize2.sh

Sample output im MB:

admin@ehowstuff.local 0Mb 0Mb (active account)
galsync.vtfk6uwt@ehowstuff.local 0Mb 0Mb (active account)
ham.ypxiyleoyj@ehowstuff.local 0Mb 0Mb (active account)
spam.wc5ohhoylp@ehowstuff.local 0Mb 0Mb (active account)
user1@ehowstuff.local 0Mb 0Mb (active account)
user2@ehowstuff.local 0Mb 0Mb (active account)
virus-quarantine.kl6ejsnmd@ehowstuff.local 0Mb 0Mb (active account)

How to Show Mailbox Size on Zimbra via Command Line

Q. How to show user mailbox size on zimbra via command line ?

A. please issue the following command to show only the mailbox size on zimbra.

1. Display all users :

$ zmprov gqu `zmhostname`|awk {'print " "$3" "$2" "$1'}

Output :

 384289 0 user1@ehowstuff.local
 222445 0 admin@ehowstuff.local
 25568 0 user2@ehowstuff.local
 0 0 galsync.vtfk6uwt@ehowstuff.local
 0 0 ham.ypxiyleoyj@ehowstuff.local
 0 0 spam.wc5ohhoylp@ehowstuff.local
 0 0 virus-quarantine.kl6ejsnmd@ehowstuff.local

2. To find the mailbox size for user1@ehowstuff.local :

$ zmmailbox -z -m user1@ehowstuff.local gms

Output :

375.28 KB