나는 최신 데비안 새로운 데비안 서버를 가지고있다. 웹 사이트는 단 하나의 도메인 이름 만 호스트해야합니다. DNS는 레지스트라에 의해 해결되고 A는 전용 서버를 가리 킵니다. 사이트는 /var/www/
에 있습니다.데비안 서버에 도메인 이름을 추가하는 가장 간단한 방법은 무엇입니까?
이 도메인 이름을 추가하도록 Apache를 구성하는 가장 간단한 방법은 무엇입니까?
나는 최신 데비안 새로운 데비안 서버를 가지고있다. 웹 사이트는 단 하나의 도메인 이름 만 호스트해야합니다. DNS는 레지스트라에 의해 해결되고 A는 전용 서버를 가리 킵니다. 사이트는 /var/www/
에 있습니다.데비안 서버에 도메인 이름을 추가하는 가장 간단한 방법은 무엇입니까?
이 도메인 이름을 추가하도록 Apache를 구성하는 가장 간단한 방법은 무엇입니까?
매우 straighforward해야한다 :
는sudo aptitude install apache2
)sudo service apache2 restart
)/etc/hosts
sudo dpkg-reconfigure apache2
과 함께 자동 마법사를 사용할 수도 있습니다.
DNS가 이미 사용자의 IP를 가리키고 있다면이 정도면 충분하다고 생각합니다. 당신이 정말로 구성 파일을 변경해야하는 경우
, 그것은 etc/apache2/sites-available/default
에 그리고 포함 (기본적으로) 다음
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
#Virtual Hosts
12.34.56.789 example.com #<= change here :)
:
는
NameVirtualHost *
<VirtualHost *>
ServerAdmin [email protected] # <= Email of webadmin (shown on error pages)
DocumentRoot /var/www/ # <= Root of your web server with public access
<Directory />
Options FollowSymLinks
AllowOverride None # <= Disable usage of .htaccess files
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have/go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
호스트 파일에 관해서는, 다음을 추가 할 수 있습니다
그런 다음 적절한 도구 (iptables, fail2ban 등)로 웹 서버를 보호하는 것을 잊지 마십시오.