java, c# , linux, program devloper: PHP 카테고리 글 목록
http://blog1.phps.kr/
blog.visualp.com
2021-05-29T01:03:57+09:00
Textcube 1.10.7 : Tempo primo
php error 출력
java, tomcat, c#
http://blog1.phps.kr/758
2019-11-06T14:44:07+09:00
2019-11-06T14:44:03+09:00
<p style="line-height: 2;"><strong><span style="font-family: Verdana;">error_reporting(E_ALL);<strong><span style="font-family: Verdana;"><br />ini_set("display_errors", 1);<br /><br />php 상단에 위와 같이 선언 <br />오류 출력 해줌<br /></span></strong></span></strong></p><p><strong><a href="http://blog1.phps.kr/758?commentInput=true#entry758WriteComment">댓글 쓰기</a></strong></p>
apache 특정 폴더 접근 막기
java, tomcat, c#
http://blog1.phps.kr/755
2019-05-16T23:41:17+09:00
2019-05-16T23:41:14+09:00
.htaccess 파일에 아래와 같이 막을 폴더 경로를 설정 한다.<br />RedirectMatch 403 ^/data/*<br /><br /><p><strong><a href="http://blog1.phps.kr/755?commentInput=true#entry755WriteComment">댓글 쓰기</a></strong></p>
SQL Server CONVERT for Datetime in MySQL
java, tomcat, c#
http://blog1.phps.kr/745
2018-04-27T22:47:17+09:00
2018-04-27T22:47:12+09:00
In <acronym title="Structured Query Language">SQL</acronym> Server, you can use CONVERT function to convert a string with the specified format to a DATETIME value. In MySQL, you can use STR_TO_DATE function if you need a specific format, or CONVERT if you need the default format.
<p>Note that the order of parameters in <acronym title="Structured Query Language">SQL</acronym> Server and MySQL CONVERT functions is different. <a class="media" title="exclamation.png" href="http://www.sqlines.com/_detail/exclamation.png?id=sql-server-to-mysql%3Afunctions%3Aconvert_datetime"><img class="media" src="http://www.sqlines.com/_media/exclamation.png" alt="" /></a></p>
<p><strong><acronym title="Structured Query Language">SQL</acronym> Server</strong>:</p>
<pre class="code sql"> <span class="co1">-- 3rd parameter specifies 121 style (ODBC 'YYYY-MM-DD HH:MI:SS.FFF' format with milliseconds)</span>
<span class="kw1">SELECT</span> CONVERT<span class="br0">(</span><span class="kw1">DATETIME</span><span class="sy0">,</span> <span class="st0">'2012-11-29 18:21:11.123'</span><span class="sy0">,</span> 121<span class="br0">)</span>;
<span class="co2"># 2012-11-29 18:21:11.123</span>
<span class="kw1">SELECT</span> CONVERT<span class="br0">(</span><span class="kw1">DATETIME</span><span class="sy0">,</span> GETDATE<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>;
<span class="co2"># 2017-04-07 09:55:40.550</span></pre>
<p><strong>MySQL</strong>:</p>
<pre class="code sql"> <span class="co1">-- Specify string format using format specifiers</span>
<span class="kw1">SELECT</span> STR_TO_DATE<span class="br0">(</span><span class="st0">'2012-11-29 18:21:11.123'</span><span class="sy0">,</span> <span class="st0">'%Y-%m-%d %T.%f'</span><span class="br0">)</span>;
<span class="co2"># 2012-11-29 18:21:11.123000</span>
<span class="kw1">SELECT</span> CONVERT<span class="br0">(</span>NOW<span class="br0">(</span><span class="br0">)</span><span class="sy0">,</span> <span class="kw1">DATETIME</span><span class="br0">)</span>;
<span class="co2"># 2017-04-07 09:55:40</span></pre>
<h2><a id="mapping-sql-server-datetime-style-to-mysql-format" name="mapping-sql-server-datetime-style-to-mysql-format"></a>Mapping SQL Server Datetime Style to MySQL Format</h2>
<div class="level2">
<p>When you convert CONVERT function to STR_TO_DATE you have to map the <acronym title="Structured Query Language">SQL</acronym> Server style to the appropriate format string in MySQL:</p>
<table class="inline">
<tbody>
<tr class="row0">
<td class="col0" colspan="2"><strong><acronym title="Structured Query Language">SQL</acronym> Server Style</strong></td>
<td class="col2"><strong>MySQL Format String</strong></td>
<td class="col3"><strong>String Example</strong></td>
</tr>
<tr class="row1">
<td class="col0">101</td>
<td class="col1">US - MM/DD/YYYY</td>
<td class="col2">'%m/%d/%Y'</td>
<td class="col3">'11/29/2012'</td>
</tr>
<tr class="row2">
<td class="col0">121</td>
<td class="col1">ODBC - YYYY-MM-DD HH:MI:SS.FFF</td>
<td class="col2">'%Y-%m-%d %T.%f'</td>
<td class="col3">'2012-11-29 18:21:11.123'</td>
</tr>
</tbody>
</table>
<p>Conversion examples:</p>
<table class="inline">
<tbody>
<tr class="row0">
<td class="col0"><strong><acronym title="Structured Query Language">SQL</acronym> Server</strong></td>
<td class="col1"><strong>MySQL</strong></td>
</tr>
<tr class="row1">
<td class="col0">CONVERT(DATETIME, '11/29/2012', 101)</td>
<td class="col1">STR_TO_DATE('11/29/2012', '%m/%d/%Y')</td>
</tr>
<tr class="row2">
<td class="col0">CONVERT(DATETIME, '2012-11-29 18:21:11.123', 121)</td>
<td class="col1">STR_TO_DATE('2012-11-29 18:21:11.123', '%Y-%m-%d %T.%f')</td>
</tr>
</tbody>
</table>
</div>
<h2><a id="sql-server-convert-for-smalldatetime-in-mysql" name="sql-server-convert-for-smalldatetime-in-mysql"></a>SQL Server CONVERT for SMALLDATETIME in MySQL</h2>
<div class="level2">
<p>In <acronym title="Structured Query Language">SQL</acronym> Server SMALLDATETIME data type stores a datetime value with 00 seconds. You can use the expression below to keep 00 seconds after using the CONVERT function in MySQL:</p>
<p><strong><acronym title="Structured Query Language">SQL</acronym> Server</strong>:</p>
<pre class="code sql"> <span class="co1">-- SMALLDATETIME is always with 00 seconds</span>
<span class="kw1">SELECT</span> CONVERT<span class="br0">(</span>SMALLDATETIME<span class="sy0">,</span> GETDATE<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>;
<span class="co2"># 2017-04-07 10:05:00</span></pre>
<p><strong>MySQL</strong>:</p>
<pre class="code sql"> <span class="kw1">SELECT</span> CONVERT<span class="br0">(</span>DATE_FORMAT<span class="br0">(</span>NOW<span class="br0">(</span><span class="br0">)</span><span class="sy0">,</span> <span class="st0">'%Y-%m-%d %H-%i-00'</span><span class="br0">)</span><span class="sy0">,</span> <span class="kw1">DATETIME</span><span class="br0">)</span>;
<span class="co2"># 2017-04-07 10:05:00</span></pre>
</div><p><strong><a href="http://blog1.phps.kr/745?commentInput=true#entry745WriteComment">댓글 쓰기</a></strong></p>
영카트5 ,선택옵션 0원 노출 안되도록 설정
java, tomcat, c#
http://blog1.phps.kr/744
2018-04-09T17:50:23+09:00
2018-04-09T17:50:20+09:00
[원문]<br />lib/shop.lib.php <br /><br />#1 <br />
<div class="syntaxhighlighter php" id="highlighter_179233">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] >= 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>2</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp;+ '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>3</code></td>
<td class="content"><code class="php keyword">else</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>4</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp; '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />를 <br />
<div class="syntaxhighlighter php" id="highlighter_706741">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] > 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>2</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp;+ '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>3</code></td>
<td class="content"><code class="php keyword">else</code> <code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] == 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>4</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">''</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>5</code></td>
<td class="content"><code class="php keyword">else</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>6</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp; '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />로 수정 <br /><br /><br />#2 <br />
<div class="syntaxhighlighter php" id="highlighter_222194">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] >= 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>2</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp;+ '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>3</code></td>
<td class="content"><code class="php keyword">else</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>4</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp; '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />를 <br />
<div class="syntaxhighlighter php" id="highlighter_600897">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php keyword">if</code><code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] > 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>2</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp;+ '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>3</code></td>
<td class="content"><code class="php keyword">else</code> <code class="php keyword">if</code> <code class="php plain">(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">] == 0)</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>4</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">''</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>5</code></td>
<td class="content"><code class="php keyword">else</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>6</code></td>
<td class="content"><code class="spaces"> </code><code class="php variable">$price</code> <code class="php plain">= </code><code class="php string">'&nbsp;&nbsp; '</code><code class="php plain">.number_format(</code><code class="php variable">$row</code><code class="php plain">[</code><code class="php string">'io_price'</code><code class="php plain">]).</code><code class="php string">'원'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />로 수정 <br /><br />js/shop.js <br /><br />#1 <br />
<div class="syntaxhighlighter php" id="highlighter_357339">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php keyword">var</code> <code class="php plain">priceHide = </code><code class="php string">''</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
<div class="line alt2">
<table>
<tbody>
<tr>
<td class="number"><code>2</code></td>
<td class="content"><code class="php keyword">if</code> <code class="php plain">(parseInt(price) == 0) priceHide = </code><code class="php string">' sound_only'</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />를 add_sel_option 에 추가 <br /><br />#2 <br />
<div class="syntaxhighlighter php" id="highlighter_544530">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php plain">opt += </code><code class="php string">"<span class=\"sit_opt_prc\">"</code><code class="php plain">+opt_prc+</code><code class="php string">"</span>"</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />를 <br />
<div class="syntaxhighlighter php" id="highlighter_488214">
<div class="bar ">
<div class="toolbar"><a class="item viewSource" style="width: 16px; height: 16px;" title="view source" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#viewSource">view source</a>
<div class="item copyToClipboard"></div>
<a class="item printSource" style="width: 16px; height: 16px;" title="print" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#printSource">print</a><a class="item about" style="width: 16px; height: 16px;" title="?" href="https://sir.kr/bbs/board.php?bo_table=yc5_tip&wr_id=252?bo_table=yc5_tip&wr_id=252#about">?</a></div>
</div>
<div class="lines">
<div class="line alt1">
<table>
<tbody>
<tr>
<td class="number"><code>1</code></td>
<td class="content"><code class="php plain">opt += </code><code class="php string">"<span class=\"sit_opt_prc"</code><code class="php plain">+priceHide+</code><code class="php string">"\">"</code><code class="php plain">+opt_prc+</code><code class="php string">"</span>"</code><code class="php plain">;</code></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />로 수정 <br /><br /><p><strong><a href="http://blog1.phps.kr/744?commentInput=true#entry744WriteComment">댓글 쓰기</a></strong></p>
phpmyadmin timeout 시간 설정
java, tomcat, c#
http://blog1.phps.kr/711
2016-05-19T17:20:21+09:00
2016-05-19T17:20:18+09:00
config.inc.php <br />add to below end of line !~<br />$cfg['LoginCookieValidity']=3600*24*365;<p><strong><a href="http://blog1.phps.kr/711?commentInput=true#entry711WriteComment">댓글 쓰기</a></strong></p>
php GET , POST 변수 바인딩
java, tomcat, c#
http://blog1.phps.kr/699
2015-11-04T18:01:25+09:00
2015-11-04T18:01:23+09:00
foreach($_REQUEST as $key => $value ){<br /> ${"$key"} = $value;<br />}<p><strong><a href="http://blog1.phps.kr/699?commentInput=true#entry699WriteComment">댓글 쓰기</a></strong></p>
vsftpd 설정 cent 6.6
java, tomcat, c#
http://blog1.phps.kr/686
2015-05-14T20:48:26+09:00
2015-05-14T20:48:23+09:00
원문 [http://junhyung2.blogspot.kr/2015/02/centos-vsftpd.html]<br />
<div class="post-header"> </div>
<div id="post-body-6472179106130512465" class="post-body entry-content">
<h2><span style="font-size: x-large;">centos에 vsftpd 설치하기</span></h2>
<div>윈도우에서 리눅스에 파일을 업로드하기 위해서는 리눅스 서버에 ftp를 설치해야 합니다. 그래서 이번에는 파일을 업로드하기 위해서 vsftpd를 설치하도록 하겠습니다. vsftpd는 많은 리눅스 개발 단체에서 기본 ftp 데몬으로 사용하고 있을 정도로 활용성과 보안면에서 뛰어난 데몬이라고 합니다. </div>
<div> </div>
<div>vsftpd는 centos 6.6에서 설치했습니다.</div>
<div> </div>
<div><strong><span style="font-size: large;">1. vsftpd 설치하기</span></strong></div>
<div> </div>
<div># yum install -y vsftpd</div>
<div> </div>
<div><strong><span style="font-size: large;">2. vsftpd.conf 설정하기</span></strong></div>
<div> </div>
<div># vi /etc/vsftpd/vsftpd.conf</div>
<div> </div>
<div>밑에 해당하는 줄을 찾아서 다음과 같이 변경합니다.</div>
<div> </div>
<div>
<div>anonymous_enable=NO //익명 접속 가능 여부</div>
<div>local_enable=YES // 로컬 계정 사용자의 접속 허용 여부</div>
<div>write_enable=YES // write 명령어 허용 여부</div>
<div>local_umask=022 // 로컬 계정 사용자용 umask</div>
<div>xferlog_enable=YES // 파일 전송 로그 기록 여부</div>
<div>connect_from_port_20=YES // 20번 포트로 접속 허용 여부</div>
<div>xferlog_file=/var/log/xferlog // 파일 전송 로그 파일명</div>
<div>xferlog_std_format=YES // xferlog 표준 포맷으로 로그를 남길지 여부</div>
<div>chroot_local_user=YES // 사용자의 홈 디렉토리를 변경 제한을 위한 설정</div>
<div>listen=YES // standalone으로 운영하려면 YES</div>
<div>pam_service_name=vsftpd // PAM 파일명을 지정</div>
<div>userlist_enable=YES</div>
<div>tcp_wrappers=YES</div>
</div>
<div> </div>
<div><strong><span style="font-size: large;">3. 방화벽에 포트 추가</span></strong></div>
<div> </div>
<div># vi /etc/sysconfig/iptables</div>
<div> </div>
<div>밑의 줄을 추가합니다.</div>
<div> </div>
<div>
<div>-A INPUT -m state --state NEW -m tcp -p tcp --dport 20:21 -j ACCEPT</div>
</div>
<div> </div>
<div><strong><span style="font-size: large;">4. 데몬 재시작 및 chkconfig에 등록</span></strong></div>
<div> </div>
<div># /etc/init.d/iptables restart</div>
<div># /etc/init.d/vsftpd start</div>
<div># chkconfig vsftpd on</div>
</div><p><strong><a href="http://blog1.phps.kr/686?commentInput=true#entry686WriteComment">댓글 쓰기</a></strong></p>
icode , fsockopen 에러 발생 시
java, tomcat, c#
http://blog1.phps.kr/650
2014-07-14T17:06:12+09:00
2014-07-14T17:06:08+09:00
<P>그누모드 이용해서 사이트 구축 하다보면 icodekorea.com과 sms 서비스 연동을 <BR>하는 모듈을 사용하게 되면, 에러가 발생한다. <BR>에러인즉 fsockopen 함수를 사용하여 주고 받게 되는대 <BR>동작을 하지 않는다는거 ..<BR><BR>서버에서 정상적으로 라우팅을 못하는 문제 임으로<BR>./etc/network 에 다음과 같이 추가 해준다.<BR>211.172.232.124 wwww.icodekorea.com</P>
<P>network 재시작<BR>하면 해결됨 </P><p><strong><a href="http://blog1.phps.kr/650?commentInput=true#entry650WriteComment">댓글 쓰기</a></strong></p>
kimsq rb , 사이트 이전시 password관련하여 처리 해주면 좋은 유용한 팁
java, tomcat, c#
http://blog1.phps.kr/649
2014-07-14T16:46:53+09:00
2014-07-14T16:46:49+09:00
[원문] <A href="http://www.kimsq.co.kr/note/sky/14015">http://www.kimsq.co.kr/note/sky/14015</A><BR><BR>zboard를 비롯한 예전 프로그램들에서 Rb로 이전 후
<DIV>Mysql의 버전과 Rb의 패스워드 암호화 방식이 md5로 바뀜으로 인해 (old_password, password) </DIV>
<DIV>로그인 실패 시 이전 암호 방식과 비교하여 강제적으로 암호를 md5 방식으로 변환 해 저장하는 팁을 소개합니다.</DIV>
<DIV>"/rb/modules/home/lang.korean/action/a.login.php"를 여신 후</DIV>
<DIV>15번째 라인 </DIV>
<DIV>
<DIV>$d['member']['login_emailid'] = (strpos($id,'@')) ? 1:0;</DIV>
<DIV>아래에 다음과 같이 dbupdate Query문을 추가합니다.</DIV>
<DIV>/////////////////////////////////////////////////////////////////////////</DIV>
<DIV>getDbUpdate($table['s_mbrid'],"pw='".md5($pw)."'","pw=old_password('".$pw."') and id='".$id."'");</DIV>
<DIV>/////////////////////////////////////////////////////////////////////////</DIV></DIV>
<DIV>위 구문은 로그인 창에 입력한 아이디의 패스워드 값이 예전 방식(old_password)의 암호와 아이디 패스워드 값이 </DIV>
<DIV>일치할 경우 해당 패스워드를 md5로 바꾸어 저장해 줍니다.</DIV>
<DIV>단, 매번 로그인 시 해당 업데이트 쿼리가 작동하므로, 운영 중인 웹사이트 공지하셔서</DIV>
<DIV>Rb 변환 후 일정 기간동안 운영 후 삭제하시는게 좋을 듯 합니다.</DIV>
<DIV>위와 동일한 문제를 겪고 있으시다면 참고 하셔서 도움이 되셨으면 좋겠네요.</DIV>
<DIV>이상 Sky~~~ 였습니다.</DIV><p><strong><a href="http://blog1.phps.kr/649?commentInput=true#entry649WriteComment">댓글 쓰기</a></strong></p>
php 날자 일수 차이 계산하기
java, tomcat, c#
http://blog1.phps.kr/638
2014-02-05T16:43:28+09:00
2014-02-05T16:07:50+09:00
<p>[원문 ] : <a href="http://bloodguy.tistory.com/entry/PHP-%EB%82%A0%EC%A7%9C-%EC%9D%BC%EC%88%98-%EC%B0%A8%EC%9D%B4-%EA%B3%84%EC%82%B0-datediff-DateTimeDateInterval">http://bloodguy.tistory.com/entry/PHP-%EB%82%A0%EC%A7%9C-%EC%9D%BC%EC%88%98-%EC%B0%A8%EC%9D%B4-%EA%B3%84%EC%82%B0-datediff-DateTimeDateInterval</a><br><br>정확한 날짜 일수를 계산하기 위한 간편한 방법.<br>여러가지 방법들이 산더미 같이 있겠지만 다 귀찮고 DateTime, DateInterval 객체를 이용하는 가장 간단한 방법.<br><br><?PHP /*5.3 이상에서*/<br><br>$시작일 = new DateTime('2012-01-01'); // 20120101 같은 포맷도 잘됨<br>$종료일 = new DateTime('2012-10-11');<br>// $차이 는 DateInterval 객체. var_dump() 찍어보면 대충 감이 옴.<br>$차이 = date_diff($시작일, $종료일);<br>echo $차이->days; // 284<br>?><br><br>/*php 5.2 버전 에서*/<br><?php<br>$start = new DateTime('2010-10-12');<br>$end = new DateTime('2010-10-15');<br>$days = round(($end->format('U') - $start->format('U')) / (60*60*24));<br>echo $days;<br>?><br><br>[참조]<br><a href="http://www.php.net/manual/en/datetime.diff.php">http://www.php.net/manual/en/datetime.diff.php</a><br><a href="http://www.php.net/manual/en/class.dateinterval.php">http://www.php.net/manual/en/class.dateinterval.php</a><br><a href="http://www.php.net/manual/en/class.datetime.php">http://www.php.net/manual/en/class.datetime.php</a></p><p><strong><a href="http://blog1.phps.kr/638?commentInput=true#entry638WriteComment">댓글 쓰기</a></strong></p>