'리눅스'에 해당되는 글 40건

Transmission daemon 실행 권한 변경  -  리눅스  2015. 9. 30. 01:40

공유하기


gnome-session-properties &





데비안에서 트랜스미션을 설치하면 디폴트로 debian-transmission 사용자 권한으로

데몬이 실행됩니다.

따라서, 다운받은 파일의 권한도 debian-transmission 사용자 권한으로 됩니다..

이렇게 되면 파일을 옮기거나 변경할때 root권한이 아니면 상당히 불편 합니다.

그래서, 원하는 사용자 권한으로 데몬을 실행 시키는 방법입니다.


1. 데몬유저 변경

사용자 명이 pi고 사용자 그룹이 share인 경우를 가정하여 작성했습니다.

데몬 중단

service transmission-daemon stop


nano /etc/init.d/transmission-daemon

실행해서 보면

USER=debian-transmission 부분을 USER=pi로 변경합니다.

저장하고 나옵니다.


2. 트랜스 미션 관련 파일 권한 변경

 

chown pi:share /etc/transmission-daemon/settings.json

chown pi:share /etc/init.d/transmission-daemon

chown -R pi:share /var/lib/transmission-daemon/info

chown pi:share /var/lib/transmission-daemon/downloads

chown :share /etc/transmission-daemon

마지막은 그룹만 변경하는 것 입니다.


service transmission-daemon start

로 데몬이 정상적으로 실행되는지 확인합니다.

위와 같이 변경하면 앞으로 다운받는 파일은

pi유저의 share그룹으로 파일이 생성 됩니다..




패키지설치

#sudo apt-get install transmission-daemon

설정을 위해 데몬중지

#sudo service transmission-daemon stop

설정변경

#sudo vi /etc/transmission-daemon/settings.json

◆ vi편집기를 이용해서 아래 설정 변경
"download-dir": "[다운로드 파일디렉토리위치]"
"incomplete-dir": "[다운로드중 파일디렉토리위치]"
"rpc-password": "[transmission에 쓸 계정의 비밀번호]"
"rpc-username": "[transmission에 쓸 계정명]"
"rpc-whitelist-enabled": false,   //false로 하면 외부접속가능
"umask" : 0, // 생성되는 폴더를 권한을 폴더권한으로 저장 기본 18

 ★ 트렌트미션 감시폴더 설정하기

제일 마지막 부분에   "utp-enabled": true, #여기에서 , 찍어주고 밑에 명령들 추가

    "trash-original-torrent-files": true,
    "watch-dir": "/mnt/transmission", 
    "watch-dir-enabled": true
}

#토렌트 파일을 /mnt/transminssion 폴더에 넣어주면 자동으로 트렌스미션이 추가 한다


//다운로드폴더 권한설정
sudo chmod 777 /mnt/transmission/downloads
sudo chgrp -R debian-transmission /mnt/transmission/downloads
sudo chmod 777 /mnt/incoming
sudo chgrp -R debian-transmission  /mnt/incoming

 or

 sudo chmod -R 777 /mnt # 한번에 하위권한이랑 같이 다 주기

 

//데몬실행
#sudo service transmission-daemon start


'리눅스' 카테고리의 다른 글

Geoip 설치방법  (0) 2015.08.02
iptables  (0) 2015.07.28
리눅스 램디스크  (0) 2015.07.28
고정폭 글꼴 consolas, VeraMono  (0) 2015.07.09
Linux 코롬 패키지 백엔드 초기화에 실패했다고 뜰 때  (0) 2015.07.09

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

Geoip 설치방법  -  리눅스  2015. 8. 2. 16:08

공유하기

SSH 에서 작업합니다.

 

1. GeoIP 설치

cd /home/root

mkdir GeoIP

wget http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.4.tar.gz

tar xvfz GeoIP-1.4.4.tar.gz

cd GeoIP-1.4.4

./configure --prefix=/home/root/GeoIP

make

make install

 

 

2. mod_geoip2 설치

cd /home/root

wget http://www.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.4.tar.gz

