background preloader

Apache

Facebook Twitter

Open http port ( 80 ) in iptables on CentOS. Iptables firewall I was recently setting up a web server on centos with nginx and php.

Open http port ( 80 ) in iptables on CentOS

The installation of nginx was fine, but the http port of the system was not accessible from outside. This is because centOS by default has some iptables firewall rules in effect. Only the ssh port (22) was accessible and remote shell worked. So its necessary to open up port 80 for webserver like nginx to work. Iptables is the firewall on linux that can be configured to accept or reject network traffic based on various kinds of packet level rulesets. Iptables rules There are 2 ways to configure iptables to open up port 80. As can be seen in the output, there is a REJECT line in the INPUT chain at the end that says, reject all. Open port 80 To accept http connections we need to add a rule at line number 5 and push the REJECT line below. . # iptables -I INPUT 5 -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT The new rules are saved to the file /etc/sysconfig/iptables. Linux: Find Out Which Process Is Listening Upon a Port.

How do I find out running processes were associated with each open port?

Linux: Find Out Which Process Is Listening Upon a Port

How do I find out what process has open tcp port 111 or udp port 7000 under Linux? You can the following programs to find out about port numbers and its associated process: netstat – a command-line tool that displays network connections, routing tables, and a number of network interface statistics.fuser – a command line tool to identify processes using files or sockets.lsof – a command line tool to list open files under Linux / UNIX to report a list of all open files and the processes that opened them. /proc/$pid/ file system – Under Linux /proc includes a directory for each running process (including kernel processes) at /proc/PID, containing information about that process, notably including the processes name that opened port. You must run above command(s) as the root user. netstat example Type the following command: # netstat -tulpn Sample outputs: TCP port 3306 was opened by mysqld process having PID # 1138.

Where, Howto: Linux Add User To Group. How can I add a user to a group under Linux operating system using command line options? How to add an existing user into a group in Linux using command line options? You can use the useradd or usermod commands to add a user to a group. The useradd command creates a new user or update default new user information. The usermod command modifies a user account and it is useful to add user to existing groups. There are two types of groups under Linux operating systems: Primary user group.Secondary or supplementary user group.

All user account related information are stored in the following files: /etc/passwd – Contains one line for each user account. useradd Example – Add a new user to secondary group You need to the useradd command to add new users to existing group (or create a new group and then add user). Developers:x:1124: uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers) Please note that capital G (-G) option add user to a list of supplementary groups. See also. How to install Apache Server on CentOS RedHat Linux, How to configure Apacahe Server on CentOS RedHat Linux.