|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 113 article |
2002-02-24 08:41:57 |
|
|
|
|
|
|
¿øº» : http://lse.pe.kr/board/read.php?table=tip&no=102
vhuser.sh
#!/bin/bash
######DEFINE#####
#IP=`ifconfig | grep inet | sed -e 's/:/ /g' | awk '{print $3}'`
IP="211.47.121.86"
DOMAIN="coolamp.net"
HTTP="/usr/local/apache/conf/httpd.conf"
DNS="/var/named/coolamp.net.db"
UDIR="/home/$1"
WWW="www"
CGI="cgi-bin"
NAMED=`/etc/rc.d/init.d/named restart`
HTTPD=`/usr/local/apache/bin/apachectl restart`
######MAKE USER#####
useradd $1
passwd $1
#####DNS HOST ADD#######
echo "$1 IN A $IP" >> $DNS
######APAHE V.H ADD#######
echo "" >> $HTTP
echo "### $1.$DOMAIN ¼³Á¤" >> $HTTP
echo "<VirtualHost $1.$DOMAIN>" >> $HTTP
echo " ServerName $1.$DOMAIN" >> $HTTP
echo " ServerAdmin $1@$DOMAIN" >> $HTTP
echo ""
echo " DocumentRoot /home/$1/$WWW" >> $HTTP
echo ""
echo " Alias /cgi-bin/ \"/home/$1/$CGI/\"" >> $HTTP
echo " <Directory \"/home/$1/$CGI/\">" >> $HTTP
echo " Options ExecCGI" >> $HTTP
echo " AddHandler cgi-script .cgi" >> $HTTP
echo " </Directory>" >> $HTTP
echo ""
echo " ErrorLog logs/$1.$DOMAIN-error_log" >> $HTTP
echo " CustomLog logs/$1.$DOMAIN-access_log common" >> $HTTP
echo "</VirtualHost>" >> $HTTP
########DEAMON RESTART########
$NAMED
$HTTPD
ÀÏ´Ü Àڽſ¡ ¼¹ö¿¡¼ »ç¿ë ÇÏ·Á¸é º¯¼ö ÁöÁ¤ ºÎºÐ¿¡¼ Àڽſ¡ ¼³Á¤¿¡ ¸Â°Ô Àû
¿ë ½ÃÅ°¸é µË
´Ï´Ù.
´Ù¸¥ºÎºÐÀº ¼Õ´ëÁö ¾Ê¾Æµµ Àß µ¹¾Æ °©´Ï´Ù.
À§¿¡ °ÍÀº 2Â÷ µµ¸ÞÀÎ ¹öÃÄ È£½ºÆ®¸¦ 쉡±â µµ¿Í ÁÖ´Â ½©ÀÔ´Ï´Ù.
´ç¿¬È÷ ./vhuser.sh ForSpeed
ID¸¦ ÀÎÀÚ·Î ³Ö¾î ÁÖ¾î¾ß ÇÕ´Ï´Ù.
Áý¿¡¼ Á¦°¡ »ç¿ëÇÏ°í ÀÖ´Â ½©À̹ǷΠÀß µ¹¾Æ °¥°ÍÀÔ´Ï´Ù.
±â´ÉÀ» º¸°Çؼ 1Â÷ È£½ºÆ®±îÁö Áý¾î ³ÖÀ»¼ö ÀÖ´Â ½©À» ´ÙÀ½ ¹öÀü¿¡ ³» ³õµµ
·Ï ÇÏÁÒ...
¶È°°Àº ÀÛ¾÷À» ¹Ýº¹ÇÏ´Â Á÷¾÷ÀÇ ¹Ýº¹ÀÌ ¸¹Àº SE¹Ç·Î ÇÊ¿ä¿¡ ÀÇÇÑ °£´ÜÇÑ ½©À»
Â¥´Â°Íµµ ¶§·Î
´Â µµ¿òÀÌ ¸¹ÀÌ µË´Ï´Ù^^
ÇãÁ¢ÇÑ ¹Î¼öÀÇ ½©TIPÀÌ¿´½À´Ï´Ù.
|
|
Page Loading [ 0.02 Sec ]
SQL Time [ 0 Sec ]
|
|
|