tar xvfz mod_geoip2_1.2.4.tar.gz

cd mod_geoip2_1.2.4

/usr/local/apache/bin/apxs -a -i -L/home/root/GeoIP/lib -I/home/root/GeoIP/include -lGeoIP -c mod_geoip.c

 

 

3. httpd.conf 수정

하단에 아래내용을 추가

<IfModule mod_geoip.c>
        GeoIPEnable On
        GeoIPDBFile /home/root/GeoIP/share/GeoIP/GeoIP.dat
</IfModule>

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i %{GEOIP_COUNTRY_CODE}e" digimoonlog

 

CustomLog logs/access_log digimoonlog

 

 

 

4. /etc/init.d/httpd restart 후 access log 에 국가 코드가 출력되는지 확인.

116.34.62.xxx - - [13/Aug/2013:09:45:32 +0900] "GET /rb/layouts/soyou01/image/linebg.png HTTP/1.1" 200 137733 "http://ibneer.com/rb/" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" KR

 

* geoip IP 데이터 업데이트

http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

GeoIP.dat 파일을 /home/root/GeoIP/share/GeoIP/ 에 덮어쓰기

 

 

* 활용방법.

1. access log 에서 국가코드 확인 처리

2. PHP    $_SERVER["GEOIP_COUNTRY_CODE"]    로 접속자 국가코드 확인가능

3. 아파치 설정(httpd.conf)으로 특정 국가 접속 제한 가능

<Directory "/home/htdocs">
SetEnvIf GEOIP_COUNTRY_CODE KR go_in
SetEnvIf Remote_Addr 192.168.0.[1-5] go_in
Order Deny,Allow
Deny from all
Allow from env=go_in
</Directory>

위의 예문은 대한민국 아이피와 192.168.0.1~5 까지만 접속을 허용합니다.

 

 

 

PS. 와이즈기가 NAS 의 httpd.conf 상... log_config_module 의 내용을 변경해야 로그가 중복되지 않고 생성되더군요.

 <IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{GEOIP_COUNTRY_CODE}e" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b %{GEOIP_COUNTRY_CODE}e" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      # LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O %{GEOIP_COUNTRY_CODE}e" combinedio
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O %{GEOIP_COUNTRY_CODE}e"
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    ##
    #CustomLog "logs/access_log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    
    CustomLog "logs/access_log" combined
</IfModule>

 

그리고 하단에

 <IfModule mod_geoip.c>
        GeoIPEnable On
        GeoIPDBFile /home/root/GeoIP/share/GeoIP/GeoIP.dat
</IfModule>

 

요것만 추가해주면 됩니다.

각자 서버에 맞게 사용하면 될거 같네요.


'리눅스' 카테고리의 다른 글

Transmission daemon 실행 권한 변경  (0) 2015.09.30
iptables  (0) 2015.07.28
리눅스 램디스크  (0) 2015.07.28
고정폭 글꼴 consolas, VeraMono  (0) 2015.07.09
Linux 코롬 패키지 백엔드 초기화에 실패했다고 뜰 때  (0) 2015.07.09

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

iptables  -  리눅스  2015. 7. 28. 12:26

공유하기

# Generated by iptables-save v1.4.7 on Tue Jul 28 12:25:27 2015

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [1170089:394646139]

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 7224 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

-A INPUT -p udp -m state --state NEW -m udp --dport 137 -j ACCEPT

-A INPUT -p udp -m state --state NEW -m udp --dport 138 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 139 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 445 -j ACCEPT

-A INPUT -p udp -m udp --dport 1900 -m comment --comment "Serviio" -j ACCEPT

-A INPUT -p tcp -m tcp --dport 8895 -m comment --comment "Serviio" -j ACCEPT

-A INPUT -p tcp -m tcp --dport 23423 -m comment --comment "Serviio" -j ACCEPT

-A INPUT -p tcp -m tcp --dport 23424 -m comment --comment "Serviio" -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

# Completed on Tue Jul 28 12:25:27 2015



Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

