나는 사용해왔다이 튜토리얼내 Ubuntu PC에 Apache 가상 호스트를 설정합니다. no-ip domain
가상 호스트로 사용할 호스트 이름을 만들었습니다 . 튜토리얼의 모든 단계를 따랐지만 작동하지 않습니다. 이것은 가상 호스트 파일이며 이름은 다음과 같습니다 crm2plus.ddns.net.conf
.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin [email protected]
ServerName crm2plus.ddns.net
ServerAlias crm2plus.ddns.net
DocumentRoot /var/www/crm2plus.ddns.net/public_html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
또한 다음과 같이 로컬 호스트 파일에 IP 및 도메인 이름 쌍을 추가했습니다.
23.253.21.201 shhasan.ddns.net
127.0.1.1 Ubuntu-Dev
127.0.0.1 localhost
99.250.71.177 crm2plus.ddns.net
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
크롬을 통해 탐색하면 정상적으로 작동 crm2plus.ddns.net
합니다 web page not available page
. 터미널에 입력 shhasan.ddns.net
하면 아무것도 표시되지 않지만 입력하면 다음이 표시됩니다.ssh-keygen -H -F crm2plus.ddns.net
ssh-keygen -H -F shhasan.ddns.net
# Host shhasan.ddns.net found: line 14 type RSA
다음은 RSA 키입니다.
또한 Apache 오류 및 액세스 로그도 살펴보았습니다. 오류 로그에는 다음과 같은 코드 줄이 많이 반복됩니다.
[Fri Nov 14 17:44:50.304782 2014] [mpm_prefork:notice] [pid 21927] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Fri Nov 14 17:44:50.304801 2014] [core:notice] [pid 21927] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 14 17:44:54.979832 2014] [mpm_prefork:notice] [pid 21927] AH00169: caught SIGTERM, shutting down
검색 caught SIGTERM, shutting down
해보니 정상적인 작동의 일부인 것으로 나타났습니다. 내가 어디서 잘못되었는지 모르겠습니다. 이전에는 작동 shhasan.ddns.net
했지만 crm2plus.ddns.net
.
출력 netstat -pan | grep 80
:
unix 2 [ ] STREAM CONNECTED 528079 5594/gvfsd-http @/dbus-vfs-daemon/socket-vc8j6I1O
unix 3 [ ] STREAM CONNECTED 18079 2579/dbus-daemon @/tmp/dbus-nICf5nhpay
unix 3 [ ] STREAM CONNECTED 18067 2579/dbus-daemon @/tmp/dbus-nICf5nhpay
unix 2 [ ] DGRAM 8009 -
unix 3 [ ] STREAM CONNECTED 18116 2680/indicator-appl
unix 3 [ ] STREAM CONNECTED 18076 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
unix 3 [ ] STREAM CONNECTED 18085 2587/ibus-ui-gtk3
unix 2 [ ] STREAM CONNECTED 528093 5594/gvfsd-http @/dbus-vfs-daemon/socket-XXVPW75v
unix 3 [ ] STREAM CONNECTED 20680 2827/compiz
unix 3 [ ] STREAM CONNECTED 18072 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
unix 3 [ ] STREAM CONNECTED 225804 4011/chrome
unix 3 [ ] STREAM CONNECTED 18008 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
unix 3 [ ] STREAM CONNECTED 228060 2541/ibus-daemon @/tmp/dbus-8s7gwnYp
unix 3 [ ] STREAM CONNECTED 18071 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
unix 3 [ ] STREAM CONNECTED 225280 4011/chrome
unix 3 [ ] STREAM CONNECTED 18069 2607/at-spi2-regist
unix 3 [ ] STREAM CONNECTED 18001 2501/window-stack-b
unix 2 [ ] STREAM CONNECTED 9700589 5594/gvfsd-http @/dbus-vfs-daemon/socket-80dWj6IE
unix 3 [ ] STREAM CONNECTED 18044 2488/dbus-daemon @/tmp/dbus-PTGbrLg1OB
답변1
가상 호스트 정의의 약간 편집된 버전stackoverflow에 대한 RiggsFolly의 답변작업crm2plus.ddns.net
<VirtualHost *:80>
ServerName crm2plus.ddns.net
ServerAlias crm2plus.ddns.net
ServerRoot /var/www/crm2plus.ddns.net/
DocumentRoot /var/www/crm2plus.ddns.net/public_html
<Directory "/var/www/crm2plus.ddns.net/public_html">
Options +Indexes +FollowSymLinks
Order allow,deny
Allow from all
AllowOverride All
</Directory>
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_error.log
CustomLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_access.log combined
</VirtualHost>
답변2
Apache 2.4 가상 호스트의 향후 구성을 위해 이 가이드를 사용할 수도 있습니다. http://www.bytelinux.com/enable-apache-virtual-hosting-ubuntu-14-10/웹 호스팅 구성 파일의 모양에 대한 시작점입니다!