View previous topic :: View next topic |
Author |
Message |
root_tux_linux l33t
Joined: 21 Dec 2003 Posts: 966
|
Posted: Tue May 10, 2011 2:21 pm Post subject: Apache zickt mit virtuellen IP's |
|
|
Hallo meine lieben Liebenden.
Folgendes Problem:
Ubuntu Server (Jaja, evil!) mit Apache und zwei IP's.
Da der Server nur eine Netzwerkkarte besitzt hab ich eth0:1 (VLAN) eingerichtet, das ganze wollte ich dann auch verwenden mit VirtualHosts in Apache.
Mein Problem ist nun, sobald der VirtualHost mit der IP von eth0:1 online geht eth0 nicht mehr erreichbar ist.
Kann mir jemand sagen wo der Fehler liegt?
Die Konfigs sehen wie folgt aus:
Code: |
(root@W166)-(~) $ cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:1
iface eth0:1 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.1
|
Code: |
(root@W166)-(~) $ cat /etc/apache2/ports.conf
NameVirtualHost 192.168.1.2:80
NameVirtualHost 192.168.1.3:80
#Listen 80
<IfModule mod_ssl.c>
NameVirtualHost 192.168.1.2:443
# Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
|
Code: |
(root@W166)-(~) $ cat /etc/apache2/sites-available/html
<VirtualHost 192.168.1.2:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
(root@W166)-(~) $
|
Code: |
(root@W166)-(~) $ cat /etc/apache2/sites-available/ssl
<IfModule mod_ssl.c>
<VirtualHost 192.168.1.2:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/ssl
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/ssl_access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package.
#SSLCertificateFile /etc/apache2/ssl/cert/apache.pem
#SSLCertificateKeyFile /etc/apache2/ssl/private/privkey.pem
SSLCertificateFile /etc/apache2/ssl/NP-Cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/NP-Key.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
</IfModule>
|
Code: |
(root@W166)-(~) $ cat /etc/apache2/sites-available/vlan
<VirtualHost 192.168.1.3:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vlan
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
_________________ Intel Core i7 6700K@4.6GHz, Gigabyte GTX 980 Ti G1, Gigabyte Gaming 7, Hyper X Fury 32GB, 2 TB Samsung EVO 840 Basic
ASUS ROG Swift PG348Q Display
ASUS ROG ASUS G771JW Notebook |
|
Back to top |
|
|
Max Steel Advocate
Joined: 12 Feb 2007 Posts: 2272 Location: My own world! I and Gentoo!
|
Posted: Tue May 10, 2011 2:55 pm Post subject: |
|
|
Wenn du vlan verwenden willst musst du konsequent sein und auch deine eth0 IP in eine eth0:0 IP "umwandeln".
Und da das ganze dann intern wie 2 unterschiedliche Netzwerkkarten hantiert werden, solltest du diese beiden Devices (eth0:0 und eth0:1) in unterschiedliche Subnetze packen.
Ich glaube sogar das dein Switch VLAN Unterstützen muss... aber ich kann nicht bestimmt sagen ob das so richtig ist. _________________ mfg
Steel
___________________
Heim-PC: AMD Ryzen 5950X, 64GB RAM, GTX 1080
Laptop: Intel Core i5-4300U, 16GB RAM, Intel Graphic
Arbeit-PC: Intel i5-1145G7, 16GB RAM, Intel Iris Xe Graphic (leider WSL2) |
|
Back to top |
|
|
root_tux_linux l33t
Joined: 21 Dec 2003 Posts: 966
|
Posted: Tue May 10, 2011 9:12 pm Post subject: |
|
|
Also ich hab das ganze jetzt in Virtualbox nochmals gebaut.
Seltsamer weise funktioniert das ganze 1A in Virtualbox mit Ubuntu 11.04.
Auf dem Server mit Debian funzt das ganze nicht.
oO _________________ Intel Core i7 6700K@4.6GHz, Gigabyte GTX 980 Ti G1, Gigabyte Gaming 7, Hyper X Fury 32GB, 2 TB Samsung EVO 840 Basic
ASUS ROG Swift PG348Q Display
ASUS ROG ASUS G771JW Notebook |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|