Shinnara's Blog
Talking with Shinnara :: NaraTalk.com

Drupal 설치하기

Computer/Programming/FreeBSD 2007/11/05 17:30 by Shinnara

CMS(Contents Management System) 의 대표격으로 불리는 Drupal 을 사내 프로젝트에 적용하기 전 개인적으로 테스트해보기 위해서 제 전용 머신에 설치를 해보았습니다.

드루팔의 홈페이지는 아래의 주소로 가보시면 됩니다.

http://drupal.org/

사용자 삽입 이미지







현재 4.7.8 과 5.3 의 공식 버전과 6.0 beta 2를 다운 받으실 수 있습니다.

저는 5.3을 받아서 설치를 시도했습니다.


1. 다운 받고 압축 풀기

drupal-5.3.tar.gz 파일을 받아서 적당한 디렉토리에 압축을 해제합니다.

[shinnara /home/httpd/drupal]$ ls
CHANGELOG.txt      MAINTAINERS.txt    install.php        scripts/
INSTALL.mysql.txt  UPGRADE.txt        misc/              sites/
INSTALL.pgsql.txt  cron.php           modules/           themes/
INSTALL.txt        includes/          profiles/          update.php
LICENSE.txt        index.php          robots.txt         xmlrpc.php
[shinnara /home/httpd/drupal]$



2. 데이터베이스 세팅하기

저의 경우 mysql 을 사용하였습니다. 드루팔의 루트 디렉토리에 보면 INSTALL.mysql.txt 라는 파일에 다음과 같은 내용이 있습니다.

  1 // $Id: INSTALL.mysql.txt,v 1.7 2006/09/08 16:29:35 dries Exp $
  2
  3 CREATE THE MySQL DATABASE
  4 --------------------------
  5
  6 This step is only necessary if you don't already have a database set-up (e.g. by
  7 your host). In the following examples, 'username' is an example MySQL user which
  8 has the CREATE and GRANT privileges. Use the appropriate user name for your
  9 system.
 10
 11 First, you must create a new database for your Drupal site (here, 'databasename'
 12 is the name of the new database):
 13
 14   mysqladmin -u username -p create databasename
 15
 16 MySQL will prompt for the 'username' database password and then create the
 17 initial database files. Next you must login and set the access database rights:
 18
 19   mysql -u username -p
 20
 21 Again, you will be asked for the 'username' database password. At the MySQL
 22 prompt, enter following command:
 23
 24   GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE
 25   TEMPORARY TABLES, LOCK TABLES
 26   ON databasename.*
 27   TO 'username'@'localhost' IDENTIFIED BY 'password';
 28
 29 where
 30
 31  'databasename' is the name of your database
 32  'username@localhost' is the username of your MySQL account
 33  'password' is the password required for that username
 34
 35 Note: Unless your database user has all of the privileges listed above, you will
 36 not be able to run Drupal.
 37
 38 If successful, MySQL will reply with:
 39
 40   Query OK, 0 rows affected
 41
 42 To activate the new permissions, enter the following command:
 43
 44   FLUSH PRIVILEGES;

저는 그냥 user 테이블과 db 테이블에 drupal 계정과 데이터베이스를 만들고 mysqladmin 을 이용하여 reload 해주었습니다.


[shinnara /home/httpd/drupal]$ mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 73
Server version: 5.1.21-beta FreeBSD port: mysql-server-5.1.21

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> insert into user (host,user,password) values ('localhost','drupal',password('xxxxxxxxxxxxx'));
Query OK, 1 row affected, 3 warnings (0.00 sec)

mysql> insert into db values ('localhost','drupal','drupal','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
Query OK, 1 row affected (0.00 sec)

mysql> exit
Bye
[shinnara /home/httpd/drupal]$ mysqladmin -u root -p create drupal
Enter password:
[shinnara /home/httpd/drupal]$ mysqladmin -u root -p reload
Enter password:
[shinnara /home/httpd/drupal]$ mysql -u drupal -p drupal
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 76
Server version: 5.1.21-beta FreeBSD port: mysql-server-5.1.21

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

위의 과정은 제가 데이터베이스를 만들때 쓰는 일반적인 과정입니다. 뭐 특별해 보이는 것은 별로 없고, 그냥 예전부터 익숙한 과정이라 별 생각없이 쓰고 있답니다.


3. 인스톨 스크립트 실행하기

drupal 이 설치된 디렉토리를 웹브라우저를 통해서 접근합니다.

저의 경우는 192.168.0.145 라는 머신의 /drupal 에 설치 했으므로

http://192.168.0.145/drupal 을 접속합니다.

접속해보니 아래와 같은 메시지를 보입니다.

The Drupal installer requires write permissions to ./sites/default/settings.php during the installation process.

퍼미션을 해결해주어야 하는 문제이군요. drupal 의 루트디렉토리 밑의 sites/default/settings.php 에 대해 write 권한을 부여합니다.

권한을 부여하니, 데이터 베이스 정보를 입력하라는 페이지가 나타납니다.

여기에 위에서 설정한 데이터를 입력합니다.

입력을 하고 완료를 누르니 인스톨이 끝나다고 하면서 다음의 메시지를 보여줍니다.

All necessary changes to ./sites/default/settings.php have been made, so you should now remove write permissions to this file. Failure to remove write permissions to this file is a security risk.

위에서 write 권한을 부여했던 settings.php 파일에 대한 write 권한을 삭제하라는 말이군요. 보안 문제가 생길 수 있다고 하니 해주어야겠죠. 뭐 힘든일도 아니니까요 ^^

!!중요!!

이때 settings.php 에 대한 write권한을 삭제하면 이후 첫번째 계정(관리자 계정)을 만드는 과정에서 문제가 생깁니다. 관리자 계정 설정후에 해당 권한을 삭제하시기바랍니다.


그리고 나서 다시 자신의 drupal 사이트에 접속해보면 환영 메시지를 확인하실 수 있습니다.


4. 계정 정보 입력하기

첫번째 계정 정보를 입력합니다. 첫번째 계정은 관리자 계정으로 동작하게 됩니다. 입력한 후에 Edit 페이지에서 암호를 설정하시기 바랍니다

이것으로 드루팔 사용을 위한 기본적인 과정은 모두 마친 셈입니다. 인스톨이 꽤나 간편합니다. 앞으로 남은 것은 설정을 어찌하는 가 하는 것인데요. 시간이 나는 대로 다시 포스팅을 하도록 하겠습니다.





0 Trackback, 0 Comment

TRACKBACK :: http://naratalk.com/trackback/209 관련글 쓰기

댓글을 달아 주세요

1  ... 113 114 115 116 117 118 119 120 121  ... 264 
다...... (264)
Computer/Programming (106)
Links (14)
책 읽는 즐거움 (7)
끄적임 (66)
즐거운 과학 나라 (7)
일본 (5)
Study (4)