In CentOS Linux, start and stop tomcat and check the shell script and centostomcat logs.
Tomcat installation directory of CentOS:/usr/local/tomcat
Vi MyTomcatUitl. sh create a fileChmod u + x MyTomcatUtil. sh grant execution permissionShell script:
1 #! /Bin/bash 2 3 # Start and Stop tomcat. The log shows script 4 5
as the root user (the-e parameter indicates executing an SQL command), meaning: assign all permissions for all tables in all databases to the root user at all IP addresses. If you only want to access the root user on the host 192.168.1.108, run the following command:
Mysql-uroot-ppassok-e "grant all privileges on *. * TO 'root' @ '192. 168.1.108 'identified by 'passok' with grant option ;"
2. configure the firewall to open port 3306
The
Painstakingly compiled installation finished ngnix,mysql, PHP, after the discovery can not access, later found that the firewall to the 80 port to disable. Open: (The following reference from: http://llhdf.javaeye.com/blog/526176)#/sbin/iptables-i input-p TCP--dport 80-j accept#/sbin/iptables-i input-p tcp--dport 22-j ACCEPT Then Save: #/etc/rc.d/init.d/iptables save again to see if it already has: [[emailprotected] ~]#/etc/ Init.d/iptables Statustab
It is necessary to configure the iptables firewall in CentOS. Let's learn how to configure it!
Set the firewall in Linux. Take CentOS as an example to open the iptables configuration file:
Vi/etc/sysconfig/iptablesRun the/etc/init. d/iptables status Command to check whether port 80 is enabled. If port 80 is not enabled
To enable port 80 access in CentOS firewall settings, we add port 80 as an example: [root @ centoshttpd] #/sbin/iptables-IINPUT-ptcp -- the dport80-jACCEPT saves [root @ centoshttpd] #/etc/rc. d/init. d/iptablessaveiptables: set
Enable port 80 access in CentOS firewall settings
The following is an example of adding por
Tags: selinux firewalldRed Hat Enterprise Linux 7 shuts down firewall and SELinuxFirst, close the firewall1. View the firewall status first[Email protected] ~]#systemctl status Firewalldfirewalld.service-firewalld-dynamic Firewall daemonLoaded:loaded (/usr/lib/systemd/system/firewalld.service; enabled)Active:active (ru
CentOS 7.0 defaults to using firewall as the firewall, where the iptables firewall is changed. 1. Close firewall: systemctl Stop Firewalld.service #停止firewall systemctl Disable Firewal
CentOS Start and stop service detailed
Service Introduction
Linux system services are system tasks that are automatically loaded when Linux is started and are automatically stopped when Linux exits. In the Linux boot process, we can see a lot of "starting ... "The message indicates that the system service is starting, and when Linux exits, we can see the corresponding" stopping ... "Information indicating
30 things to be done after minimal RHEL/CentOS 7 installation (3)30 things to be done after minimal RHEL/CentOS 7 installation (3) 12. install Apache Tomcat
Tomcat is a servlet container designed by Apache to run Java HTTP web servers. Install tomcat as follows, but note that Java must be installed before tomcat is ins
1. Install iptables FirewallHow do you know if the system has Iptables installed? Perform iptables-v, if shown as:Iptables v1.3.5Indicates that Iptables has been installed.If you do not install iptables you need to install it first, execute:Yum Install IptablesTo set up a firewall in Linux, for example CentOS, open the iptables configuration file:Vi/etc/sysconfig/iptablesThe/etc/init.d/iptables status comma
Set the firewall in Linux. take CentOS as an example to open the iptables configuration file: vi/etc/sysconfig/iptables through/etc/init. d/iptablesstatus command to check whether port 80 is enabled. If no port 80 is enabled, you can use either of the following methods: Method 1: 1. modify the vi/etc/sysconfig/iptables command to add a firewall for fire preventio
The author in order to configure the firewall, look for iptables service must not, until a moment! Only found that I use centos7 , and this version of the firewall, the default is to use the firewall, and the previous version of the use of iptables is not the same, this is important!So if you want to configure the firewall
When the ORACLE database was recently installed under CentOS Linux, it was shown that the EM installation failed because of the network port, so it was intended to shut down the firewall first.
It's nice to see the configuration instructions for the firewall. Perform the "Setup" command to start the text mode configuration Utility, select "
has been used in CentOS 6 habit, a bit did not adapt to come over. Firewall configuration after performing service iptables save appears "Failed to restart Iptables.service:Unit iptables.service Failed to load:no such file or Directory. " Error, the firewall is managed by FIREWALLD in CentOS
start Firewalld.serviceStop: Systemctl Stop Firewalld.serviceDisable self-booting: Systemctl Disable Firewalld.serviceView current detailed status: Systemctl status Firewalld.serviceDisplay Status: Firewall-cmd--stateOpen port: Firewall-cmd--zone=public--add-port=80/tcp--permanent(--permanent parameter means permanent, otherwise it will expire after reboot)Delet
Original Linux-CentOS 7.0, enable Iptables firewallCentOS 7.0 defaults to using firewall as the firewall, where the iptables firewall is changed.1. Close firewall:Systemctl Stop Firewalld.service #停止firewallSystemctl Disable Firewalld.service #禁止
Open a specific port (iptables) to the CentOS Firewall)Iptables is the firewall and service name in linux.Service iptables status view Firewall status service iptables start Enable Firewall service iptables stop disable
Check whether port 80 of the server is blocked by the firewall. Run the following command:Telnet server_ip 80To test.
1>. The solution is as follows: View Source
Print?
1
/Sbin/iptables-I input-P TCP -- dport 80-J accept
2>. Then save: View Source
Print?
1
/Etc/rc. d/init
want the root user on top of the 192.168.1.108 machine to access, the command is as follows:Mysql-uroot-ppassok-e "GRANT all privileges on * * to ' root ' @ ' 192.168.1.108 ' identified by ' Passok ' with GRANT OPTION;"2 Configuring the firewall to release the 3306 port limitThe CentOS 7.0 version of the firewall, the default is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.