អ្វីជា httpd-vhosts.conf ?

Posted on April 23, 2011, 8:29 pm


អ្វីជា httpd-vhosts.conf ?

របៀប Configure httpd-vhosts.conf !

what's vhost file ? how to configure vhost file ?

ce que le fichier vhost? comment configurer le fichier vhost?

httpd-vhosts.conf ជាហ្វាល់ មួយ របស់ Apache Web Server ប្រើសំរាប់ កំណត់ទីតាំង Default នៃ Web Project របស់លោកអ្នក ។
វាប្រៀបដូចជា Dictionary ប្រើសំរាប់ Mape ទីតាំង នៃ Web Project របស់លោកអ្នក ជាមួយនិង Address ដែល អ្នក Request ពី Web Browser ។
ហេតុអ្វី vhosts.conf ?
គឺមាភាពងាយស្រួលក្នុងការ access web project របស់អ្នក
ស្រួលចាំ local web project address (friendly name)
ឧ. http://www.example.local => Access file ក្នុង (D:/wamp/www/example)
ឧ. http://www.meas.local => Access file ក្នុង (D:/wamp/www/meas)

xxxx


របៀប Configure ?
១.)
ចុច លើ Wamp Server របស់អ្នក => Apache => httpd.conf
ហើយស្វែរក ពាក្យ (Include conf/extra/httpd-vhosts.conf) សូម លុប សញ្ញា (#) ចេញពីមុខវា
# Include conf/extra/httpd-vhosts.conf => Include conf/extra/httpd-vhosts.conf

xxxx


២.)
ចូលទៅក្នុងទីតាំងដែលបានតំឡើង Apache ហើយរកមើល ឯកសារ (httpd-vhosts.conf) ដើម្បីកែរ
ជាទូទៅវាស្ថិតនៅក្នុង (wamp\bin\apache\Apache2.2.17\conf\extra \httpd-vhosts.conf) សូមបើក ឯកសារនេះដើម្បី បន្ថែម (វាជា Text File)
រកមើល កូដខាងក្រោម ហើយ កែវា

<virtualhost *:80="">
ServerAdmin webmaster@dummy-host.hleclerc-PC.ingenidev
DocumentRoot ទីតាំង Web Project របស់អ្នក
ServerName Friendly Name សំរាប់ប្រើ
ServerAlias Alias Name សំរាប់ប្រើ
ErrorLog "logs/dummy-host.hleclerc-PC.ingenidev-error.log"
CustomLog "logs/dummy-host.hleclerc-PC.ingenidev-access.log" common
</virtualhost>

ឧ.

<virtualhost *:80="">
ServerAdmin webmaster@dummy-host.hleclerc-PC.ingenidev
DocumentRoot "D:/wamp/www/my_web_project"
ServerName my_web_project.local
ServerAlias www.my_web_project.local
ErrorLog "logs/dummy-host.hleclerc-PC.ingenidev-error.log"
CustomLog "logs/dummy-host.hleclerc-PC.ingenidev-access.log" common
</virtualhost>

សូម Save ហើយបិតវា ។

៣.)
នៅមិនទាន់ចប់ទេ ដំណាក់កាលចុង ក្រោយ គឺត្រូវចូលទៅ កែ host file មួយទៀត
ចូលបើឯកសារ text file នៅទីតាំនេះ (C:\WINDOWS\system32\drivers\etc) ហើយ បើក file (HOSTS) ជាមួយ NotePad or WordPad ហើយសរសេបន្ថែម នៅពីក្រោម

defaultIP Tab ServerName Tab ServerAlias (ServerName និង ServerAlias ដូចដែលអ្នកបានកែនៅក្នុង httpd-vhosts.conf)

ឧ.

127.0.0.1 my_web_project.local www.my_web_project.local

Save File ហើ Restar Apache Server ឡើងវិញ ហើសាកល្បង បើក Web Project របស់អ្នក ជាមួយ Address ថ្មី ៕

Blog Archive

  • 2023-May (1)
  • 2023-February (1)
  • 2020-October (1)
  • 2020-May (1)
  • 2020-February (2)
  • 2019-December (5)
  • 2019-November (1)
  • 2018-July (1)
  • 2017-December (1)
  • 2017-November (1)
  • 2017-June (1)
  • 2016-September (5)
  • 2016-August (3)
  • 2016-June (1)
  • 2015-September (1)
  • 2015-May (1)
  • 2015-February (2)
  • 2014-December (1)
  • 2014-November (2)
  • 2014-September (3)
  • 2014-August (1)
  • 2014-June (1)
  • 2014-May (1)
  • 2014-March (1)
  • 2013-December (2)
  • 2013-October (2)
  • 2013-July (1)
  • 2013-June (3)
  • 2013-May (4)
  • 2013-March (1)
  • 2012-December (2)
  • 2012-November (1)
  • 2012-October (1)
  • 2012-September (2)
  • 2012-August (2)
  • 2012-July (2)
  • 2012-June (1)
  • 2012-May (2)
  • 2012-March (2)
  • 2012-February (2)
  • 2012-January (5)
  • 2011-December (2)
  • 2011-November (4)
  • 2011-October (5)
  • 2011-September (2)
  • 2011-August (1)
  • 2011-June (2)
  • 2011-May (1)
  • 2011-April (9)
  • 2011-March (3)
  • 2011-February (12)
  • 2011-January (16)
  • 2010-December (17)
  • 2010-November (6)
  • 2010-October (10)
  • 2010-September (8)