how setup permanently iptables so not needed give this command every time start Server

General support questions
Post Reply
lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

how setup permanently iptables so not needed give this command every time start Server

Post by lse123new » 2018/04/14 06:53:37

I SETUP IN VM
Cent OS 7.4 httpd only CLI(server), and No desktop graphical env
this
http://192.168.9.137/ (ip of server) in browser outside VM - host machine mbp 2016 15"

work only if give to server the command // and show what input index.php with phoinfo();

iptables -F

what this iptables -F means
and how setup permanently iptables so not needed give this command every time start Server? give urls

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: how setup permanently iptables so not needed give this command every time start Server

Post by lse123new » 2018/04/14 07:02:34

Also I applied Virtual hosts and working
can you tell why getting RED BELOW... ?

[root@exam ~]# iptables -F
[root@exam ~]# apachectl configtest
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:42
Syntax OK
[root@exam ~]# vim /etc/httpd/conf/httpd.conf
[root@exam ~]#

/etc/httpd/conf/httpd.conf
...
NameVirtualHost *:80
NameVirtualHost *:443

Listen 192.168.9.137:80
#Listen 80
...

lse123new
Posts: 66
Joined: 2014/05/01 15:48:05

Re: how setup permanently iptables so not needed give this command every time start Server

Post by lse123new » 2018/04/14 08:07:55

[root@exam ~]# yum install netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.coreix.net
* epel: ftp.rediris.es
* extras: mirrors.coreix.net
* updates: mirrors.coreix.net
No package netstat available.
Error: Nothing to do
[root@exam ~]#

// how install netstat command???? SOLUTION:
yum whatprovides netstat
yum -y install net-tools
Please reply above Not this thread

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: how setup permanently iptables so not needed give this command every time start Server

Post by hunter86_bg » 2018/04/14 11:22:52

Here is an example from apache's documentation (CentOS has an offline version with the 'httpd-manual' package):

Code: Select all

<VirtualHost *:80>
    DocumentRoot "/var/www/html/example1"
    ServerName www.myserver1.com
</VirtualHost>

tunk
Posts: 1206
Joined: 2017/02/22 15:08:17

Re: how setup permanently iptables so not needed give this command every time start Server

Post by tunk » 2018/04/14 11:46:46

CentOS 7 comes with firewalld as default. If you want to use iptables:
https://www.digitalocean.com/community/ ... n-centos-7

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how setup permanently iptables so not needed give this command every time start Server

Post by TrevorH » 2018/04/14 12:07:16

iptables -F flushes all iptables rules and deletes them, thus removing your firewall protection and leaving your VM wide open to anyone that wants to hack it. Not a good plan. That's like removing the front door to your house because you don't have a spare key to lend to your weekend house guest.

What you really want to do is learn how to use the firewall and add rules to it to allow the traffic you want. If using firewalld - the default on CentOS 7 - then you need to read man firewall-cmd to learn how to add/amend firewall rules. If using plain ordinary iptables - the other alternative - the you need to read up on how to add/amend rules with that too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply