'작업노트/LINUX'에 해당되는 글 4건

  1. 2009.01.09 cronExpress
  2. 2008.12.15 아파치 1.3 + 톰캣 5.0 연동
  3. 2007.07.02 LinuxFedoraCore6 + Apache2.2 + Tomcat5.5.23 + JDK1.6.0_01
  4. 2007.06.30 How to Install Java in Fedora Core 6 - Java Runtime Environment

For those unfamiliar with "cron", this means being able to create a firing schedule such as: "At 8:00am every Monday through Friday" or "At 1:30am every last Friday of the month".

A "Cron-Expression" is a string comprised of 6 or 7 fields separated by white space. The 6 mandatory and 1 optional fields are as follows:

Field Name   Allowed Values   Allowed Special Characters
Seconds   0-59   , - * /
Minutes   0-59   , - * /
Hours   0-23   , - * /
Day-of-month   1-31   , - * ? / L W C
Month   1-12 or JAN-DEC   , - * /
Day-of-Week   1-7 or SUN-SAT   , - * ? / L C #
Year (Optional)   empty, 1970-2099   , - * /

The '*' character is used to specify all values. For example, "*" in the minute field means "every minute".

The '?' character is allowed for the day-of-month and day-of-week fields. It is used to specify 'no specific value'. This is useful when you need to specify something in one of the two fileds, but not the other. See the examples below for clarification.

The '-' character is used to specify ranges For example "10-12" in the hour field means "the hours 10, 11 and 12".

The ',' character is used to specify additional values. For example "MON,WED,FRI" in the day-of-week field means "the days Monday, Wednesday, and Friday".

The '/' character is used to specify increments. For example "0/15" in the seconds field means "the seconds 0, 15, 30, and 45". And "5/15" in the seconds field means "the seconds 5, 20, 35, and 50". You can also specify '/' after the '*' character - in this case '*' is equivalent to having '0' before the '/'.

The 'L' character is allowed for the day-of-month and day-of-week fields. This character is short-hand for "last", but it has different meaning in each of the two fields. For example, the value "L" in the day-of-month field means "the last day of the month" - day 31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself, it simply means "7" or "SAT". But if used in the day-of-week field after another value, it means "the last xxx day of the month" - for example "6L" means "the last friday of the month". When using the 'L' option, it is important not to specify lists, or ranges of values, as you'll get confusing results.

The 'W' character is allowed for the day-of-month field. This character is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify "15W" as the value for the day-of-month field, the meaning is: "the nearest weekday to the 15th of the month". So if the 15th is a Saturday, the trigger will fire on Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th. However if you specify "1W" as the value for day-of-month, and the 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only be specified when the day-of-month is a single day, not a range or list of days.

The 'L' and 'W' characters can also be combined for the day-of-month expression to yield 'LW', which translates to "last weekday of the month".

The '#' character is allowed for the day-of-week field. This character is used to specify "the nth" XXX day of the month. For example, the value of "6#3" in the day-of-week field means the third Friday of the month (day 6 = Friday and "#3" = the 3rd one in the month). Other examples: "2#1" = the first Monday of the month and "4#5" = the fifth Wednesday of the month. Note that if you specify "#5" and there is not 5 of the given day-of-week in the month, then no firing will occur that month.

The 'C' character is allowed for the day-of-month and day-of-week fields. This character is short-hand for "calendar". This means values are calculated against the associated calendar, if any. If no calendar is associated, then it is equivalent to having an all-inclusive calendar. A value of "5C" in the day-of-month field means "the first day included by the calendar on or after the 5th". A value of "1C" in the day-of-week field means "the first day included by the calendar on or after sunday".

The legal characters and the names of months and days of the week are not case sensitive.

Here are some full examples:

Expression   Meaning
"0 0 12 * * ?"   Fire at 12pm (noon) every day
"0 15 10 ? * *"   Fire at 10:15am every day
"0 15 10 * * ?"   Fire at 10:15am every day
"0 15 10 * * ? *"   Fire at 10:15am every day
"0 15 10 * * ? 2005"   Fire at 10:15am every day during the year 2005
"0 * 14 * * ?"   Fire every minute starting at 2pm and ending at 2:59pm, every day
"0 0/5 14 * * ?"   Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
"0 0/5 14,18 * * ?"   Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day
"0 0-5 14 * * ?"   Fire every minute starting at 2pm and ending at 2:05pm, every day
"0 10,44 14 ? 3 WED"   Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
"0 15 10 ? * MON-FRI"   Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
"0 15 10 15 * ?"   Fire at 10:15am on the 15th day of every month
"0 15 10 L * ?"   Fire at 10:15am on the last day of every month
"0 15 10 ? * 6L"   Fire at 10:15am on the last Friday of every month
"0 15 10 ? * 6L"   Fire at 10:15am on the last Friday of every month
"0 15 10 ? * 6L 2002-2005"   Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005
"0 15 10 ? * 6#3"   Fire at 10:15am on the third Friday of every month

