SW2018. 12. 27. 10:31





svn,apache  설정이 완료되어 있는경우



centos7 + apache2.2+svn1.7 
모듈 설치
yum install mod_dav_svn 
연동 설정
vi /etc/httpd/conf.module.d/10-subversion.conf
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
LoadModule dontdothat_module  modules/mod_dontdothat.so
<Location /svn>
DAV svn
SVNParentPath /root/svn/
AuthType Basic
AuthName "Remo Repository"
AuthUserFile /root/svn/svn-passwd
##AuthzSVNAccessFile /root/svn/svn-authz
Require valid-user
</Location> 
패스워드 htpasswd -cm /root/svn/svn-passwd userid  -c 옵션 최초설정
htpasswd -m /root/svn/svn-passwd userid2 추가설정
권한 설정
chown -R apache.apache /root
재시작 systemctl restart httpd.service
http://localhost/svn/repo1

추가로   ssl 관련 설정을 할수 있으면 centos7 에는  apache ssl 관련 설정이 미리 되어 있는경우가 있습니다.

'SW' 카테고리의 다른 글

[SVN]centos7+svn(subversion1.7.4)  (0) 2018.12.12
[SVN] 구조 활용법  (0) 2014.02.20
[SW] 버전 관리 프로그램 (SVN,CVS,GIT)  (0) 2014.02.10
Posted by idwook
SW2018. 12. 12. 16:04
centos7+subversion.1.7.4(svn)
인스톨
yum list subversion
yum install -y subversion
svn용폴더 생성
mkdir /root/svn
svn 설정
실행옵션수정
vi /etc/sysconfig/svnserve
OPTIONS="-r /root/svn"
방화벽해제
firewall-cmd --permanent --zone=public --add-port=3690/tcp
firewall-cmd --reload
svn 서비스 실행
systemctl start svnserve.service
systemctl stop svnserve.service
systemctl restart svnserve.service
svn 자동실행 등록
systemctl enable svnserve.service
저장소 생성
svnadmin create --fs-type fsfs test
저장소 설정
vi /root/svn/test/conf/svnserve.conf
anon-access =read 로그인하지 않은 사용자 권한
auth-access=write 로그인한 사용자 권한
password-db=passwd 계정비밀번호 설정자
auth-db=authz 파일디렉토리 권한 설정자
 
vi /root/svn/test/conf/passwd
[users]
root=root root사용자 패스워드 root
admin=admin admin 사용자 패스워드 admin
vi /root/svn/test/conf/authz
[/]
*=r 모든사용자 read권한
root=rw root사용자 read,write권한
admin=rw admin사용자 read,write 권한
저장소 설정후 재실행
systemctl restart svnserve.service
svn명령어
svn list svn://localhost/test
svn info svn://localhost/test
기타 selinux 해제
vi /etc/selinux/config 
SELINUX=disabled 
폴더 권한 
chmod -R g+ws test


'SW' 카테고리의 다른 글

[SVN] centos7 + apache2.2+svn1.7 연동  (0) 2018.12.27
[SVN] 구조 활용법  (0) 2014.02.20
[SW] 버전 관리 프로그램 (SVN,CVS,GIT)  (0) 2014.02.10
Posted by idwook
Java2018. 3. 7. 09:21

import java.awt.Color;

import java.awt.Font;

import java.awt.FontMetrics;

import java.awt.Graphics2D;

import java.awt.Image;

import java.awt.RenderingHints;

import java.awt.font.FontRenderContext;

import java.awt.font.LineMetrics;

import java.awt.geom.Rectangle2D;

import java.awt.image.BufferedImage;

import java.io.File;

import java.io.IOException;

import java.util.HashMap;


import javax.imageio.ImageIO;


import org.apache.log4j.Logger;


