multiples webs - apache server Vas a fer canvis a una màquina virtual. Si ja la tens importada, i has fet una snapshot (punt de recuperació) passa directament al pas 5)
descàrrega, importa la vm i engega-la
ubuntu_server_ova
accedim a la vm a través d'una connexió ssh gràcies al port forwarding
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
!!! a la màquina física
ssh -p 40022 alumne01@127.0.0.1
comprova que te connectivitat
ping -c 3 8.8.8.8
ping -c 3 google.com
atura la vm i crea una snapshot per poder tornar al punt de partida
instal·la apache i unzip (doncs el necessitarem més tard)
sudo apt update
sudo apt install apache2 unzip
descarrega la web d'exemple
wget -O /tmp/example-site.zip https://s3.eu-west-2.amazonaws.com/tiiny.host/example-site.zip
consulta quines webs estan disponibles
deshabilita la web per defecte
sudo a2dissite 000-default.conf
prepara el fitxer de configuració de la nova web
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/001-primeraweb.edu.conf
modifica el contingut del nou fitxer, indicant ( i descomentant ) el ServerName ( què posarem al navegador per accedir a la web ) i el DomumentRoot ( el lloc/directori/carpeta on copiaràs el contingut de la web: index.html & friends )
sudo vi /etc/apache2/sites-available/001-primeraweb.edu.conf
crea la nova carpeta a /var/www
sudo mkdir /var/www/primeraweb.edu
habilita la nova web
sudo a2ensite 001-primeraweb.edu.conf
comprova que estigui habilitada
descomprimeix el contingut de la web al nou directori
sudo unzip -d /var/www/primeraweb.edu /tmp/example-site.zip
per a la resolució de noms ens caldrà al menys fer-ho de manera estàtica (sic)
grep primeraweb /etc/hosts || (echo "127.0.0.1 www.primeraweb.edu" | sudo tee -a /etc/hosts)
reinicia l'apache
sudo systemctl reload apache2.service
comprova que funciona a la vm
curl 127.0.0.1
curl www.primeraweb.edu
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
accés des de la teva màquina física a través del port forwarding de virtualbox
per accedir per nom des d'un navegador ens caldrà muntar un proxy
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
a la màquina física
ssh -N -f -D 39999 -p 40022 alumne01@127.0.0.1
accés amb diferents navegadors (prova amb chrome millor)
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
a windows has de posar la "ruta" completa a l'executable.
a) Brave (realitza la resolució en el proxy)
brave-browser --proxy-server="socks5://127.0.0.1:39999"
b) Chromium també
chromium-browser --proxy-server="socks5://127.0.0.1:39999"
c) … i Chrome, quan no està gestionat ( managed ) també
google-chrome --user-data-dir=/tmp --proxy-server="socks5://127.0.0.1:39999"
c.win) chrome a windows …
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
tanca qualsevol altra finestra de chrome
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
verifica que la "ruta" c:\ … és la correcta: si cal comprova-ho a les propietats de la icona de chrome.
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --proxy-server="socks5://127.0.0.1:39999"
d) firefox (gràficament)
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
configurar un proxy socks5 amb ip 127.0.0.1 i port 39999 i que faci resolució de noms al proxy (casella de selecció #2 del final del diàleg del proxy)
ara ja pots posar al navegador
http://www.primeraweb.edu
Alternativa gràfica
Image Not Showing
Possible Reasons
The image file may be corrupted The server hosting the image is unavailable The image path is incorrect The image format is not supported
Learn More →
… després de completar el pas 17
instal·la un entorn GUI a la VM i el firefox
sudo apt install gnome-session gnome-terminal firefox
reinicia la màquina virtual i des del firefox accedeix a
http://www.primeraweb.edu
referències Tot l'article està bé però te porte directe al reenviament dinàmic