Pay attention to the effects of '?' and '*' in the day-of-week and day-of-month fields! 

작업노트/LINUX l 2009. 1. 9. 17:24
http://wwww.okjsp.pe.kr/seq/29151

유의할점은..
아파치 설치시
# --enable-module=so 를 해줘야 한다.

안그러면, 아파치를 구동할때 에러가 난다.



또한, 톰캣이 깔려있는 
/home/유저명 디렉토리의 퍼미션이 711 이어야 한다는 점
# chmod 711 [디렉토리명] 으로 퍼미션을 수정해야 한다.

안그러면 페이지 접속시에 

You don't have permission to access / on this server

요런 메시지가 뜬다.
작업노트/LINUX l 2008. 12. 15. 11:31

LinuxFedoraCore6 + Apache2.2 + Tomcat5.5.23 + JDK1.6.0_01

1.리눅스 설치
공짜인 fedora core6란 놈으로 설치결정.
무조건 yes yes로 설치 종료-_-


2.아파치 설치
http://httpd.apache.org/download.cgi 이곳에서
httpd-2.2.4.tar.gz 라는 녀석을 다운받는다.

/usr/local/ 로 파일을 옮기고 압축을 푼다.
shell> tar zxvf httpd-2.2.4.tar.gz

압축을 푼 디렉토리로 이동
shell> cd httpd-2.2.4

설치를 한다.(과정에 대한 자세한 사항은 모르겠음ㅠ)
shell> ./configure --prefix=/usr/local/apache2 \(아파치가 설치될 디렉토리)
> --enable-rule=SHARED_CORE \(톰캣연동시 필요하다고..)
> --enable-modules=so \(역시 톰캣연동에 필요.)
> --enable-so (php연동시 필요하다고 한다.)
(사실 나는 첫째 줄 옵션만 적용..;;)

shell> make
shell> make install
설치 완료

shell> service httpd start 또는
shell> /usr/local/apache2/bin/apachectl start
로 아파치를 구동한다..
위, 아래 방법의 차이는 나도 모르겠다.
어떻게 service명령어로 실행이 가능한지도.. 아.. 공부해야하나 리눅스..ㅠ
가시적인 차이라면 service로 구동시키면 OK 라는 메세지를 날려주시는데
apachectl은 아무런 반응도 안보이신다. 리눅스께서..


3. JDK설치
http://java.sun.com/javase/downloads/index.jsp
이곳에서 jdk를 다운받는다.(jdk-6u1-linux-i586.rpm.bin)
페도라5에서 jdk를 rpm으로 깔게되면 경로상의 문제가 많이 발생한다는 글을
돌아다니다 본적이 있는데.. 페도라6에서는... 문제 없는듯하다.

다음,
/usr/local/ 디렉토리에 위치시킨후 실행이 가능하도록 권한을 변경한다.
shell> chmod 755 jdk-6u1-linux-i586.rpm.bin

그다음은 설치~
shell> jdk-6u1-linux-i586.rpm.bin
(중간에 y눌러서 라이센스에 동의해준다.)

그다음 파이어 폭스의 플러그인에서 사용하는 java의 링크를 변경한다
shell> ln -s /usr/java/jdk1.6.0_01/jre/plugin/i386/ns7/libjavaplugin_oji.so \
> /usr/lib/mozilla/plugins/libjavaplugin_oji.so

다음은 패스 설정
shell> vi /etc/profile 
내용중에 적당한 위치에 다음 구문을 추가

export JAVA_HOME=/usr/java/jdk1.6.0_01
export JRE_HOME=/usr/java/jdk1.6.0_01/jre

다음은 버전확인
shell> java -version

java version "1.6.0_01" 처럼 나오면 완료.
하지만 1.4.2버전으로 나왔는데 그이유는
alternatives에서 java가 manual mode로
1.4.2버전 디렉토리를 링크로 삼고있어서 그렇다고 한다.
(fedora에 포함된 기본 자바 버전)
이럴땐 다음과 같이 해준다.

shell> alternatives --auto java

or

shell> alternatives --confige java 입력후
출력되는 경로중에 알맞은 것을 선택!


4. 톰캣 설치
http://tomcat.apache.org/download-55.cgi 이곳에서
5.5.23버전을 받는다. (core라고 되있는녀석)

apache-tomcat-5.5.23.tar.gz라는 녀석을
역시 /usr/local/로 이동시킨후

푼다.
shell> tar zxvf apache-tomcat-5.5.23.tar.gz

디렉토리 이름이 너무 길어서 맘에 안든다.
심볼릭 링크를 한다.
shell> ln -s apache-tomcat-5.5.23 tomcat

