Ich versuche, meine Website auf einem einzelnen Server mit centos7.1 zu hosten. Ich kann Virtualhost auf Port, 80
aber wenn ich Port von dort ändere second-site
, zeigt 8080
es auf first-site
. Für URL http://62.210.xx.xx:8080/
funktioniert es jedoch korrekt und zeigt auf second-site
.
Ich mache das so:
httpd.conf
Listen 80
Listen 8080
also tried
Listen 0.0.0.0:80
Listen 0.0.0.0:8080
but same
commented out for apache 2.4
#NameVirtualHost 62.210.xx.xx:80
#NameVirtualHost 62.210.xx.xx:8080
ServerAdmin root@localhost
#first-site.com
<VirtualHost 62.210.xx.xx:80>
ServerName first-site.com
ServerAlias www.first-site.com
DocumentRoot /var/www/first-site
</VirtualHost>
#second-site.com
<VirtualHost 62.210.xx.xx:8080>
ServerName second-site.com
ServerAlias www.second-site.com
DocumentRoot /var/www/second-site
</VirtualHost>
netstat -tulpn | grep httpd
tcp6 0 0 :::80 :::* LISTEN 25253/httpd
tcp6 0 0 :::8080 :::* LISTEN 25253/httpd
/etc/host/
62.210.xx.xx www.first-site.com first-site.com www.second-site.com second-site.com
/usr/sbin/httpd -t
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/httpd.conf:46
Syntax OK
Aktualisieren
apachectl -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name,
using 62.210.xx.xx. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
62.210.xx.xx:8080 m.second-site.com (/etc/httpd/conf/httpd.conf:427)
62.210.xx.xx:80 is a NameVirtualHost
default server first-site.com (/etc/httpd/conf/httpd.conf:363)
port 80 namevhost first-site.com (/etc/httpd/conf/httpd.conf:363)
alias www.first-site.com
port 80 namevhost image.first-site.com (/etc/httpd/conf/httpd.conf:3 77)
port 80 namevhost m.first-site.com (/etc/httpd/conf/httpd.conf:389)
port 80 namevhost second-site.com (/etc/httpd/conf/httpd.conf:401)
alias www.second-site.com
port 80 namevhost image.second-site.com (/etc/httpd/conf/httpd.conf:415)
port 80 namevhost third-site.com (/etc/httpd/conf/httpd.conf:439)
alias www.third-site.com
port 80 namevhost image.third-site.com (/etc/httpd/conf/httpd.conf:453)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex fcgid-pipe: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex fcgid-proctbl: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="xxxxxxx" id=1000
Group: name="root" id=0
it points to first virtual host
In Ihrem ursprünglichen Beitrag ... zeigt es also auf den ersten virtuellen Host, wenn Sie www.second-site.com ausprobieren? Haben Sie eine Firewall, die einige Ports blockieren könnte?
nc -zv 62.210.xx.xx 8080
?
62.210.xx.xx:8080
und 62.210.xx.xx:80
zu *:8080
und ändern *:80
. Auch nc
kann netstat
. Es gibt verschiedene Netstat. Installieren Sie eine und versuchen Sie, den Port zu öffnen.
62.210.xx.xx:8080
Adresse direkt versuchen ?