virtualny pc pomocou VirtualBox -> nastavil som mu pevnu adresu ..." /> virtualny pc pomocou VirtualBox -> nastavil som mu pevnu adresu 192.168.1.240 (je pristupny z intranetu) Nainstaloval som: apache2, php5, mysql-server, libapache2-mod-auth-mysql, php5-mysql, phpmyadmin. P..." /> virtualny pc pomocou VirtualBox -> nastavil som mu pevnu adresu 192.168.1.240 (je pristupny z intranetu)..." /> virtualny pc pomocou VirtualBox -> nastavil som mu pevnu adresu 192.168.1.240 (je pristupny z intranetu) Nainstaloval som: apache2, php5, mysql-server, libapache2-mod-auth-mysql, php5-mysql, phpmyadmin. P..." />

VirtualHost - nefunkcny scr na javascript

Sekcia: Aplikácie & Desktop 13.01.2011 | 16:07
triumf18   Návštevník
Problem: NEFUNGUJE SRC="..." NA JAVASCRIPT.
Tu je moj postu co som vsetko vykonal:
Ubuntu -> virtualny pc pomocou VirtualBox -> nastavil som mu pevnu adresu 192.168.1.240 (je pristupny z intranetu)
Nainstaloval som: apache2, php5, mysql-server, libapache2-mod-auth-mysql, php5-mysql, phpmyadmin. Pridal som mod_rewrite (sudo a2enmod rewrite). Nahral som si webstranky do /var/www/webtest/. Javascript mam v zlozke /var/www/webtest/javascript/. Do prehliadaca zadam http://localhost/webtest a vsetko ide ako ma. Vsetko je OK.
Dalej nastavim hosts: 127.0.0.1 localhost webtest (vsetko na tom virtualnom pc).
/etc/apache2/sites-available/default -> skopirujem cely <VirtualHost *:80>...</VirtualHost> a vlozim na koniec a editujem na:
ServerName webtest
DocumentRoot /var/www/webtest
Restart apache2
Upravim cesty v .htaccess na http://webtest/...(z http://localhost/webtest/...) a tiez konstantu, ktoru pouzivam na urcenie cesty tak isto ako .htaccess. Takze cesta k javascriptu je src="http://webtest/javascript/file.js".
Spustim firefox -> http://webtest -> stranka nabehne ale bez src javascriptov. Tie co su definovane v php funguju.
CO JE TREBA ESTE NASTAVIT?? KDE SOM SPRAVIL CHYBU?? PROSIM PORADTE.

Ak zmenim cestu k javascriptu na src="http://192.168.1.240/webtest/javascript/file.js" tak to funguje. Ma sa to definovat takto??? To asi nie?
Pozn. pouzivam absolutne cesty kvoli cool uri (robilo mi to problemy s relativnymi).
    • Re: VirtualHost - nefunkcny scr na javascript 13.01.2011 | 18:55
      Avatar Milan Dvorský debian,mint kde,android  Administrátor
      skus pozriet /var/log/apache2/error.log ... tam by ti vypisalo aj chybu (cesta alebo prava sa mu nepacia) ... najdes presne popisane ... skus nasledovne:

      nacitaj ten web a nasledne na to
      tail -n 30 /var/log/apache2/error.log
      a ten vypis tu pastni

      • Re: VirtualHost - nefunkcny scr na javascript 14.01.2011 | 09:11
        triumf18   Návštevník
        error.log

        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/jquery142.min.js, referer: http://webtest/
        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/thickbox.js, referer: http://webtest/
        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/stromove_menu.js, referer: http://webtest/
        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/jquery142.min.js, referer: http://webtest/
        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/thickbox.js, referer: http://webtest/
        [Fri Jan 14 08:04:47 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/stromove_menu.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/jquery142.min.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/thickbox.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/stromove_menu.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/jquery142.min.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/thickbox.js, referer: http://webtest/
        [Fri Jan 14 08:06:55 2011] [error] [client 127.0.0.1] File does not exist: /usr/share/javascript/stromove_menu.js, referer: http://webtest/

        Preco to hlada /usr/share/ web je ulozeny v /var/www/webtest/ ???
        • Re: VirtualHost - nefunkcny scr na javascript 14.01.2011 | 13:50
          Avatar Milan Dvorský debian,mint kde,android  Administrátor
          skus mu zadat cestu len takto:
          /javascript/file.js
          • Re: VirtualHost - nefunkcny scr na javascript 14.01.2011 | 14:00
            triumf18   Návštevník
            Nic to iste skusal som to hociako ale jedine co funguje je http://IP_ADRESA/webtest/javascript/file.js.
          • Re: VirtualHost - nefunkcny scr na javascript 14.01.2011 | 14:03
            triumf18   Návštevník
            Mam uplne cistu instalaciu + update, LAMP a natavenie hosts + /etc/apache2/sites-available/default. Nic ine som nerobil, nenastavoval. Takto to mam defaultne. Co s tym mam robit.
    • Re: VirtualHost - nefunkcny scr na javascript - VYRIESENE 15.01.2011 | 08:54
      triumf18   Návštevník
      Zdravim,

      pre vsetkych s tymto problemom. Riesenie je tu:
      http://www.warforum.cz/viewtopic.php?t=1156932