Yuav ua li cas teeb tsa ib qho Apache virtual host ntawm Debian

Peb txuas ntxiv ua si nrog Debian ntawm peb cov xeem neeg rau zaub mov, niaj hnub no peb tau nthuav tawm nrog qhov yuav tsum tau tsim lub Virtual Host, yog li nrog kev pab ntawm tsev kawm ntawv qhia Kuv tau tsim ib kauj ruam dhau los txhim kho Apache virtual hosts hauv Debian.

Nruab apache

sudo apt-get update
sudo apt-get install apache2

Tsim cov ntaub ntawv virtual tshiab

Rub tawm peb xeem virtual.conf ntawv los ntawm ntawm noCov. Tom qab ntawd peb yuav tsum luam cov ntawv virtual.conf rau lub nplaub tshev /etc/apache2/sites-available/ rau cov sau npe tshiab.

cp virtual.conf /etc/apache2/sites-available/

Yog tias yuav tsum tau, peb tuaj yeem hloov lub npe cov ntawv. (Rau kev sim peb yuav siv lub npe: virtual )

Tom ntej no peb yuav tsum hloov cov teb nram qab no ServerName, ServerAdmin, DocumentRoot

Pab kom cov ntaub ntawv Virtual hom tshiab:

a2ensite virtual.conf

Rov qab Apache:

service apache2 restart

Configurar el archivo de hosts local

Qhib cov ntawv hosts rau nws hom nano /etc/hosts

Ntxiv tus IP tshiab ntawm koj cov neeg rau zaub mov rau hauv qab ntawm cov ntaub ntawv yog localhost.

Nws yuav yog ib yam zoo li no:

127.0.0.1 localhost 127.0.0.10 wp 127.0.0.11 yii # Cov kab hauv qab no tsim nyog rau IPv6 muaj peev xwm ua :: :: 1 localhost ip6-localhost ip6-loopback ff02 :: 1 ip6-allnodes ff02 :: 2 ip6-allrouters

Nrog rau qhov no, Virtual Host hauv Debian yuav tau teeb tsa zoo


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

5 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm. Yuav tsum tau teb cov cim nrog *

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   3 said

    Nyob zoo, sawv ntxov zoo

    Thov, Kuv nug koj txog kev qhia uas koj piav qhia li cas los ntawm Is Taws Nem (txhua qhov hauv ntiaj teb) koj tuaj yeem nkag mus rau cov nplooj ntawv ntawm tus tswv tsev virtual tsis tau siv cov kev pabcuam thib peb?

  2.   Yog li-thiab-yog li ntawd said

    Lub virtual.conf txuas tsis ua haujlwm.

  3.   Johan Esteban said

    Qhov nyeem tsis tiav 0/10

  4.   fjmadrid said

    nyob zoo,
    cov ntaub ntawv virtual.conf tsis tuaj yeem rub tawm. Thov hloov cov ntawv txuas.
    Ua tsaug rau koj.

  5.   Ekatz said

    Tsis tuaj yeem nkag tau muab tshuaj txhuam los ntawm virtual.conf. Ntawm chav kawm, tshaj tawm, ib daim pam ...