티스토리 뷰
우분투에서 Apache 가상 호스트 설정 방법
/etc/apache2/sites-available/default
~$ sudo vi /etc/apache2/sites-available/default
여기에 가상호스트를 설정한다.
참고로 여기 보이는 파일은 개인적인 것이며, 동일서버에 다른 포트로 접속하는 경우이다
<VirtualHost *:80>
ServerAdmin hanuli7@naver.com
ServerAlias cnlab.mju.ac.kr
DocumentRoot /var/www
ErrorLog /var/www/www-errlog.log
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
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/"
ServerAdmin hanuli7@naver.com
ServerAlias cnlab.mju.ac.kr
DocumentRoot /var/www
ErrorLog /var/www/www-errlog.log
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
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>
<VirtualHost *:5791>
ServerAdmin hanuli7@naver.com
DocumentRoot /home/hanuli7/www_root
ErrorLog /home/hanuli7/www_root/www-errlog.log
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/hanuli7/www_root>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
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>
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>
<VirtualHost *:5791>
ServerAdmin hanuli7@naver.com
DocumentRoot /home/hanuli7/www_root
ErrorLog /home/hanuli7/www_root/www-errlog.log
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/hanuli7/www_root>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
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>
이렇게 파일을 설정하고
/etc/apache/ports.conf 파일에 포트를 추가하여야 한다.
NameVirtualHost *:80
Listen 80
NameVirtualHost *:5791
Listen 5791
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>
Listen 80
NameVirtualHost *:5791
Listen 5791
<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443
</IfModule>
여기에서보면 80 포트와 5791 포트를 사용할 수 있게끔 열어주었다.
아마도 직접 해본것은 아니지만
혹시나 같은 포트로 들어와서도 웹사이트 주소에 따라 다른 페이지 접속을 원한다면
아마도 위에 보였던 /etc/apache2/sites-available/default 에서 가상호스트 조금만 변경하면 될듯?
그건 나중에 다시 해보고 올려야겠다.
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Tibero
- 사용자변경
- 엑스플랫폼
- 스프링
- 이클립스
- maven
- tbimport
- SEED 알고리즘
- 쿼리로그
- 메이븐
- 우분투
- Oracle
- 티베로
- plugin execution not covered
- 원격배포
- 윈도우
- tbexport
- sql log
- Spring
- 설치
- 원격저장소
- 티베로는 나에게 어울리지 않아
- svn 서비스 등록
- tibero database backup
- 오라클
- remote repository
- Publish+Over+SSH
- tibero database export import
- log4jdbc
- 서버
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
글 보관함