그다음은..
usr/local/tomcat/conf/context.xml을 텍스트 편집기로 열어서 다음과 같이 수정.

  <Context reloadable="true">

usr/local/tomcat/conf/server.xml를 텍스트편집기로 열고,

  <Host name="localhost"... 처럼 시작되는 곳 밑에 아래내용을 추가한다.

     <Context path="" docBase="" debug="0" allowLinking="true"/>
     <Listener className="org.apache.catalina.startup.UserConfig" directoryName="public_html" userClass="org.apache.catalina.startup.PasswdUserDatabase"/>

usr/local/tomcat/conf/web.xml 을 열고

다음과 같은 부분을 찾아 주석을 해제한다.
<servlet>
  <servlet-name>invoker</servlet-name>
   <servlet-class>org.apache.catalina.servlets.InvokerServlet</servlet-class>
   <init-param>
     <param-name>debug</param-name>
     <param-value>0</param-value>
   </init-param>

   <load-on-startup>2</load-on-startup>
</servlet>


이부분도 주석해제
<servlet-mapping>
  <servlet-name>invoker</servlet-name>
  <url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

(이 부분은 확실히.. 아무생각없이 따라했다..)
 
5. 커넥터 설치
이거 아직도 잘 모르겠다..

작업노트/LINUX l 2007. 7. 2. 01:38
(출처 : http://news.softpedia.com/news/How-to-Install-Java-in-Fedora-Core-6-39724.shtml)

By default, Fedora Core 6 systems come with an old Java software installed, so you need to install a newer version of Java Runtime Environment to enjoy all the Java applications out there. In this quick guide, I will teach you how to update/install your Java Environment.

Let's begin by downloading the latest version of JRE (Java Runtime Environment) from here. Just click on the Download link where it says Java Runtime Environment (JRE) 5.0 Update, then you’ll need to accept the license and download the Linux self-extracting file.

WARNING: Please remember to always replace the xx from the jre-1_5_0_xx-linux-i586.bin file with the latest version. At the moment of this guide’s writing, the latest version was 09, so the file should look like this: jre-1_5_0_09-linux-i586.bin

After you have finished downloading the file, you need to move it into the /opt folder. Open a console and type:

mv jre-1_5_0_xx-linux-i586.bin /opt

Now, you will need to make this file executable so you can extract it. Follow the commands below:

cd /opt - so you can go into the /opt directory
chmod +x jre-1_5_0_xx-linux-i586.bin

And now, let's run the executable file with the following command:

./jre-1_5_0_xx-linux-i586.bin

You'll be prompted with the License Agreement, hit space until you are asked if you agree or not. Type Yes and the extraction process will begin. After the extraction process is finished, just remove the binary file with the following command:

rm -rf jre-1_5_0_xx-linux-i586.bin

Now, let's put the Java plugin into your browser's plugin folder. Konqueror, Firefox and Mozilla browsers will all look into the same folder, for plugins. So type the following command:

ln -s /opt/jre1.5.0_xx/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so

Well, now you need to make the Java executable available for the whole system, so you can run all the Java applications you encounter. Create the following file with your preferred text editor:

kwrite /etc/profile.d/java.sh

Now paste the following options into the file, remember to enter a carriage return after these lines, then save it. Remember to replace the xx with the latest version you have downloaded:

export J2RE_HOME=/opt/jre1.5.0_xx
export PATH=$J2RE_HOME/bin:$PATH


Now, type the following command to make that file available:

source /etc/profile.d/java.sh

Then type this command to see if the path is correct:

which java

You will see something like this: /opt/jre1.5.0_09/bin/java

Then type these commands:

/usr/sbin/alternatives --install /usr/bin/java java /opt/jre1.5.0_xx/bin/java 2
/usr/sbin/alternatives --config java

After you have entered the last command, you'll be asked to choose which Java software you want for your system. Just press 2 key and hit enter.

And finally, just type this command to see if everything looks good and your system has a new Java Environment:

/usr/sbin/alternatives --display java

And you can also type this command to see the version of your Java Runtime Environment:

java -version

Mine looks like this:

java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b01)
Java HotSpot(TM) Client VM (build 1.5.0_09-b01, mixed mode, sharing)


You should now be able to run most of the Java applications out there, with the commands like:

java -jar application.jar

or

javaws application.jnlp

Enjoy!
작업노트/LINUX l 2007. 6. 30. 02:47
1 

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

카테고리

분류 전체보기 (117)
작업노트 (98)
Error Handling (19)
JAVA (8)
JSP & Servlet (6)
Framework (10)
HTML & Script (15)
IDE (3)
LINUX (4)
Books (2)
Search Engine (7)
etc. (10)
Developer's Diary (13)
Patterns (0)
Database (1)
거미줄세상 (12)
쌓기 (1)
책읽기 (0)
Reviews (4)

달력

«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
get rsstistory! Tistory Tistory 가입하기!