Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LinuxÏÂApache·þÎñÆ÷ÍøÒ³ÃÜÂëÉèÖùý³ÌÎÊÌâ¼°½â¾ö·½·¨

      ÍøÉÏÕÒµ½ÁËÐí¶à¹ØÓÚÕâ·½ÃæµÄÎÄÕ£¬ÄÚÈÝ»ù±¾Ïàͬ¡£¾­¹ýʵ¼ù£¬·¢ÏÖÄÚÈÝÀïÆÕ±é´æÔÚÎÊÌâ¡£ÒÔÏÂÊÇ×Ô¼ºÊµ¼ùÖ®ºó£¬ÐÞ¸ÄÁËÆäÖеĴíÎ󣬲¢¼Ç¼ÏÂÀ´µÄ±Ê¼Ç¡£
      ÔÚ Linux »ò UNIX Ï嵀 Apache ·þÎñÆ÷ÖиøÍøÒ³ÉèÖÃÃÜÂë—ÕâÊÇÒ»Öֺܼòµ¥µÄ»ùÓÚÓû§Ãû/¿ÚÁîµÄÈÏÖ¤·½Ê½£¬µ±ÎÒÃÇÔÚä¯ÀÀÆ÷ÖзÃÎʾ­´ËÈÏ֤ģʽ±£»¤µÄURLÁ´½Óʱ£¬½«»á³öµ¯³öÒ»¸ö¶Ô»°¿ò£¬ÒªÇóÓû§¼üÈëÓû§ÃûºÍ¿ÚÁî¡£Óû§ÊäÈëºó£¬´«¸øApache·þÎñÆ÷£¬Apache·þÎñÆ÷ÑéÖ¤ËüµÄÕýÈ·ÐÔ£¬Èç¹ûÕýÈ·£¬ÏÔʾҳÃ棬·ñÔò³öÏÖ401´íÎó(ûÓÐȨÏÞ)¡£ÕâÊÇÔõôʵÏÖµÄÄØ?
      ʵÀýÒ»£ºÐèÒªÓû§ÃûºÍ¿ÚÁîµÄ·ÃÎÊ¿ØÖÆ
£¬ÏÞÖÆ WWW ·þÎñÆ÷ÖÐ /home/httpd/html/backup/ Ŀ¼ÖÐÍøÕ¾ www.britepic.org Ò³ÃæµÄ·ÃÎÊ£¬Ö»ÔÊÐíÓû§“user1”ÒÔ¿ÚÁî“passwd1”·ÃÎÊÒ³Ãæ¡£
»ù±¾Çé¿ö£º
¼ÙÉèwww.britepic.org Õ¾µãApache·þÎñÆ÷ÖеÄhttpd.confÎļþÓÐÉèÖÃΪ£º
¡¡¡¡DocumentRoot /home/httpd/html
¡¡¡¡AccessFileName .htaccess
¡¡¡¡AllowOverride All
ʵÏÖ²½Ö裺
¡¡¡¡1.ʹÓÃhtpasswd½¨Á¢Óû§Îļþ£º
¡¡¡¡$ htpasswd -c /home/httpd/secr/.htpasswd user1
¡¡¡¡´Ë³ÌÐò»áѯÎÊÓû§“user1”µÄ¿ÚÁÄãÊäÈë“passwd1”£¬Á½´ÎÉúЧ¡£
¡¡¡¡2.½¨Á¢.htaccessÎļþ
¡¡¡¡ÓÓvi /home/httpd/html/backup/.htaccess”ÃüÁÁ¢.htaccessÎļþ£¬²¢Ð´ÈëÒÔϼ¸ÐУº
¡¡¡¡AuthName "My Friend Only" (×¢£ºÕâ¸öÃû×ÖÊÇÈÎÈ¡µÄ,²¢ÇÒ±ØÐëÓÐË«ÒýºÅ)
¡¡¡¡AuthType Basic
¡¡¡¡AuthUserFile /home/httpd/secr/.htpasswd
¡¡¡¡require valid-user
¡¡¡¡×îºóÉèÖÃÎļþ.htpasswdºÍ.htaccessµÄÎļþȨÏÞ£¬È·±£ApacheÓû§ÓжÁµÄȨÏÞÕâÑù¾ÍÍê³ÉÁËÍøÒ³ÃÜÂëÉèÖõŤ×÷£¬ÏÖÔÚÄã¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐÊÔÒ»ÊÔЧ¹ûÁË¡£
ʵÀý¶þ£ºÔÊÐíÒ»×éÓû§·ÃÎÊÒ»¸öĿ¼¡£
ÀýÈçÏÖÔÚwww.britepic.orgÕ¾µãÏëÈÃmyfriend
¡¡¡¡×éÖеÄm1Óëm2Á½¸öÓû§·Ö±ðÄÜʹÓÿÚÁî“m1pass”ºÍ“m2pass”·ÃÎÊ/home/httpd/html/
¡¡¡¡backup/Ŀ¼ÖеÄÒ³Ãæ¡£
ʵÏÖ²½Ö裺
¡¡¡¡1.ʹÓÃhtpasswd½¨Á¢Óû§Îļþ£¬²¢ÔÚÌáʾÐÅÏ¢·Ö±ðÊäÈëm1Óëm2Á½¸öÓû§µÄ¿ÚÁî“m1pass”ºÍ“m2pass”£º
¡¡¡¡htpasswd -c /home/httpd/secr/.htpasswd m1
¡¡¡¡htpasswd -c /home/httpd/secr/.htpasswd m2
¡¡¡¡2.½¨Á¢×éÎļþ£¬ÓÓvi /home/httpd


