CentOS에서
rpm -qa | grep openssh-server //있는 것 확인.
su
service sshd status //런닝중인 것을 볼 수 있다.
serivce sshd stop
service sshd start
ifconfig 로 아이피 확인.
윈도우즈에서 putty 로 접속. (캐릭터셋을 utf-8 로 바꾸어서)
Putty에서
rpm -qa | grep vsftpd //없는 것확인.
su
yum -y install vsftpd
cd /var/ftp
cd pub
vi test.html 해서 아래와 같이입력 후 저장
<html>
<head>
<title>Welcome!!!</title>
<head>
<body>
<font size='7'>Welcome</font>
</body>
</html>
그리고 service vsftpd start
cat /etc/sysconfig/iptables //파이어월의 파일. 명령프롬프트에서는 그래픽을 띄울 수없으니
vi /etc/sysconfig/iptables 들어가서 아래 라인을 추가해줌.
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
그리고 service iptables restart 해주면
윈도우즈에서 웹브라우저로 ftp://192.168.89.130/ 접속하면 안들어가진다.
cd /etc/sysconfig 들어가서
cd /etc/selinux
vi config 들어가서
SELINUX=enforcing 을 SELINUX=disalbed 로 바꿔줌.
그리고 centos에서 파이월을 21번포트를 열어주면 웹브라우저에서 접속가능.
cd /WebHome
groupadd iusers
useradd -g iusers -d /WebHome -s /bin/bash -m ftpuser
cd /etc
cd vsftpd
vi vsftpd.conf 에서 아래를 바꿈
anonymous_enable=NO 와
chroot_local_user=NO
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list 으로 바꿈.
vi chroot_list 들어가서 ftpuser 라고만 쓰고 저장 후 나옴
service vsftpd stop
service vsftpd start
passwd ftpuser
비번 설정은 ftpuser 로
ls -l /WebHome
chown ftpuser:iusers /WebHome -R
su ftpuser
chmod 755 /WebHome -R
웹브라우저에서 다시 ftp://아이피 써서 들어가면 들어가진다. (그런데 파일이 없음)
(파일질라 Host:아이피 / Username: ftpuser / Password:ftpuser)
다시 vi /etc/vsftpd/vsftpd.conf 들어가서 아래의 내용을 주석을 풀어줌.
ascii_upload_enable=YES
ascii_download_enable=YES
다시 service vsftpd restart 를 해서 서비스 재시작을 해줌.
그리고 센트오에스 리붓.
다시 putty 연결해서
su
rm -rf /WebHome
mkdir /WebHome //루트권한으로 만들어준 것임.
chown ftpuser:iusers /WebHome -R
chmod 755 /WebHome -R
service vsftpd restart 하면
파일질라 Host:아이피 / Username: ftpuser / Password:ftpuser Port:21로 들어가면 들어가짐.
그리고 크기가 작은 파일 하나를 업로드 해서
웹브라우저에서 ftp://아이피 접속하면 업로드한 파일을 볼 수 있다.
/WebHome에 어제했던 index.html 을 넣고
웹브라우저로 http://아이피 로 접속하면 출력된화면을 볼 수 있다. 안되면 service httpd start 하고 다시 접속.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
윈도우즈에서 note++을 열어서
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sample</title>
<meta charset='utf-8' />
</head>
<body>
<form id="userfrom" action="">
First Name : <input type="text" id="firstname" style="background-color:yellow;font-size:30pt" /><br/>
Last Name : <input type="text" id="lastname" style="color:red;font-style:italic;font-size:10mm"><br/>
<input type="button" value="전송" style="font-family:궁서체;font-weight:700;font-size:30pt">
<input type="reset" value="RESET" style ="font-family:'Times New Roman';font-size:25pt;color:green">
</form>
</body>
</html>
위와같이 만들어서 D드라이브의 WebHome폴더에 sample.html로 저장.
웹브라우저에서 http://localhost/sample.html
http://localhost/sample.html 로 접속하면 볼 수 있다.
html의 주석처리는 <!-- <meta charset='utf-8' /> --> 이런식으로 할 수 있다.
-----------------------------------
태그를 바깥으로 빼는 방법을 써서 작성해보자.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sample</title>
<meta charset='utf-8' />
<style type="text/css">
.aaa{font-size:30pt;color:red}
.bbb{font-family:궁서체;font-style:italic;font-size:10mm}
.ccc{background-color:yellow;font-size:25pt}
.ddd{font-weight:900;text-decoration:underline;font-size:40px}
</style>
</head>
<body>
<form id="userfrom" action="">
<span class="ddd">First Name : </span> <input type="text" id="firstname" class="ccc"/><br/>
<span class="ddd">Last Name : </span> <input type="text" id="lastname" class="ccc"><br/>
<input type="button" value="전송" class="bbb">
<input type="reset" value="다시" class="aaa">
</form>
</body>
</html>
그리고 라벨에도 span을 써서 넣어주었다.
------------------------------------------------
.aaa{font-size:30pt;color:red}
.bbb{font-family:궁서체;font-style:italic;font-size:10mm}
.ccc{background-color:yellow;font-size:25pt}
.ddd{font-weight:900;text-decoration:underline;font-size:40px}
를 sample.css에 저장.
그리고 sample.html에서는 스타일 부분 한줄만 바뀜.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sample</title>
<meta charset='utf-8' />
<link rel="stylesheet" type="text/css" href="sample.css" />
</head>
<body>
<form id="userfrom" action="">
<span class="ddd">First Name : </span> <input type="text" id="firstname" class="ccc"/><br/>
<span class="ddd">Last Name : </span> <input type="text" id="lastname" class="ccc"><br/>
<input type="button" value="전송" class="bbb">
<input type="reset" value="다시" class="aaa">
</form>
</body>
</html>
------------------------------------------------
위의 코드에서 전송 눌렀을 때 창 뜨게
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sample</title>
<meta charset='utf-8' />
<link rel="stylesheet" type="text/css" href="sample.css" />
<script type="text/javascript">
window.onload = function1;
function function1(){
alert("Hello, World");
document.getElementById('userform').firstname.focus();
document.getElementById('mybutton').onclick = myclick;
}
function myclick(){
var firstname = document.getElementById('firstname').value;
var secondname = document.getElementById('lastname').value;
alert("Hi!!! " + firstname + ", "+ secondname);
}
</script>
</head>
<body>
<form id="userform" action="">
<span class="ddd">First Name : </span> <input type="text" id="firstname" class="ccc"/><br/>
<span class="ddd">Last Name : </span> <input type="text" id="lastname" class="ccc"><br/>
<input type="button" id="mybutton" value="전송" class="bbb">
<input type="reset" value="다시" class="aaa">
</form>
</body>
</html>
-----------------------------------------------------
위 코드 분리
sample.js
window.onload = function1;
function function1(){
alert("Hello, World");
document.getElementById('userform').firstname.focus();
document.getElementById('mybutton').onclick = myclick;
}
function myclick(){
var firstname = document.getElementById('firstname').value;
var secondname = document.getElementById('lastname').value;
alert("Hi!!! " + firstname + ", "+ secondname);
}
sample.html
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Sample</title>
<meta charset='utf-8' />
<link rel="stylesheet" type="text/css" href="sample.css" />
<script type="text/javascript" src="sample.js"></script>
</head>
<body>
<form id="userform" action="">
<span class="ddd">First Name : </span> <input type="text" id="firstname" class="ccc"/><br/>
<span class="ddd">Last Name : </span> <input type="text" id="lastname" class="ccc"><br/>
<input type="button" id="mybutton" value="전송" class="bbb">
<input type="reset" value="다시" class="aaa">
</form>
</body>
</html>
된다면 sample.html, sample.js, sample.css 세개를 centos에 옮겨 http://192.168.89.130/sample.html 로 접속해서 되는지 확인.
-----------------------------------------
html 도움되는 사이트
www.tutorialspoint.com
http://www.w3schools.com/
--------------------------------
notepad++ 에서 Plugins - Plugin Manger - Show plugin Manager - Preview HTML 체크해서 install. 설치하면위의 오른쪽에 생긴것을 누르면 출력 미리보기 가능.
Plugins - Plugin Manger - Show plugin Manager - Web edit 체크해서 install.
기본적인 템플릿을 만들 수 있는 Plugins - Newfile&Browser (지난번에 설치해서 있음) 에서 create html file 1을 눌르면 html4버전으로 나온다.
Encoding을 UTF-8로 바꿔주고 Plugins - Newfile&Browser - Option 에서 New file No. 를 File 1로 해주고 Edit Initial Text를 눌러서 아래와 같이 수정 후 save. 변경한 화면에서도 save.
<!DOCTYPE html>
<html>
<head>
<title> New Document </title>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
다시 Plugins - Newfile&Browser - Create Html File 1을 눌르면 변경완료된다.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
http://validator.w3.org/check 사이트에서 Validate by File Upload 탭에 가서 html파일을 올리면 에러 및 워닝 체크.
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
IIS 서비스 중지.
IIS Manager 에가서 Default Document 눌러주고, 기본문서 5개를 모드 remove 해서 지워줌.
오른쪽 Restart 를 눌러서 서비스 재시작해줌. 웹브라우저에서 localhost 로 더이상 접속 안됨.
그럼 Add눌러서 abc.html 해서 하나 넣어주고 다시 서비스 재시작.
안됨.. 그럼 World Wide Web Publishng service 를 중지하고 Manual 로 바꿔줌.
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf 에서 httpd.conf 를 열어줌.
244라인 DirectoryIndex index.html 을 DirectoryIndex aaa.html 로 변경.
173라인 ServerName localhost:80 로 변경.
47라인 Listen 80 로 변경. IIS 서비스를 모두 죽이고 아파치를 80번포트로 사용. 그래서 저장 후
관리자 권한으로 명령프롬프트 켜서 net stop apache2.2 하고 net start apache2.2 하고
웹브라우저로 localhost로 들어가면 기본문서인 aaa.html이 없으므로 있는 폴더를 모두 다 보여줌.
'Java & Oracle' 카테고리의 다른 글
HTML5 tag, table (0) | 2014.05.15 |
---|---|
이클립스 스탠다드 설치, Aptana Studio 설치, HTML5 (0) | 2014.05.14 |
아파치 HTTP, ISS 설치 (0) | 2014.05.12 |
PL/SQL 커서, Exception (0) | 2014.05.08 |
PL/SQL - 커서, 프로시저 (0) | 2014.05.07 |