2011년 5월 7일 토요일

포트에러

[Sat May 07 11:37:19 2011] [warn] _default_ VirtualHost overlap on port 8000, the first has precedence
[Sat May 07 11:37:19 2011] [warn] NameVirtualHost *:80 has no VirtualHosts

2011년 5월 6일 금요일

서버세팅

라엘님이 리눅스 서버 세팅법을 잘 정리해 놓았기에 자료를 잘 보존해 놓아야 겠다.
http://www.mediafire.com/?n6h9o36tv4bo3od

자료 출처는 https://lael.be/213

우분투 Apache2 실행오류

site를 enabled 시키고 아파치를 재시작 했더니, 이런 에러가 난다.
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 검색을 해보니, /etc/apache2/apache2.conf의 끝 줄에 ServerName localhost를 추가해
주란다.

노트북용 바탕화면

1280x800




1280x860


#8C8C8C



2011년 5월 3일 화요일

apache error.log 파일내용 비우기

경로로 이동하여

> ./error.log

(또는)

cat /dev/null > ./error.log

nabi설정

kde관련 프로그램에서 nabi설정한 한글이 제대로 입력 안될 경우가 있다.
http://www.ubuntuk.com/k_tip/23000 글을 참고.

우분투에서 gimp 2.7 사용

2.7를 사용하고자 한다면 저장소에 ppa를 추가한다.
sudo apt-add-repository ppa:matthaeus123/mrw-gimp-svn
출처 : http://askubuntu.com/questions/571/ppa-for-single-window-gimp

게시판 글목록이 출력 안되길래

// 게시판 보기(view.php) 입니다.
<?
    session_start();
?>
<html>
<body>
<div id="wrap">
<div id="header">
  <ul class="lnb">
      <li><a href="./list.php">게시판</a>
        <ul class="depth4">
            <li>공지사항</li>
            <li>자유게시판</li>
        </ul>
      </li>
  </ul>
</div>
<div id="container">
  <div class="content">
      <table border="0">

<?
  include "./dbconn.php";

  $sql = "select * from freeboard where num=$num";
  $result = mysql_query($sql, $connect);
  $row = mysql_fetch_array($result);
 
  $content = str_replace("\n", "<br>", $row[content]);
  $content = str_replace(" ", " ", $content);
  $subject = str_replace(" ", " ", $row[subject]);
?>

<tr bgcolor="#eeeeee" align="center"><td>제목<? echo $subject  ?></td></tr>
        <tr><td>작성자 : <? echo $row[name] ?> </td></tr>
        <tr><td>작성일 : <? echo $row[regist_day] ?></td></tr>
        <tr><td>조회수 : <? echo $row[hit] ?> </td></tr>
        <tr bgcolor="#eeeeee"><td>글 내용 : <? echo $content ?> </td></tr>
        <tr>
          <td>
<?
  if ($userid == "admin")
  {
      echo "
        <tr>
          <td align=center>
            <a href='modify_form.php?num=$num&page=$page'> <img src='../img/edit.gif' border=0> </a>
            <a href='delete.php?num=$num&page=$page'> <img src='../img/del.gif' border=0> </a>
            <a href='list.php?page=$page'> <img src='../img/list.gif' border=0></a>
          </td>
        </tr>
          ";
  }
  else
  {
      echo "
        <tr>
          <td align=center>
<a href='passwd_form.php?case=modify&num=$num&page=$page'><img src='../img/edit.gif' border=0></a>
<a href='passwd_form.php?case=delete&num=$num&page=$page'><img src='../img/del.gif' border=0></a>
<a href='list.php?page=$page'><img src='../img/list.gif' border=0></a>
          </td>
        </tr>
          ";
  }
?>
      </table>
  </div>
</div>
</body>
</html>

<?
    $hit = $row[hit];

    $hit++;

    $sql = "update freeboard set hit=$hit where num=$row[num]";
    mysql_query($sql, $connect);
    mysql_close();
?>


-----------------------------------------
요령은 데이터가 들어갔는지, 그후에 select 구문이 맞는지 불러오긴 하는지 확인.

본문을 고쳐보다가 $sql = "select * from freeboard where num=$num";에서 $num을 삭제하니 출력이 잘 된다.$sql에 구문의 대입이 제대로 안됬었던 모양이다.

번호 지정해서 읽는 것 이라면 view.php?num=번호 형태로 부를텐데
view.php에서 $num이 아닌 $_GET['num']으로 // 참고 $_REQUEST['num']

2011년 4월 30일 토요일

우분투 mysql 언어셋 설정

DB에서 글자가 깨질 염려가 없도록 언어 인코딩을 확인해 본다. latin1로 설정되어 있는 경우도 있는 모양이다.

/etc/mysql/my.cnf
 [mysqld]
#
# * Basic Settings
#

default-character-set=utf8
character-set-server = utf8
collation-server = utf8_general_ci

그리고 아파치의 설정도 확인 해본다.
/etc/apache2/conf.d/charset
AddDefaultCharset UTF-8

error.log 메시지

[error] [client 192.168.0.6] PHP Notice:  Undefined variable: page in /home/dotmon/www/sub/list.php on line 131
정의되지 않은 변수
[error] [client 192.168.0.6] PHP Notice:  Use of undefined constant regist_day - assumed 'regist_day' in /home/dotmon/www/sub/list.php on line 146
정의되지 않은 상수 regist_day 사용


[error] [client 192.168.0.6] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0, referer: http://192.168.0.48:8000/sub/list.php
권한오류

[error] [client 192.168.0.6] PHP Fatal error:  Unknown: Failed opening required '/home/dotmon/www/sub/view.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0, referer: http://192.168.0.48:8000/sub/list.php
PHP는 치명적인 오류 : 알 수없는 : '필요한 열 수 없습니다

2011년 4월 29일 금요일

파이어폭스 nightly버전 사용하기

ppa저장소에 다음과 같이 추가해 본다.
ppa:ubuntu-mozilla-daily/ppa

kate를 아크로에디터처럼 설정

kate를 처음 사용할 때, 설정에서 만져야 할게 많다.
설정 > kate설정 > '편집기 구성 요소' 메뉴로 간다.
세션 > 마지막으로 사용한 세션 불러오기
플러그인 > tab bar
글꼴과 색 > 글꼴 > 크기를 10.2
글꼴과 색 > 강조 텍스트 스타일 > php(html)에서 element의 bold해제
편집 > 들여쓰기 > 기본 들여쓰기 모드: 일반
편집 > 들여쓰기 > 들여쓰기 너비 > 3, 4글자
편집 > 들여쓰기 > 탭 간격 > 3, 4글자
편집 > 들여쓰기 > '항상 들여쓰기 단계 증가 시키기' 선택
모양 > 일반 > '탭 문자 강조하기' 해제
모양 > 경계선 > '접기 마커 보이기' 해제