2013-11-27 1 views
0

나는 최신 데비안 새로운 데비안 서버를 가지고있다. 웹 사이트는 단 하나의 도메인 이름 만 호스트해야합니다. DNS는 레지스트라에 의해 해결되고 A는 전용 서버를 가리 킵니다. 사이트는 /var/www/에 있습니다.데비안 서버에 도메인 이름을 추가하는 가장 간단한 방법은 무엇입니까?

이 도메인 이름을 추가하도록 Apache를 구성하는 가장 간단한 방법은 무엇입니까?

답변

0

매우 straighforward해야한다 :

  1. 아파치를 설치 그래서는/var/www가에 (sudo aptitude install apache2)
  2. 기본 구성 점 ...
  3. 시작 아파치 (sudo service apache2 restart)
  4. 즐기 당신의 웹 사이트
  5. 에 도메인 이름을 추가 할 수 있습니다. /etc/hosts
  6. 전용 서버 (iptables, fail2ban, ...)

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 등)로 웹 서버를 보호하는 것을 잊지 마십시오.

관련 문제