nasao sam nekoliko tutorijala na internetu kako da postavim vistualost na localnoj masini i uglavnom su iste ili jako slicne.
moj plan je u stvari da napravim virtualni host za svaki projekt koji radim na svom laptopu. tako da umjesto http://localhost/afan.net koristim http://dev.afan.net i kad je sve gotovo jednostavno prebacim na (pravi) server. koristim Ubuntu 8.04
evo kako sam uradio:
u /home/pasalica/www/ sam kreirao directorij dev.afan.net
promijenio “vlasnistvo”: shown -R www-data:www-data dev.afan.net (ne znam da li je to nephodno ili ne, ali nisam primjetio da mi je to proizvelo grasku?)
u /etc/host (bio je totalno prazan) sam dodao liniju
u /etc/apache2/site-available sam naravio kopiju od vec postojeceg default u dev.afan.net.conf. default izgleda ovako:
Restarting web server apache2 apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 12 07:35:13 2009] [warn] NameVirtualHost *:0 has no VirtualHosts
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Jun 12 07:35:23 2009] [warn] NameVirtualHost *:0 has no VirtualHosts
[ OK ]
pasalica@Ubuntu3325:/etc/apache2/sites-enabled$[/code]
pokusao sam odgonetnuti ovu gresku ali ne ide.
Restarting web server apache2
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
[ OK ]
pasalica@Ubuntu3325:/etc/apache2/sites-available$[/code]
pokusao sam i sa promijenom u /etc/apache2/httpd.conf, umjeto localhost da stavim dev.afan.net ali opet nista. localhost i dalje radi a “development” ne radi
Prvo, naveo si /etc/host a treba /etc/hosts
Drugo, dobro pogledaj da li je na Ubuntu Linux localhost postavljen 127.0.0.1 ili 127.0.1.1
(sve savrseno legalno, 127.0.0.0/8 )
[quote=adis]Prvo, naveo si /etc/host a treba /etc/hosts
Drugo, dobro pogledaj da li je na Ubuntu Linux localhost postavljen 127.0.0.1 ili 127.0.1.1
(sve savrseno legalno, 127.0.0.0/8 )
:wq[/quote]
do mene, do mene, do mene…!!!
da, ja sam ubacio navedenu liniju u /etc/host
/etc/hosts
The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts[/code]
restartov’o sam apache i sada http://dev.afan.net m idaje isto sto i http://localhost - sto je pogesno?!?
u stvari ima razlike:
kada otvorim http://localhost dobijem ovaj record u access.log
127.0.0.1 - - [12/Jun/2009:14:43:55 -0500] “GET / HTTP/1.1” 304 - “-” “Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10”
a kada otvorim http://dev.afan.,net dobijem
127.0.0.1 - - [12/Jun/2009:14:44:01 -0500] “GET /index.html HTTP/1.1” 304 - “-” “Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10) Gecko/2009042513 Ubuntu/8.04 (hardy) Firefox/3.0.10”
Hajde samo ono iz pocetnog post-a pod br. 5 ubaci u /etc/apache2/sites-available/dev.afan.net , zatim a2ensite dev.afan.net i /etc/init.d/apache2 restart