일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- JavaScript
- SQL 주석
- 공부하는 블로그
- BOM 객체
- Union injection
- SQL having group by
- 웹 기초
- DOM 객체
- Injection 취약점
- web 보안
- Linux
- http 취약점
- sql injection table name
- web 취약점
- 웹서버구축
- JS
- sql injection 데이터 추출
- sql 인젝션 기초
- portswigger academy
- 웹 해킹 기초
- nginx
- Injection 숫자형
- SQL Injection basic
- HTTP request smuggling
- sql injection
- 웹 보안
- Injection 공격 기초
- SQL 인젝션
- php-fpm
- SQL INJECTION DB NAME
- Today
- Total
IMLENA
[서버]웹서버 구축(Nginx+PHP+Mysql) 본문
Web서버 구축
설치 환경 - CentOS6.7 64bit
프로그램 - Nginx, php-fpm, mysql
1. database 구축 mysql 설치
mysql-server install
[root@localhost ~] yum -y install mysql-server
mysql 기본 설정 my.cnf 내의 파일을 아래와 같이 수정
[root@localhost ~] vi /etc/my.cnf
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=InnoDB
datadir=/vir/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
init_connect=SET collation_connection=utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
[mysql_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysqldump]
default-character-set=utf8
[mysql]
default-character-set=utf8
mysql 실행
[root@localhost ~] mysql
*error
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'(111)
-> reinstall or restart
-> service mysqld restart 후 해결됨
mysql 접속 후 root password 설정
mysql> update mysql.user set password=password('패스워드' where user='root';
mysql> flush privileges;
이후 접속시
[root@localhost ~] mysql -p패스워드 입력하여 접속
2. php-fpm
[root@localhost ~] yum install -y php-fpm php-mysql
mysql연동을 위해 php-mysql 도 설치
[root@localhost ~]vi /etc/php-fpm.d/www.conf
; RPM: apache Choosed to be able to access some dir as httpd ~ 부분
user = nginx
group = nginx
apache 로 설정된 부분 nginx로 변경
3. nginx
[root@localhost ~] yum install epel-release -y
[root@localhost ~] yum -y install nginx
nginx 서비스 실행
[root@localhost ~] service nginx start
nginx conf 파일 수정
[root@localhost ~] vi /etc/nginx/conf.d/default.conf
server_name, index php 부분 uncomment
4. php 연동 test
[root@localhost ~] service php-fpm start
vi /usr/share/nginx/html/info.php
<? php
phpinfo();
?>
[root@localhost ~] service nginx restart
웹에서 서버주소/info.php로 들어가서 test
위와 같은 화면이 뜨면 정상적으로 web과 php 연동이 완료된 것
os 시작시 자동실행
chkconfig mysqld on
chkconfig nginx on
chkconfig php-fpm on
'기타' 카테고리의 다른 글
칼리리눅스 설치 2021 ( Kali 2021 linux install, VM ) (0) | 2021.04.09 |
---|---|
네트워크 망/ 서버 구축 실습 1 - Switch L2,L3 (0) | 2021.04.09 |
[서버구축] Tomcat 9 CentOS 7 - 과정 (0) | 2021.03.25 |
[LEMP stack] WEB서버 구축(nginx, php-fpm, centos7) (0) | 2021.03.23 |
[WEB hacking] WebGoat 8 & JAVA 설치 with Centos7 (0) | 2021.03.22 |