Ïà¹ØÎĵµ£º

Linux cµÄpopen()

½ø³ÌI/Oº¯Êý,Óëpcloseº¯ÊýÒ»ÆðʹÓá£
±íÍ·Îļþ
¡¡¡¡#include <stdio.h>
º¯Êý¶¨Òå
¡¡¡¡FILE * popen
( const char * command
, const char * type
);
¡¡¡¡int pclose
( FILE * stream
);
º¯Êý˵Ã÷
¡¡¡¡
popen() º¯Êýͨ¹ý´´½¨Ò»¸ö¹ÜµÀ£¬µ÷Óà fork ²úÉúÒ»¸ö×Ó½ø³Ì£¬Ö´ÐÐÒ»¸ö shell ÒÔÔËÐÐÃüÁîÀ´¿ªÆôÒ» ......

ѧϰlinuxϵÄc/c++±à³Ì

ѧϰlinuxϵÄc/c++±à³Ì  
1£¬ÏÈÓÐlinux»·¾³
´îminGWºÍcygwin¶¼ÓеãÂé·³£¬×î×î¼òµ¥µÄ°ì·¨»¹ÊÇ×°¸öÕæÕýµÄlinux£¬ÓÃÐéÄâ»úÒ²ºÃ£¬ÔÚÍøÂçÉϵÄÁíһ̨»úÆ÷Ò²ºÃ¡£ÕâÑù²»½ö¿ì£¬¶øÇÒÄãÓÐÁËÕæÕýµÄ»·¾³¡£
2.»áC/C++ÓïÑÔ£¨¹À¼ÆÄã»áµÄ£©
3.ÈëÃŽ׶ÎÊìϤgccÃüÁîÐУ¬×î»ù±¾µÄ²ÎÊý£¬È磬-g,-W,-O,-o,-c ½¨Òé¿´man gcc(ºÜ´óÕÒÏ ......

linux ²éÕÒÎļþÄÚÈÝ


²éÕÒ °üº¬alias×Ö·û´®µÄ*.confµÄÎļþ
find / -name "*.conf" | xargs grep "alias"
1. grep -R -l һЩҲ¿ÉÒÔʵÏÖ£¬µ«ÊÇͨ¹ý¹ÜµÀ | ±Èµ¥´¿ÓÃgrep ¸´ÔӵIJÎÊý¸üÓÐЧÂÊ¡£
2. xargsÊÇÓÃÀ´Õ¹¿ªfind»ñµÃµÄ½á¹û£¬Ê¹Æä×÷ΪgrepµÄ²ÎÊý¡£ ......

linuxϵͳµ÷Óã¨×ª£©

ÆäÖÐÓÐһЩº¯ÊýµÄ×÷ÓÃÍêÈ«Ïàͬ£¬Ö»ÊDzÎÊý²»Í¬¡££¨¿ÉÄܺܶàÊìϤC++ÅóÓÑÂíÉϾÍÄÜÁªÏëÆðº¯ÊýÖØÔØ£¬µ«ÊDZðÍüÁËLinuxºËÐÄÊÇÓÃCÓïÑÔдµÄ£¬ËùÒÔÖ»
ÄÜÈ¡³É²»Í¬µÄº¯ÊýÃû£©¡£»¹ÓÐһЩº¯ÊýÒѾ­¹ýʱ£¬±»ÐµĸüºÃµÄº¯ÊýËù´úÌæÁË£¨gccÔÚÁ´½ÓÕâЩº¯Êýʱ»á·¢³ö¾¯¸æ£©£¬µ«ÒòΪ¼æÈݵÄÔ­Òò»¹±£Áô×Å£¬ÕâЩº¯ÊýÔÚÇ°
Ãæ±êÉÏ“*”ºÅÒÔÊ ......

linux lsÖ»ÊÇÁгöÎļþ¼Ð

ls -l|grep ^d    ----Áгöµ±Ç°Ä¿Â¼ÏµÄÎļþ¼Ð
ls -l|grep ^d|grep "tmp"  ----Áгöµ±Ç°Ä¿Â¼ÏÂÃ÷×Óº¬ÓÐ"tmp"µÄÎļþ¼Ð
for dir in `ls -l ~/dxy/|grep ^d | awk '{print $9}'`  ---- awk '{print $9}' ,Ö»print Îļþ¼ÐµÄÃû×Ö
do
echo "==== $dir"
cd ~/dxy;cd ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