Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: Apache2 a problem s virtual host  (Přečteno 2801 krát)

rado3105

  • Návštěvník
  • Příspěvků: 72
Apache2 a problem s virtual host
« kdy: 21 Května 2009, 21:07:18 »
Dobry pokusam sa nainstalovat munin(monitorovaci RRD based program). Potrebujem aby bezal ako virtualny host v apachi.

Pouzil som tento navod:

http://www.debuntu.org/how-to-monitoring-a-server-with-munin-p2

Server je na lokalnej sieti a ma ip addresu: 192.168.76.4, pristupujem nan z ip: 192.168.76.9.

Vytvoril som: /etc/apache2/sites-available/monitoring a toto je vo vnutri:

Citace
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName      monitoring.example.com
        DocumentRoot /var/www/munin
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
        LogLevel notice
        CustomLog /var/log/apache2/access.log combined
        ErrorLog /var/log/apache2/error.log
        ServerSignature On
</VirtualHost>

nainstaloval som to :

sudo a2ensite monitoring


Toto mi pise pri kontrole pomocou: sudo apache2ctl -t:

Citace
r-c@rclr-srv:~$ sudo apache2ctl -t
apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.76.4 for ServerName
[Thu May 21 20:23:05 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
Syntax OK
moj /etc/apache2/apache2.conf
Citace
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
DefaultType text/plain
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel warn
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combin$
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ServerTokens Full
ServerSignature On
Include /etc/apache2/conf.d/
Include /etc/apache2/sites-enabled/



stderr

  • Aktivní člen
  • *
  • Příspěvků: 275
  • globglob, Charliee, we're scuba diving Charlieee!
Re: Apache2 a problem s virtual host
« Odpověď #1 kdy: 21 Května 2009, 21:57:04 »
v tomto případě bych to neřešil přes VirtualHosta (není doména, podle které by se VitualHost mohl řidit), ale aliasem..mimojiné zabere míň místa :-)

ScriptAlias /munin/cgi/ /var/www/munin/cgi/
Alias /munin/ /var/www/munin/
Alias /munin  /var/www/munin/

pak můžeš přistupovat přes http://192.168.76.4/munin/
Fedora & CentOS (RHEL) user ... co tu vlastně dělám?
Blog /dev/stderr & twitr

 

Provoz zaštiťuje spolek OpenAlt.