Python 웹 구축
yum -y install python
cd /var/www/cgi-bin
# 아파치 설정 파일
vim /etc/httpd/conf/httpd.conf
302번째 줄 #AddHandler cgi-script .cgi .py
systemctl restart httpd
cd /var/www/cgi-bin
vim first.py
#!/usr/bin/env python
print "Content-type: text/html\\n\\n"
print "\\n"
print "
" print "Python Test Page in [Benmin.com](<
http://benmin.com/>)" print "\\n\\n" chmod 707 first.py cd /var/www
Tomcat 웹 구축
yum -y install tomcat java //톰캣 자바 설치
java -version //자바 버전 확인
systemctl restart tomcat
systemctl status tomcat
systemctl enable tomcat
netstat -natlp | grep java // 8080 포트 사용
lsof -i tcp:8080 // 포트 확인
systemctl stop firewalld // 방화벽 끄기
setenforce 0
// 톰캣 GUI환경 설치
yum -y install tomcat-webapps
// 톰캣 설정파일
vim /usr/share/tomcat/conf/tomcat-users.xml
// 주석 제거 후 패스워드만 변경 , 자바 주석 <!— —>
// 톰캣 기본 디렉터리
cd /usr/share/tomcat/webapps/ROOT/
// 기본 파일
index.jsp
// index.jsp 파일 백업
mv index.jsp index.jsp.bak
// index.jsp 파일 생성
vim index.jsp
<html>
<head>
<title>Tomcat Test</title>
</head>
<body>
<div style="width: 100%; font-size:80px; font-weigth:bold; text-align: center;">
Benmin's Tomcat test
<START OF JAVA CODES>
<%
out.println("Hello World!!!");
out.println("<BR>This is first JSP APP ");
%>
<END OF JAVA CODES>
</div>
</body>
</html>
// 톰캣 사이트
<http://192.168.111.100:8080>