public class ImageUtil {

public final static Logger LOG = Logger.getLogger(ImageUtil.class);

public static final HashMap<RenderingHints.Key, Object> RenderingProperties = new HashMap<>();


static{

    RenderingProperties.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

    RenderingProperties.put(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);

    RenderingProperties.put(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);

}


public static BufferedImage textToImage(int width,int height,String Text, Font f, float Size,String fileName,boolean isFile) throws IOException{

    //Derives font to new specified size, can be removed if not necessary.

  try{

double size = height/3;

if(width>height) size = height/3;

else size =width/3;

if(size<1) size =1;

if(f == null) f  = new Font("Arial", Font.PLAIN, (int) size);

    f = f.deriveFont((float)size);

   

    FontRenderContext frc = new FontRenderContext(null, true, true);

    //Calculate size of buffered image.

   

    //LineMetrics lm = f.getLineMetrics(Text, frc);

    LOG.debug("textToImage...2 "+frc.toString());

    char[] array = Text.toCharArray();

    Rectangle2D r2d = f.getStringBounds(array, 0, array.length, frc);

/*     Rectangle2D r2d = f.getStringBounds(Text, frc);*/

    LOG.debug("textToImage...3 ");

    if(r2d.getWidth() > width) {

    size=size/1.5;

    if(size <1) size = 1;

    f  = new Font("Arial", Font.PLAIN, (int) size);

    f = f.deriveFont((float)size);

    frc = new FontRenderContext(null, true, true);

  

   // lm = f.getLineMetrics(Text, frc);

    r2d = f.getStringBounds(Text, frc);

    }

   

    double realHeight = r2d.getHeight();

    double realWidth = r2d.getWidth();

   

  // BufferedImage img = new BufferedImage((int)Math.ceil(r2d.getWidth()), (int)Math.ceil(r2d.getHeight()), BufferedImage.TYPE_INT_RGB);

    BufferedImage img = new BufferedImage((int)Math.ceil(width), (int)Math.ceil(height), BufferedImage.TYPE_INT_RGB);


    Graphics2D g2d = img.createGraphics();


    g2d.setRenderingHints(RenderingProperties);

    

    Color backColor = new Color(45, 108, 147);

    g2d.setBackground(backColor);

    g2d.setColor(Color.WHITE);


    g2d.clearRect(0, 0, img.getWidth(), img.getHeight());


    g2d.setFont(f);

    

   // g2d.drawString(Text, 0, lm.getAscent());

    g2d.drawString(Text, (float) ((width/2)-(realWidth/2)), (float) ((height/2)+(realHeight/4)));

    g2d.dispose();

    if(isFile) ImageIO.write(img, "jpg", new File(fileName));

 

    return img;

  }catch(Exception e){

    LOG.error(e);

    throw e;

    }

}

public static BufferedImage textToImage1(int width,int height,String Text, Font f, float Size,String fileName,boolean isFile) throws IOException{

BufferedImage img = new BufferedImage((int)Math.ceil(width), (int)Math.ceil(height), BufferedImage.TYPE_INT_RGB);

Graphics2D g2d = img.createGraphics();

boolean sizeOk = false;

    

    

double size = height/3;

if(width>height) size = height/3;

else size =width/3;

int realWidth = 10;

int realHeight = 10;

while(!sizeOk){

if(f == null) f  = g2d.getFont();

    f = f.deriveFont((float)size);

    FontMetrics fm = g2d.getFontMetrics(f);

    realWidth = fm.stringWidth(Text);

    realHeight = fm.getHeight();

    size=size/1.5;

    if(realWidth<width || size<0) sizeOk = true;

    

}

    

    g2d.setRenderingHints(RenderingProperties);

    

    Color backColor = new Color(45, 108, 147);

    g2d.setBackground(backColor);

    g2d.setColor(Color.WHITE);


    g2d.clearRect(0, 0, img.getWidth(), img.getHeight());


    g2d.setFont(f);

    

   // g2d.drawString(Text, 0, lm.getAscent());

    g2d.drawString(Text, (float) ((width/2)-(realWidth/2)), (float) ((height/2)+(realHeight/4)));

    g2d.dispose();

    if(isFile) ImageIO.write(img, "jpg", new File(fileName));

 

    return img;

}

public static BufferedImage resizeImage(BufferedImage image, int width, int height) {

float w = new Float(width) ;

float h = new Float(height) ;


if ( w <= 0 && h <= 0 ) {

w = image.getWidth();

h = image.getHeight();

} else if ( w <= 0 ) {

w = image.getWidth() * ( h / image.getHeight() ); 

} else if ( h <= 0 ) {

h = image.getHeight() * ( w / image.getWidth() ); 

}


int wi = (int) w;

int he = (int) h;


BufferedImage resizedImage = new BufferedImage(wi,he,BufferedImage.TYPE_INT_RGB);


resizedImage.getGraphics().drawImage(

image.getScaledInstance(wi,he,Image.SCALE_AREA_AVERAGING),

0,0,wi,he,null

);


return resizedImage;


}

}



'Java' 카테고리의 다른 글

System.getProperty("user.dir") 무조건 C:\WINDOWS\System32 인경우  (0) 2017.06.20
Thread Waiting 기능  (0) 2016.07.01
Posted by idwook