'apache'에 해당되는 글 2건

  1. 2014.07.14 #20140714-01 :: lgcodechallenger :: apache 2.4.7 + django 1.5.8 on ubuntu 14.04 LTS with AWS
  2. 2011.04.21 #20110421-04 :: Debian Linux :: Apache 설정

#20140714-01 :: lgcodechallenger :: apache 2.4.7 + django 1.5.8 on ubuntu 14.04 LTS with AWS

$ sudo su

# apt-get update

# vi ~/.bashrc

  export LANG="en_US.UTF-8"

  export LC_ALL="en_US.UTF-8"

  : wq

# source ~/.bashrc

# apt-get -y upgrade

# wget https://www.djangoproject.com/download/1.5.8/tarball/ --default-page=Django-1.5.8.tar.gz

# tar -vxzf Django-1.5.8.tar.gz

# cd Django-1.5.8

# sudo python setup.py install

# python -c "import django; print(django.get_version())"


# apt-get install -y apache2

# apache2 -version


# sudo aptitude install -y libapache2-mod-wsgi

# a2enmod wsgi


# sudo apt-get install -y git-core python2.7-mysqldb


# mkdir /srv/django

# cd /srv/django

# git clone https://github.com/ghilbut/lgcodechallenger.git

# cd lgcodechallenger/lgcc

# cp settings.py.example settings.py

# vi settings.py

  == do something ==


# vi /etc/apache2/sites-available/001-lgcc.conf


<VirtualHost *:80>

  ServerAdmin support@lgcodechallenger.com

  ServerName lgecodejam.com

  ServerAlias design.lgcodechallenger.com dev.lgcodechallenger.com


  DocumentRoot /var/www/html


  Alias /static/admin /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/

  Alias /static /srv/django/lgcodechallenger/lgcc_media/static/


  <Directory /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin>

    Require all granted

  </Directory>


  <Directory /srv/django/lgcodechallenger/lgcc_media/static>

    Require all granted

  </Directory>


  WSGIDaemonProcess lgcodechallenger.com user=ubuntu group=ubuntu processes=1 threads=10 python-path=/srv/django/lgcodechallenger:/usr/local/lib/python2.7/site-packages

  WSGIProcessGroup lgcodechallenger.com


  WSGIScriptAlias / /srv/django/lgcodechallenger/lgcc/wsgi.py


  <Directory /srv/django/lgcodechallenger/lgcc>

    Order allow,deny

    Allow from all


    <Files wsgi.py>

      Require all granted

    </Files>

  </Directory>


  ErrorLog ${APACHE_LOG_DIR}/error.log

  CustomLog ${APACHE_LOG_DIR}/access.log combined


</VirtualHost>

:wq


# a2dissite 000-default.conf

# a2ensite 001-lgcc.conf

# apachectl configtest

# service apache2 restart

#20110421-04 :: Debian Linux :: Apache 설정

Debian을 설치 할 때 웹서버 모드로 설치했기 때문에

Apache 2.2 가 기본적으로 설치 되었다.

다만, 설정 파일 및 디렉토리가 달라 찾아다니느라 애를 좀 먹었다.

먼저, 아파치에 대한 기본 설정은 /etc/apache2 디렉토리에 있으며,

apache2.conf 파일을 중심으로 위 디렉토리 및 하위 디렉토리에 분할되어 있다.

Windows 및 FreeBSD 에서 httpd.conf 에 대부분의 내용이 집중되어 있던 모습과는

매우 대조적이다. 

DocumentRoot 및 VirtualHost 세팅을 바꾸기 위해서는

/etc/apache2/sites-enabled/000-default 파일을 열어 보아야 한다.

위 파일의 내용을 적절히 수정한다.