[총정리]코노하호스팅 or 타 서버에서 apm+웹서비스까지

1. vsftpd 설치

yum install vsftpd -y

 

2. vsftpd 설정 확인 (아래 사이트 참고)

foxydog.tistory.com/14

anonymous_enable=NO   
chroot_local_user=YES
allow_writeable_chroot=YES  

 

3. vsftpd 활성화/시작/구동확인

systemctl enable vsftpd

systemctl start vsftpd

ps -ef |grep vsftpd

 

4. 방화벽설정

 vi /etc/sysconfig/iptables
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT    [추가]
-A INPUT -p tcp -m state --state NEW -m tcp --dport 50001:50005 -j ACCEPT  [추가]
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

 

5. 방화벽 재시작/구동확인

 systemctl restart iptables 
 
 iptables -nL | egrep "21|5000"

 

6. 계정생성

useradd -m testid
passwd ftptest

 

6-1. 폴더없으면 생성 및 권한 설정

mkdir /home/testid
mkdir /home/testid/www
chown testid:testid /home/testid
chown testid:testid /home/testid/www
chmod 711 /home/testid

 

6-2. 파일질라 ftp접속 확인

 

 

7.apm설치

-php

www.lesstif.com/php-and-laravel/rhel-centos-8-php-7-4-87949624.html

 

-아파치

spoonhasi.tistory.com/1

 

-mysql

info-lab.tistory.com/172

 

8. php 기본설정 (작성필요)

 

9. 아파치 virtual server 설정

vi /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
    DocumentRoot /home/testid/www
    ServerName testid.메인도메인.co.kr
</VirtualHost>
service httpd restart

 

10. mysql database 설정

create database test_db default character set utf8
mysql
use mysql
create user testid@localhost identified by 'testpw';
create user 'testid'@'%' identified by 'testpw';
grant all privileges on test_db.* to testid@'%';

 

10-1. mysql 접속 방화벽 설정

vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
 service iptables restart

 

-참고 htaccess파일을 사용할때

<Directory "/home/victolee/htdocs">
	Options Indexes FollowSymLinks
	AllowOverride None
	Allow from all
</Directory>

 

 

ssl (작성 필요)

 

 

 

댓글

Designed by JB FACTORY