LINUX.ORG.RU
ФорумAdmin

Fedora server 22 настройка lamp

 , ,


0

1

добрый день. на основной тачке стоит вин 8.1. в ней поставлен виртуалбокс с федорой сервер, на котором хочу запустить LAMP. сеть в виртулбоксе поставлено на «мост»(т.е. я так понимаю, сервер у меня получает IP от роутера). поставил сервер и обновил его. Затем решился на установку apache и php. вот тут и начинаются танцы. поставил то поставил, а из браузера винды не могу лицезреть тестовую страничку апача. Локально через w3m, apache показывает свою страничку. видимо проблема с подключение из вне. Люди добрые, помогите кто чем может, как с этой напастью то справиться ?

привожу

[root@localhost ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.104  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::a00:27ff:fe2c:ecb1  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:2c:ec:b1  txqueuelen 1000  (Ethernet)
        RX packets 132183  bytes 176277361 (168.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 51319  bytes 4561817 (4.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 46  bytes 13677 (13.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 46  bytes 13677 (13.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# lsof -i :80
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd   8204   root    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
httpd   8205 apache    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
httpd   8206 apache    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
httpd   8207 apache    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
httpd   8208 apache    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
httpd   8209 apache    3u  IPv4  76399      0t0  TCP *:http (LISTEN)
[root@localhost ~]#


[root@localhost ~]# netstat -anp | grep -i listen
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      8204/httpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3733/sshd
tcp6       0      0 :::9090                 :::*                    LISTEN      1/systemd
tcp6       0      0 :::22                   :::*                    LISTEN      3733/sshd
unix  2      [ ACC ]     STREAM     LISTENING     27922    1/systemd            /run/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     16662    584/gssproxy         /run/gssproxy.sock
unix  2      [ ACC ]     SEQPACKET  LISTENING     27950    1/systemd            /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     17210    632/mcelog           /var/run/mcelog-client
unix  2      [ ACC ]     STREAM     LISTENING     24660    1477/systemd         /run/user/0/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     13145    1/systemd            /run/lvm/lvmetad.socket
unix  2      [ ACC ]     STREAM     LISTENING     16253    1/systemd            /run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     16264    1/systemd            /var/run/pcscd/pcscd.comm
unix  2      [ ACC ]     STREAM     LISTENING     47283    16466/abrtd          /var/run/abrt/abrt.socket
unix  2      [ ACC ]     STREAM     LISTENING     20179    1087/systemd         /run/user/1000/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     18388    714/NetworkManager   /var/run/NetworkManager/private
unix  2      [ ACC ]     STREAM     LISTENING     19687    714/NetworkManager   /var/run/NetworkManager/private-dhcp
unix  2      [ ACC ]     STREAM     LISTENING     16661    584/gssproxy         /var/lib/gssproxy/default.sock
unix  2      [ ACC ]     STREAM     LISTENING     8438     1/systemd            /run/systemd/journal/stdout
[root@localhost ~]#


Ответ на: комментарий от no-dashi
[root@localhost ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
INPUT_direct  all  --  0.0.0.0/0            0.0.0.0/0
INPUT_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
INPUT_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
DROP       all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_direct  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_IN_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_IN_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_OUT_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_OUT_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
DROP       all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
OUTPUT_direct  all  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)
target     prot opt source               destination
FWDI_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]
FWDI_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_OUT_ZONES (1 references)
target     prot opt source               destination
FWDO_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]
FWDO_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_direct (1 references)
target     prot opt source               destination

Chain FWDI_FedoraServer (2 references)
target     prot opt source               destination
FWDI_FedoraServer_log  all  --  0.0.0.0/0            0.0.0.0/0
FWDI_FedoraServer_deny  all  --  0.0.0.0/0            0.0.0.0/0
FWDI_FedoraServer_allow  all  --  0.0.0.0/0            0.0.0.0/0

Chain FWDI_FedoraServer_allow (1 references)
target     prot opt source               destination

Chain FWDI_FedoraServer_deny (1 references)
target     prot opt source               destination

Chain FWDI_FedoraServer_log (1 references)
target     prot opt source               destination

Chain FWDO_FedoraServer (2 references)
target     prot opt source               destination
FWDO_FedoraServer_log  all  --  0.0.0.0/0            0.0.0.0/0
FWDO_FedoraServer_deny  all  --  0.0.0.0/0            0.0.0.0/0
FWDO_FedoraServer_allow  all  --  0.0.0.0/0            0.0.0.0/0

Chain FWDO_FedoraServer_allow (1 references)
target     prot opt source               destination

Chain FWDO_FedoraServer_deny (1 references)
target     prot opt source               destination

Chain FWDO_FedoraServer_log (1 references)
target     prot opt source               destination

Chain INPUT_ZONES (1 references)
target     prot opt source               destination
IN_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]
IN_FedoraServer  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain INPUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain INPUT_direct (1 references)
target     prot opt source               destination

Chain IN_FedoraServer (2 references)
target     prot opt source               destination
IN_FedoraServer_log  all  --  0.0.0.0/0            0.0.0.0/0
IN_FedoraServer_deny  all  --  0.0.0.0/0            0.0.0.0/0
IN_FedoraServer_allow  all  --  0.0.0.0/0            0.0.0.0/0

Chain IN_FedoraServer_allow (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:9090 ctstate NEW
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22 ctstate NEW

Chain IN_FedoraServer_deny (1 references)
target     prot opt source               destination

Chain IN_FedoraServer_log (1 references)
target     prot opt source               destination

Chain OUTPUT_direct (1 references)
target     prot opt source               destination
[root@localhost ~]#
druidich
() автор топика
Ответ на: комментарий от no-dashi
[root@localhost ~]# iptables-save
# Generated by iptables-save v1.4.21 on Thu Jul  9 14:59:30 2015
*nat
:PREROUTING ACCEPT [233:19539]
:INPUT ACCEPT [1:104]
:OUTPUT ACCEPT [162:11613]
:POSTROUTING ACCEPT [162:11613]
:OUTPUT_direct - [0:0]
:POSTROUTING_ZONES - [0:0]
:POSTROUTING_ZONES_SOURCE - [0:0]
:POSTROUTING_direct - [0:0]
:POST_FedoraServer - [0:0]
:POST_FedoraServer_allow - [0:0]
:POST_FedoraServer_deny - [0:0]
:POST_FedoraServer_log - [0:0]
:PREROUTING_ZONES - [0:0]
:PREROUTING_ZONES_SOURCE - [0:0]
:PREROUTING_direct - [0:0]
:PRE_FedoraServer - [0:0]
:PRE_FedoraServer_allow - [0:0]
:PRE_FedoraServer_deny - [0:0]
:PRE_FedoraServer_log - [0:0]
-A PREROUTING -j PREROUTING_direct
-A PREROUTING -j PREROUTING_ZONES_SOURCE
-A PREROUTING -j PREROUTING_ZONES
-A OUTPUT -j OUTPUT_direct
-A POSTROUTING -j POSTROUTING_direct
-A POSTROUTING -j POSTROUTING_ZONES_SOURCE
-A POSTROUTING -j POSTROUTING_ZONES
-A POSTROUTING_ZONES -o enp0s3 -g POST_FedoraServer
-A POSTROUTING_ZONES -g POST_FedoraServer
-A POST_FedoraServer -j POST_FedoraServer_log
-A POST_FedoraServer -j POST_FedoraServer_deny
-A POST_FedoraServer -j POST_FedoraServer_allow
-A PREROUTING_ZONES -i enp0s3 -g PRE_FedoraServer
-A PREROUTING_ZONES -g PRE_FedoraServer
-A PRE_FedoraServer -j PRE_FedoraServer_log
-A PRE_FedoraServer -j PRE_FedoraServer_deny
-A PRE_FedoraServer -j PRE_FedoraServer_allow
COMMIT
# Completed on Thu Jul  9 14:59:30 2015
# Generated by iptables-save v1.4.21 on Thu Jul  9 14:59:30 2015
*mangle
:PREROUTING ACCEPT [11007:15892027]
:INPUT ACCEPT [11007:15892027]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [9611:942366]
:POSTROUTING ACCEPT [9611:942366]
:FORWARD_direct - [0:0]
:INPUT_direct - [0:0]
:OUTPUT_direct - [0:0]
:POSTROUTING_direct - [0:0]
:PREROUTING_ZONES - [0:0]
:PREROUTING_ZONES_SOURCE - [0:0]
:PREROUTING_direct - [0:0]
:PRE_FedoraServer - [0:0]
:PRE_FedoraServer_allow - [0:0]
:PRE_FedoraServer_deny - [0:0]
:PRE_FedoraServer_log - [0:0]
-A PREROUTING -j PREROUTING_direct
-A PREROUTING -j PREROUTING_ZONES_SOURCE
-A PREROUTING -j PREROUTING_ZONES
-A INPUT -j INPUT_direct
-A FORWARD -j FORWARD_direct
-A OUTPUT -j OUTPUT_direct
-A POSTROUTING -j POSTROUTING_direct
-A PREROUTING_ZONES -i enp0s3 -g PRE_FedoraServer
-A PREROUTING_ZONES -g PRE_FedoraServer
-A PRE_FedoraServer -j PRE_FedoraServer_log
-A PRE_FedoraServer -j PRE_FedoraServer_deny
-A PRE_FedoraServer -j PRE_FedoraServer_allow
COMMIT
# Completed on Thu Jul  9 14:59:30 2015
# Generated by iptables-save v1.4.21 on Thu Jul  9 14:59:30 2015
*security
:INPUT ACCEPT [10785:15872992]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [9626:944326]
:FORWARD_direct - [0:0]
:INPUT_direct - [0:0]
:OUTPUT_direct - [0:0]
-A INPUT -j INPUT_direct
-A FORWARD -j FORWARD_direct
-A OUTPUT -j OUTPUT_direct
COMMIT
# Completed on Thu Jul  9 14:59:30 2015
# Generated by iptables-save v1.4.21 on Thu Jul  9 14:59:30 2015
*raw
:PREROUTING ACCEPT [11017:15892427]
:OUTPUT ACCEPT [9626:944326]
:OUTPUT_direct - [0:0]
:PREROUTING_direct - [0:0]
-A PREROUTING -j PREROUTING_direct
-A OUTPUT -j OUTPUT_direct
COMMIT
# Completed on Thu Jul  9 14:59:30 2015
# Generated by iptables-save v1.4.21 on Thu Jul  9 14:59:30 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [9611:942366]
:FORWARD_IN_ZONES - [0:0]
:FORWARD_IN_ZONES_SOURCE - [0:0]
:FORWARD_OUT_ZONES - [0:0]
:FORWARD_OUT_ZONES_SOURCE - [0:0]
:FORWARD_direct - [0:0]
:FWDI_FedoraServer - [0:0]
:FWDI_FedoraServer_allow - [0:0]
:FWDI_FedoraServer_deny - [0:0]
:FWDI_FedoraServer_log - [0:0]
:FWDO_FedoraServer - [0:0]
:FWDO_FedoraServer_allow - [0:0]
:FWDO_FedoraServer_deny - [0:0]
:FWDO_FedoraServer_log - [0:0]
:INPUT_ZONES - [0:0]
:INPUT_ZONES_SOURCE - [0:0]
:INPUT_direct - [0:0]
:IN_FedoraServer - [0:0]
:IN_FedoraServer_allow - [0:0]
:IN_FedoraServer_deny - [0:0]
:IN_FedoraServer_log - [0:0]
:OUTPUT_direct - [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j INPUT_direct
-A INPUT -j INPUT_ZONES_SOURCE
-A INPUT -j INPUT_ZONES
-A INPUT -p icmp -j ACCEPT
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -j FORWARD_direct
-A FORWARD -j FORWARD_IN_ZONES_SOURCE
-A FORWARD -j FORWARD_IN_ZONES
-A FORWARD -j FORWARD_OUT_ZONES_SOURCE
-A FORWARD -j FORWARD_OUT_ZONES
-A FORWARD -p icmp -j ACCEPT
-A FORWARD -m conntrack --ctstate INVALID -j DROP
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A OUTPUT -j OUTPUT_direct
-A FORWARD_IN_ZONES -i enp0s3 -g FWDI_FedoraServer
-A FORWARD_IN_ZONES -g FWDI_FedoraServer
-A FORWARD_OUT_ZONES -o enp0s3 -g FWDO_FedoraServer
-A FORWARD_OUT_ZONES -g FWDO_FedoraServer
-A FWDI_FedoraServer -j FWDI_FedoraServer_log
-A FWDI_FedoraServer -j FWDI_FedoraServer_deny
-A FWDI_FedoraServer -j FWDI_FedoraServer_allow
-A FWDO_FedoraServer -j FWDO_FedoraServer_log
-A FWDO_FedoraServer -j FWDO_FedoraServer_deny
-A FWDO_FedoraServer -j FWDO_FedoraServer_allow
-A INPUT_ZONES -i enp0s3 -g IN_FedoraServer
-A INPUT_ZONES -g IN_FedoraServer
-A IN_FedoraServer -j IN_FedoraServer_log
-A IN_FedoraServer -j IN_FedoraServer_deny
-A IN_FedoraServer -j IN_FedoraServer_allow
-A IN_FedoraServer_allow -p tcp -m tcp --dport 9090 -m conntrack --ctstate NEW -j ACCEPT
-A IN_FedoraServer_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
COMMIT
# Completed on Thu Jul  9 14:59:30 2015
[root@localhost ~]#

druidich
() автор топика
Ответ на: комментарий от no-dashi

вот блин. а я уже обрадоваться успел :D ладненько. и на том спасибо. пойду покуривать мануалы

druidich
() автор топика
Ответ на: комментарий от druidich

http://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and...

Нужно открыть порт 80 и пробросить его на 80 порт в виртуальной машине. Не знаю, сможет ли виртуалбокс пробросить на 80 порт (для этго требуются права рута) - если нет, то пробросьте на локальный 8080 (или любой другой >1024)

vrutkovs ★★
()
Ответ на: комментарий от vrutkovs

Пробрасывать на хосте не надо - у него сетевой адаптер в бридже.

no-dashi ★★★★★
()
Последнее исправление: no-dashi (всего исправлений: 1)
Ответ на: комментарий от Deleted

спасибо вам, мил человек. так и думал что файервол не пускает )

druidich
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.