우분투 : 아파지 서버의 설정 방법

일반적으로 아파치의 경우 httpd.conf 파일에서 설정을 해주는걸로 알고 있었는데, 우분투로 아파치를 설치했더니 httpd.conf 에는 아무것도 없었다. 그래서 인터넷 검색을 해봤더니 아래 설명들을 확인할수 있다. 다음에 같은 실수를 막기 위해서 기록...

아파치 서버 설정파일 :
/etc/apache2/sites-available/default

설정 파일을 수정하고 아파치를 재구동해야 한다.
sudo /etc/init.d/apache2 restart

적용된 내용을 아래 내용에서 확인 할수 있다.
/etc/apache2/sites-enable/default 

아파치 설정 (/etc/apache2/sites-available/default )
<VirtualHost *:80>
   ServerAdmin webmaster@localhost      

   # DocumentRoot /var/www/
   DocumentRoot /home/citylock/programmingSrc/php/        ( 기본 디렉토리 변경 )
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /home/citylock/programmingSrc/php/>           (기본 디렉토리 변경)
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
   </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

    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>

 
Posted by 시티락