[PHP] Apache mod_rewrite 사용하기

./configure --enable-rewrite

사용자 삽입 이미지


<Directory "/document_root">
        AllowOverride FileInfo   # or All
    </Directory>

RewriteEngine On
RewriteBase /
RewriteRule ^([a-zA-Z0-9])$ $1.php
# 희안하게 RewriteBase 를 설정안하면 작동을 안한다. 원래 그런가...


# 텍스트규브 .htaccess
#<IfModule mod_url.c>
#CheckURL Off
#</IfModule>
#SetEnv PRELOAD_CONFIG 1
RewriteEngine On
RewriteBase /tc/
RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(cache)+/+(.+[^/]).(cache|xml|txt|log)$ - [NC,F,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rewrite.php [L,QSA]



Posted by incree

2013/10/30 15:34 2013/10/30 15:34
,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/290

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

[PHP] Apache, MySQL, PHP install

1. mysql 설치
http://forums.mysql.com/read.php?11,153632,153632

yum install mysql mysql-server mysql-devel
chgrp -R mysql /var/lib/mysql
chmod -R 770 /var/lib/mysql

2. apache 설치
http://httpd.apache.org/download.cgi
http://apr.apache.org/download.cgi
http://package/forge.net/projects/pcre/files/pcre/
http://www.openssl.org/package/

cd /package/
tar -zxvf httpd-2.4.6.tar.gz
tar -zxvf apr-1.4.8.tar.gz
tar -zxvf apr-util-1.5.2.tar.gz
tar -zxvf pcre-8.33.tar.gz
tar -zxvf openssl-1.0.1e.tar.gz

cd /package/
mv apr-1.4.8 /package/httpd-2.4.6/srclib/apr
mv apr-util-1.5.2 /package/httpd-2.4.6/srclib/apr-util

cd /package/pcre-8.33
./configure
make
make install

cd /package/openssl-1.0.1e
./config
make
make install


cd /package/httpd-2.4.6
./configure --enable-module=all --enable-so --prefix=/usr/local/apache2 --enable-modules=ssl --enable-ssl --with-ssl=/usr/local/ssl   --enable-module=most
make
make install


3. php 설치
http://www.php.net/downloads.php
http://www.xmlsoft.org/downloads.html
http://sourceforge.net/projects/mcrypt/
http://code.google.com/p/quirkysoft/downloads/detail?name=jpegsrc.v6b.tar.gz&can=2&q=
http://curl.haxx.se/download.html

cd /package/
tar -zxvf php-5.5.5.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
tar -zxvf libxml2-2.9.1.tar.gz
tar -zxvf jpegsrc.v6b.tar.gz
tar -zxvf curl-7.33.0.tar.gz

cd /package/
yum install freetype-devel
yum install libjpeg-turbo-devel
yum install libpng-devel

cd /package/libmcrypt-2.5.8
./configure
make
make install

cd /package/libxml2-2.9.1
./configure
make
make install

cd /package/jpeg-6b
mkdir /usr/local/man/man1
./configure
make
make install

cd /package/curl-7.33.0
./configure
make
make install


cd /package/php-5.5.5
./configure --prefix=/usr/local/php5 --with-openssl --with-apxs2=/usr/local/apache2/bin/apxs --enable-ftp --disable-debug --with-zlib --with-jpeg-dir=/usr/local --with-gd --enable-mbstring --enable-sockets --with-mcrypt=/usr/local --with-curl --with-mysql --enable-pdo --with-pdo-mysql --enable-zip --enable-gd-native-ttf --with-freetype-dir=/usr/include/freetype2 --enable-exif
make
make install

4. apache conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 주석제거
LoadModule ssl_module modules/mod_ssl.so 주석제거


5. start
service mysqld start
/usr/local/apache2/bin/apachectl start

Posted by incree

2013/10/26 15:19 2013/10/26 15:19
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/286

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다