Как настроить apache с доменным именем в raspberry pi

2626
Rajamoorthy

у меня Raspberry Pi (IP: 192.168.1.135) подключен к моему компьютеру (IP: 192.168.1.100) через порт LAN.

ПК подключен к роутеру (IP: 12.168.1.1).

у меня есть Raspberry для подключения к маршрутизатору, я подключил порт LAN и WLAN так (в Windows7 -> Центр управления сетями и общим доступом -> изменить настройки адаптера)

я настроил apache с доменным именем http://www.myownraspberrypi.com/ по умолчанию порт 80

но если я называю имя домена в моем компьютере его реагирование с этой страницей не доступен диалог

пожалуйста, помогите мне настроить параметры

Еще одно мое сомнение заключается в том, что есть какой-либо stetting, который будет загружен с моим маршрутизатором dlink DSL-2730, чтобы сопоставить IP-адрес raspberry pi с именем домена (в маршрутизаторе)?

благодарю вас.

2

1 ответ на вопрос

1
grawity

my another doubt is that, is there any stetting to be loaded with my dlink DSL-2730 router to map the ip address of raspberry pi with domain name(in router)?

Something like that, yes.

The problem is, just because your Apache claims to accept requests for www.myownraspberrypi.com, it doesn't automatically mean other computers will send requests to it. (Imagine, what would happen if you configured your Apache for www.google.com?) You still need to make that domain name actually point to your π's IP address.

The client computer (your PC) uses one of three ways to translate www.myownraspberrypi.com into an IP address:

  1. the computer's own /etc/hosts file;
  2. various LAN-only name discovery protocols;
  3. Internet's DNS system.

If you only want to access the web server from one PC or two, you can add the name in their hosts files by hand, like this:

192.168.1.135 www.myownraspberrypi.com 

Some routers do have an option to make a domain name available to the entire LAN, although often limited to hostname.home or such. Look for a section called "Local DNS". (Though it would be much better to use .home than .com for this purpose.) But I don't think D-Link routers have that feature.

Похожие вопросы