Hosting yog ib qho cuab yeej uas tso cai rau koj ua tus tswv lag luam hauv Is Taws Nem ntawm tus neeg rau zaub mov raws software. Hauv tsab xov xwm no, peb yuav qhia koj yuav ua li cas los tsim lub virtual host ntawm koj lub local server tsim nrog Denver lossis WampServer, nrog lub peev xwm los ua kom nws tiag tiag rau yav tom ntej. Thaum xub thawj siab ib muag, qhov kev piav qhia ntawm kev tsim lub virtual host yuav zoo li nyuaj, tab sis hauv kev muaj tiag nws yuav tsum tsis yooj yim rau cov neeg siv - nco ntsoov tias txhua kauj ruam los tsim tus tswv tsev yooj yim li sai tau.
Cov Lus Qhia
Kauj ruam 1
Hloov kho cov hosts ua file (C: / WINDOWS / system32 / drivers / etc / hosts) - ntxiv rau koj cov npe muaj siv kab ntawv hauv qab no:
127.0.0.1 lub npe ntawm koj lub npe lossis subdomain yam uas tsis muaj thaj chaw ua cim npe (ru, com, org thiab lwm tus).
Kauj ruam 2
Tom qab ntawd, hauv tshooj Virtual Hosts, uas koj yuav pom hauv cov ntaub ntawv tshwj xeeb teeb tsa httpd.conf, ntxiv cov kab hauv qab no:
DocumentRoot "Txoj kev mus rau koj lub xaib"
ServerName koj lub npe sau (piv txwv li mysite)
Cov nkag no yog lub thawv virtual host. Yog tias koj cov neeg rau zaub mov tau teeb tsa siv XAMPP, tsis tas siv Denver thiab WampServer, txoj haujlwm yuav hloov me ntsis - sau lub thawv ntim nkag rau hauv httpd-vhosts.conf. Kev hloov kho httpd.conf tsis txaus. Txoj hauv kev rau cov ntaub ntawv no feem ntau yog cov hauv qab no: C: / xampp / apache / conf / ntxiv \
Kauj ruam 3
Tom qab ntawd qhib httpd.conf ntawv thiab tshem tus # cim nyob rau hauv pem hauv ntej ntawm kab Inc / conf / ntxiv / httpd-vhosts.conf. Txoj kev ua haujlwm no yuav ua rau tsis nkag siab thiab txuas rau httpd-vhosts.conf file mus rau httpd.conf file.
Kauj ruam 4
Rov qab pib koj lub server thiab tom qab ntawd txheeb xyuas yog tias koj lub vev xaib ua haujlwm zoo. Txhawm rau qhib nws, sau lub npe sau uas koj teev hauv lub thawv virtual host (mysite) rau hauv qhov chaw nyob ntawm koj tus browser. Txij tam sim no, koj lub xaib yuav tsum qhib thiab ua haujlwm ntawm lub server.