rand(life)
DSO(Dynamic Shared Object) 방식의 웹서버 구축 본문
수능도 끝나고 이래저래 딴짓하고 빈둥거리며 뒤적이다 *nix 계열관련 문서가 하나 있기에 올립니다.
작성자 : 나승현
작성일 : 2004 8. 11
내 용 : DSO(Dynamic Shared Object) 방식의 웹서버 구축
=목 차=
1. MySQL 컴파일
2. Apache 컴파일
3. PHP 컴파일
1. MySQL 컴파일
MySQL 계정 추가
]#adduser -u 27 -r -c "MySQL Server" -M -d /usr/local/mysql/var -s /sbin/nologin mysql
MySQL 최적화 옵션 및 컴파일
]#CFLAGS="-static -march=i686 -funroll-loops -fomit-frame-pointer" CXXFLAGS="-static -march=i686 -funroll-loops -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --sysconfdir=/etc --disable-shared --with-mysqld-user=mysql --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-charset=euckr --without-debug --without-docs --enable-assembler
]#make && make install
MySQL 환경 설정
]#chown -R root.mysql /usr/local/mysql
]#chown -R mysql /usr/local/mysql/var
]#echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf && ldconfig
]#cp /usr/local/src/mysql/share/mysql/my-medium.cnf /etc/my.cnf
]#vi +145 /etc/rc.d/init.d/mysqld --language=korean & // 추가
]#cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
]#chown mysql.mysql /etc/rc.d/init.d/mysqld
]#chkconfig --add mysqld
]#vi /etc/profile PATH=$PATH/usr/local/mysql/bin // 추가
]#mysql_install_db // 메타 데이터 베이스 등록
]#/usr/local/mysql/mysqld_safe &
]#mysqladmin -u root -p password 'new-password'
Enter password: existing_password
2. Apache 컴파일
]#./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-rule=SHARED_CORE \
--enable-shared=max
]#make && make install
Apache 환경 설정
]#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
]#head -7 /etc/rc.d/init.d/network >> /etc/rc.d/init.d/httpd
]#chkconfig --add httpd
]#vi /usr/local/apache/conf/httpd.conf
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName Server IP
중략
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
중략
DocumentRoot "/home/계정/public_html"
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
DirectoryIndex index.html index.php
중략
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .html .htm .php .php3 .php4 .inc .cgi
3. PHP 컴파일
]#./configure --prefix=/usr/local/php4 --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr --with-language=korean --with-charset=euc_kr --enable-sigchild --enable-track-vars --disable-debug --with-xml
]#make && make install
]#cp /usr/loca/src/php/php.ini-dist /usr/local/php4/lib/php.ini
순서는 바뀌어도 무방하며, 버전은 최신으로 해도 무방합니다.