리눅스 램디스크  -  리눅스  2015. 7. 28. 09:27

공유하기

#/etc/fstab


mpfs       /mnt/ramdisk tmpfs   nodev,nosuid,noexec,nodiratime,size=256M   0 0



크롬 속성


--disk-cache-dir=/mnt/ramdisk/chrome --disable-new-avatar-menu


하드가속명령어

"C:\Program Files\Google\Chrome\Application\chrome.exe" --enable-gpu-rendering --enable-video-layering --enable-accelerated-2d-canvas --enable-fastback


파이어폭스


about:config


문자열


browser.cache.disk.parent_directory


/mnt/ramdisk/ff




1. 크롬 주소창에 chrome://flags/ 입력
2. 메뉴중 Impl-side 그리기 Mac, Windows, Linux, Chrome OS, Android가 기본값 or 사용설정됨으로 되어있으면 사용중지로 바꾼 후 다시시작 누름


'리눅스' 카테고리의 다른 글

Geoip 설치방법  (0) 2015.08.02
iptables  (0) 2015.07.28
고정폭 글꼴 consolas, VeraMono  (0) 2015.07.09
Linux 코롬 패키지 백엔드 초기화에 실패했다고 뜰 때  (0) 2015.07.09
리눅스 메인보드 정보 확인: dmidecode  (0) 2015.07.09

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

고정폭 글꼴 consolas, VeraMono

[보호되어 있는 글입니다. 비밀번호를 입력해 주세요.]


Secret Entry! Enter Password



Linux 코롬 패키지 백엔드 초기화에 실패했다고 뜰 때

[보호되어 있는 글입니다. 비밀번호를 입력해 주세요.]


Secret Entry! Enter Password



리눅스 메인보드 정보 확인: dmidecode

[보호되어 있는 글입니다. 비밀번호를 입력해 주세요.]


Secret Entry! Enter Password



centos 6 ktorrent 설치

[보호되어 있는 글입니다. 비밀번호를 입력해 주세요.]


Secret Entry! Enter Password



su명령어 특정사용자만 사용  -  리눅스  2015. 7. 9. 12:44

공유하기

#vi /etc/pam.d/su

#%PAM-1.0

auth            sufficient      pam_rootok.so

# Uncomment the following line to implicitly trust users in the "wheel" group.

#auth           sufficient      pam_wheel.so trust use_uid

# Uncomment the following line to require a user to be in the "wheel" group.

#auth           required        pam_wheel.so use_uid

auth            include         system-auth

account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet

account         include         system-auth

password        include         system-auth

session         include         system-auth

session         optional        pam_xauth.so

auth            sufficient      /lib64/security/pam_rootok.so

auth            required        /lib64/security/pam_wheel.so debug group=wheel






#vi /etc/group

wheel:x:10:root,사용자추가



'리눅스' 카테고리의 다른 글

리눅스 메인보드 정보 확인: dmidecode  (0) 2015.07.09
centos 6 ktorrent 설치  (0) 2015.07.09
Bitstream-Vera-Sans-Mono  (0) 2015.07.08
httpd.conf  (0) 2015.07.02
apache2 설정  (0) 2015.07.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

Bitstream-Vera-Sans-Mono  -  리눅스  2015. 7. 8. 09:34

공유하기


Bitstream-Vera-Sans-Mono

Bitstream-Vera-Sans-Mono.zip




Bitstream-Vera-Sans-Mono + 맑은고딕

BitstreamVeraSansMono.ttf




'리눅스' 카테고리의 다른 글

centos 6 ktorrent 설치  (0) 2015.07.09
su명령어 특정사용자만 사용  (0) 2015.07.09
httpd.conf  (0) 2015.07.02
apache2 설정  (0) 2015.07.02
my.cnf  (0) 2015.07.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

httpd.conf  -  리눅스  2015. 7. 2. 22:02

공유하기

LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua-5.1.so
<IfModule mod_security2.so>
   Include conf/modsecurity.conf
   Include conf/modsecurity_2x_SMB_090311.conf
   Include conf/modsecurity_2x_hosting_090311.conf
   Include conf/crs/modsecurity_crs_10_setup.conf
   Include conf/crs/activated_rules/*.conf
</IfModule>
Include conf/mod_jk.conf
<Directory "/usr/local/apache/cgi-bin">
    AllowOverride All
    Options +ExecCGI
    Require all granted
    Order allow,deny
    Allow from all
</Directory>
<IfModule geoip_module>
        GeoIPEnable On
        GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat
</IfModule>

'리눅스' 카테고리의 다른 글

su명령어 특정사용자만 사용  (0) 2015.07.09
Bitstream-Vera-Sans-Mono  (0) 2015.07.08
apache2 설정  (0) 2015.07.02
my.cnf  (0) 2015.07.02
google bot 차단  (0) 2015.07.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

apache2 설정  -  리눅스  2015. 7. 2. 22:01

공유하기

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>


RewriteEngine On
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]

DirectoryIndex index.html index.htm index.php index.php3 index.php4 index.php5 index.phtml index.cgi index.jsp

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride All
    Options +ExecCGI
    Require all granted
    Order allow,deny
    Allow from all
</Directory>

'리눅스' 카테고리의 다른 글

Bitstream-Vera-Sans-Mono  (0) 2015.07.08
httpd.conf  (0) 2015.07.02
my.cnf  (0) 2015.07.02
google bot 차단  (0) 2015.07.02
mod_deflate  (0) 2015.07.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

my.cnf  -  리눅스  2015. 7. 2. 22:00

공유하기

[client]
default-character-set = utf8

[mysqld]
init_connect = SET collation_connection = utf8_general_ci
init_connect = SET NAMES utf8

'리눅스' 카테고리의 다른 글

httpd.conf  (0) 2015.07.02
apache2 설정  (0) 2015.07.02
google bot 차단  (0) 2015.07.02
mod_deflate  (0) 2015.07.02
APM 설정  (0) 2015.07.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

google bot 차단  -  리눅스  2015. 7. 2. 21:59

공유하기

<Directory "/" >
    BrowserMatch ^GoogleBot deny_host
    BrowserMatch ^Yeti deny_host
    Deny from env=deny_host
</Directory>

 

 

 

'리눅스' 카테고리의 다른 글

apache2 설정  (0) 2015.07.02
my.cnf  (0) 2015.07.02
mod_deflate  (0) 2015.07.02
APM 설정  (0) 2015.07.02
syntaxHighlighter  (0) 2014.04.10

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

mod_deflate  -  리눅스  2015. 7. 2. 21:51

공유하기

<IfModule mod_deflate>
  AddOutputFilterByType DEFLATE text/plain text/html text/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml application/xml application/rss+xml
  AddOutputFilterByType DEFLATE text/css application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE audio/midi

  DeflateCompressionLevel 9

  BrowserMatch ^Mozilla/4 gzip-only-text/html   # Netscape 4.xx에는 HTML만 압축해서 보냄
  BrowserMatch ^Mozilla/4\.0[678] no-gzip   # Netscape 4.06~4.08에는 압축해서 보내지 않음
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  # 자신을 Mozilla로 알리는 MSIE에는 그대로 압축해서 보냄
</ifModule>

'리눅스' 카테고리의 다른 글

my.cnf  (0) 2015.07.02
google bot 차단  (0) 2015.07.02
APM 설정  (0) 2015.07.02
syntaxHighlighter  (0) 2014.04.10
XE에서 SyntaxHighlighter 사용  (0) 2014.04.03

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

APM 설정  -  리눅스  2015. 7. 2. 21:49

공유하기

MySQL

cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1


apache

./configure \
--prefix=/usr/local/apache \
--enable-rule=SHARED_CORE \
--enable-so \
--enable-authn-alias \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-rewrite \
--enable-ssl \
--enable-cgid \
--enable-shared=max \
--enable-modules=shared \
--enable-mods-shared=all \
--enable-proxy=shared \
--enable-proxy-ajp=shared \
--enable-module=so \
--with-mpm=event \
--enable-dav \
--enable-cgi \
--enable-cgid \
--enable-vhost-alias \
--with-ssl \
--with-mpm=prefork \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre \
--enable-forward=shared \
--enable-deflate=shared \
--enable-headers=shared \
--enable-include=shared \
--enable-rewrite=shared


PHP

./configure \
--prefix=/usr/local/php \
--with-libdir=lib64 \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/apache/conf \
--with-pear=/usr/share/php \
--enable-sysvsem=yes \
--enable-sysvshm=yes \
--enable-ftp=yes \
--enable-inline-optimization \
--enable-ctype \
--enable-exif \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-mod-charset \
--enable-sockets \
--enable-static \
--enable-xml \
--enable-sigchild \
--enable-maintainer-zts \
--enable-mbregex \
--enable-fpm \
--enable-zip \
--enable-soap \
--enable-pcntl \
--enable-bcmath \
--enable-shmop \
--enable-intl \
--enable-calendar \
--enable-opcache \
--with-iconv-dir=/usr/local \
--disable-debug \
--disable-posix \
--disable-tokenizer \
--with-freetype-dir=/usr/local/freetype \
--with-ldap \
--with-ldap-sasl \
--with-gettext \
--with-openssl \
--with-curl=/usr/local \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-bz2 \
--with-iconv-dir=/usr/local \
--with-xmlrpc \
--with-kerberos \
--with-libxml-dir \
--with-mcrypt \
--with-mhash

'리눅스' 카테고리의 다른 글

google bot 차단  (0) 2015.07.02
mod_deflate  (0) 2015.07.02
syntaxHighlighter  (0) 2014.04.10
XE에서 SyntaxHighlighter 사용  (0) 2014.04.03
webalizer 설정  (0) 2014.03.31

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

syntaxHighlighter  -  리눅스  2014. 4. 10. 17:19

공유하기











 
 

'리눅스' 카테고리의 다른 글

mod_deflate  (0) 2015.07.02
APM 설정  (0) 2015.07.02
XE에서 SyntaxHighlighter 사용  (0) 2014.04.03
webalizer 설정  (0) 2014.03.31
MySQL, apache, PHP  (0) 2014.03.30

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

XE에서 SyntaxHighlighter 사용  -  리눅스  2014. 4. 3. 02:57

공유하기

<script type="text/javascript" src="/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shAutoloader.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPerl.js"></script>

<link type="text/css" rel="stylesheet" href="/syntax/styles/shCore.css" />
<link type="text/css" rel="stylesheet" href="/syntax/styles/shThemeDefault.css" />
<script type="text/javascript">
SyntaxHighlighter.defaults['toolbar'] = false; // 툴바 설정 (기본값 True)
SyntaxHighlighter.defaults['gutter'] = true; // 라인 번호 설정 (기본값 True)
SyntaxHighlighter.defaults['tab-size'] = 2; // 탭 사이즈 설정 (기본값 4)
SyntaxHighlighter.defaults['first-line'] = 1; // 라인 시작 숫자 (기본값 1)
SyntaxHighlighter.defaults['auto-links'] = false; // 링크 설정 (기본값 true)
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.all()
</script>

'리눅스' 카테고리의 다른 글

APM 설정  (0) 2015.07.02
syntaxHighlighter  (0) 2014.04.10
webalizer 설정  (0) 2014.03.31
MySQL, apache, PHP  (0) 2014.03.30
apache2 설정  (0) 2014.03.30

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

webalizer 설정  -  리눅스  2014. 3. 31. 22:11

공유하기

./configure \
--prefix=/usr/local/webalizer \
--with-language=korean \
--with-geoip-inc=/usr/local/GeoIP/include \
--with-geoip-lib=/usr/local/GeoIP/lib \
--enable-bz2 \
--with-gdlib \
--with-gd \
--with-pnglib \
--with-png \
--with-bz2lib \
--with-bz \
--enable-geoip


'리눅스' 카테고리의 다른 글

syntaxHighlighter  (0) 2014.04.10
XE에서 SyntaxHighlighter 사용  (0) 2014.04.03
MySQL, apache, PHP  (0) 2014.03.30
apache2 설정  (0) 2014.03.30
CentOS 6 릴리즈  (0) 2011.10.22

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

MySQL, apache, PHP  -  리눅스  2014. 3. 30. 20:19

공유하기

MySQL
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1

apache
./configure \
--prefix=/usr/local/apache \
--enable-rule=SHARED_CORE \
--enable-so \
--enable-authn-alias \
--enable-cache \
--enable-file-cache \
--enable-mem-cache \
--enable-disk-cache \
--enable-rewrite \
--enable-ssl \
--enable-cgid \
--enable-shared=max \
--enable-modules=shared \
--enable-mods-shared=all \
--enable-proxy=shared \
--enable-proxy-ajp=shared \
--enable-module=so \
--with-mpm=event \
--enable-dav \
--enable-cgi \
--enable-cgid \
--enable-vhost-alias \
--with-ssl \
--with-mpm=prefork \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre \
--enable-forward=shared \
--enable-deflate=shared \
--enable-headers=shared \
--enable-include=shared \
--enable-rewrite=shared

PHP
./configure \
--prefix=/usr/local/php \
--with-libdir=lib64 \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/apache/conf \
--with-pear=/usr/share/php \
--enable-sysvsem=yes \
--enable-sysvshm=yes \
--enable-ftp=yes \
--enable-inline-optimization \
--enable-ctype \
--enable-exif \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-mod-charset \
--enable-sockets \
--enable-static \
--enable-xml \
--enable-sigchild \
--enable-maintainer-zts \
--enable-mbregex \
--enable-fpm \
--enable-zip \
--enable-soap \
--enable-pcntl \
--enable-bcmath \
--enable-shmop \
--enable-intl \
--enable-calendar \
--enable-opcache \
--with-iconv-dir=/usr/local \
--disable-debug \
--disable-posix \
--disable-tokenizer \
--with-freetype-dir=/usr/local/freetype \
--with-ldap \
--with-ldap-sasl \
--with-gettext \
--with-openssl \
--with-curl=/usr/local \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-bz2 \
--with-iconv-dir=/usr/local \
--with-xmlrpc \
--with-kerberos \
--with-libxml-dir \
--with-mcrypt \
--with-mhash

make
iconv관련 링크에러가 날  경우
vi 로 Makefile 을 열어서
EXTRA_LIBS 를 찾아 -liconv 를 추가

make install


'리눅스' 카테고리의 다른 글

XE에서 SyntaxHighlighter 사용  (0) 2014.04.03
webalizer 설정  (0) 2014.03.31
apache2 설정  (0) 2014.03.30
CentOS 6 릴리즈  (0) 2011.10.22
[MySQL] 무한정 늘어나는 log-bin 파일 줄이기  (0) 2011.01.22

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

apache2 설정  -  리눅스  2014. 3. 30. 20:08

공유하기

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.ph(p[2-6]?|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>


RewriteEngine On
RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]

DirectoryIndex index.html index.htm index.php index.php3 index.php4 index.php5 index.phtml index.cgi index.jsp

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride All
    Options +ExecCGI
    Require all granted
    Order allow,deny
    Allow from all
</Directory>

'리눅스' 카테고리의 다른 글

webalizer 설정  (0) 2014.03.31
MySQL, apache, PHP  (0) 2014.03.30
CentOS 6 릴리즈  (0) 2011.10.22
[MySQL] 무한정 늘어나는 log-bin 파일 줄이기  (0) 2011.01.22
SSH 포트 변경  (1) 2010.11.09

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

CentOS 6 릴리즈  -  리눅스  2011. 10. 22. 23:44

공유하기





Centos 5.4를 한동안 사용하다 손을놓은지 꽤 됐는데 어느새 Centos 6 Releases 되었군요.
나만 모르고 있었어요 ㅠㅠ 
업데이트를 하자니 어느세월에 하나.... 엄두가 나질 않네요ㅠㅠ
마침 리눅스용 서브컴이 맛이 간 관계로 더욱 손대기가 힘들어 졌네요.
그래도 꾸준한 업데이트를 하는 Centos가 믿음직 스럽군요^^
서버용으로 Centos 만한게 없는거 같다는 1인 입니다.



July 10th 2011

The CentOS team is pleased to announce the immediate availability of CentOS-6.0 for i386 and x86_64 Architectures.

CentOS-6.0 is based on the upstream release EL 6.0 and includes
packages from all variants. All upstream repositories have been combined into one, to make it easier for end users to work with.

There are some important changes to this release compared with the previous versions of CentOS and we highly recommend reading this announcement along with the Release Notes.

There are no CD images being released with CentOS-6, however we have some CD variants in the pipeline. 

Since upstream has a 6.1 version already released, we will be using a Continous Release repository for 6.0 to bring all 6.1 and post 6.1 security updates to all 6.0 users, till such time as CentOS-6.1 is released itself. 

LiveCDs and LiveDVDs for i386 and x86_64 will be released the
next few days. These will bring in the ability to directly install from the live media.

There will also be a minimal install CD, that would bring up a base
machine with just enough content to have a usable platform. 

In order to bring back the CentOS-4 Server CD style single iso image, an LWS variant of the main distro will be created.

And now: Have fun.

Release Notes: CentOS 
Download: i386 | x86_64
 


'리눅스' 카테고리의 다른 글

MySQL, apache, PHP  (0) 2014.03.30
apache2 설정  (0) 2014.03.30
[MySQL] 무한정 늘어나는 log-bin 파일 줄이기  (0) 2011.01.22
SSH 포트 변경  (1) 2010.11.09
리눅스 서버시간 수정하기(date)  (0) 2010.11.09

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

[MySQL] 무한정 늘어나는 log-bin 파일 줄이기  -  리눅스  2011. 1. 22. 03:05

공유하기

MySQL에서 사용하는 log-bin이라는 옵션은 사용된 쿼리들이 로깅되는 파일이며 Innodb 혹은 Replication등에서 사용되곤 합니다.

하지만 이 파일의 문제는 무한정 늘어난다는 것입니다. relay-log-space-limit 같은 옵션이 있지만 이 옵션은 Replication에서 사용되는 relay-log-bin의 용량을 제한 하는 옵션이지 해결책이 되지 못합니다.

하지만 이 파일을 정리하는 방법이 있습니다. 우선 다음의 Query를 사용하는 것입니다.


PURGE MASTER LOGS BEFORE DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY)

INTERVAL에서는 원하시는 로깅 시점을 기록하시면 됩니다. 위의 경우에는 30일 이전의 로깅 정보를 삭제하게 됩니다.

차례차례 해보도록 하겠습니다.

 

1. 현재의 하드디스크 용량 상태를 확인합니다.


[root@Theeye db]# df -h 

Filesystem            Size  Used Avail Use% Mounted on 
/dev/sda1              18G  1.9G   15G  12% / 
/dev/sda3              15G  803M   13G   6% /home 
/dev/sda2              97G   78G   15G  85% /usr/local/mysql/db

데이터베이스 공간이 85%나 사용되어 곧 꽉찰지도 모른다는 불안감에 휩싸이게 되었습니다.

 

2. log-bin 파일을 확인해 봅시다.

[root@Theeye db]# ls mysql-bin.*

mysql-bin.000001  mysql-bin.000002  mysql-bin.000003 ......  mysql-bin.000073

파일이 엄청나게 많이 있습니다.

 

3. 다음 명령어를 수행합니다.

mysql -u root -p -e "PURGE MASTER LOGS BEFORE DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY)"

Enter password:

물론 mysql에 접속하셔서 위의 명령어를 입력하셔도 됩니다. Super권한을 가진 root계정으로 실행해 주세요.

 

4. log-bin 파일이 줄었나 확인해 봅시다.

[root@Theeye db]# ls mysql-bin.*

mysql-bin.000041  mysql-bin.000042  mysql-bin.000043 ......  mysql-bin.000073

 

 

41번 이전의 파일들이 모두 삭제 되었습니다. 41번 부터가 최근 30일 이내의 로그정보가 남아있는 모양이군요.

5. 하드디스크 용량 상태를 확인해 봅시다.

[root@Theeye db]# df -h

Filesystem            Size  Used Avail Use% Mounted on 
/dev/sda1              18G  1.9G   15G  12% / 
/dev/sda3              15G  803M   13G   6% /home 
/dev/sda2              97G   40G   53G  43% /usr/local/mysql/db


확실히 용량이 많이 확보가 되었군요^^

주기적인 실행이 필요하실 경우에는 위의 명령어를 crontab에 등록하시면 됩니다. 일주일에 한번정도의 실행이 적당하겠네요.

 

[출처] http://theeye.pe.kr/363

 

---------------------------------------------------------------------------------------------

 

파일이 커서 저장하지 안을려면 my.cnf 에서  log-bin 된부분을 주석 처리 해야 되고

파일 위치를 바꾸고 싶다면 log-bin = /usr/~~/file  처럼 주소를 적어주면 된다.

 

 

생성된 파일은 복구에도 사용이 가능하다.

 

기본적으로는

/usr/local/mysql/bin/mysqlbinlog /usr/local/mysql/var/localhost-bin.000001 > bakcup.sql

식으로 파일을 일반 쿼리로 컨버팅 가능하다...

 

사용할 만한 옵션으로는

 -d 데이타베이스명      이건 특정 데이타베이스만 가져온다.

 

/usr/local/mysql/bin/mysqlbinlog --start-datetime="2008-12-30 01:00:00" --stop-datetime='2009-01-10 01:00:00' /usr/local/mysql/var/localhost-bin.000001 > bakcup.sql

 

이건 시간을 지정해서 그부분만을 가져온다...

 

 

가져온걸  다시 디비로 넣을때는 . 

/usr/local/mysql/bin/mysql -u 사용자 -p  < backup.sql



'리눅스' 카테고리의 다른 글

apache2 설정  (0) 2014.03.30
CentOS 6 릴리즈  (0) 2011.10.22
SSH 포트 변경  (1) 2010.11.09
리눅스 서버시간 수정하기(date)  (0) 2010.11.09
ssh 접속시 root 접속 못하게 설정  (0) 2010.11.02

Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

SSH 포트 변경  -  리눅스  2010. 11. 9. 09:59

공유하기

SSH 포트 변경


ssh의 기본 포트인 22번을 다른 번호로 바꾸려면 다음의 두 파일을 변경하면 됩니다.

/etc/ssh/sshd_config 파일의 port 부분 수정

예) port 22 -> port 30022

/etc/services 파일에서 ssh 포트 번호 변경

위 두 작업을 완료한 후,

  
#/etc/rc.d/init.d/sshd restart

해줍니다.

error:Bind to port 22002 on : failed: address already in use

재실행후 이런메세지가 보인다면 /etc/ssh/sshd_config 에서 ListenAddres 를 지정해주지

않아서 그러니 이곳에 해당 서버 아이피를 적어주면 된다.



Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독

리눅스 서버시간 수정하기(date)  -  리눅스  2010. 11. 9. 09:52

공유하기

리눅스 서버시간 수정하기(date)


1. clock : CMOS에서 있는 시간으로 서버 시간 수정.

2. date : 서버 시간설정
#date MMDDhhmmYYYY -> 시간설정
ex)#date 072316012006 ->2006-07-23 16:01으로 수정.

3. rdate: 원결타임 서버로 부터 날짜시간 정보 구하기
#rdate [-p][-s][-u][-l] [타임서버]
ex)#rdate -s time.bora.net
#crontab -l 
00 01 * * * /usr/bin/rdate -s time.bora.net && /sbin/clock -w

rdate -s time.criss.re.kr && /sbin/clock -w




Share to Facebook Share to Twitter Share to MySpace 다음구독 한rss구독