[총정리]코노하호스팅 or 타 서버에서 apm+웹서비스까지
- 프로그래밍/서버(리눅스,centos)
- 2021. 5. 9.
1. vsftpd 설치
yum install vsftpd -y
2. vsftpd 설정 확인 (아래 사이트 참고)
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
-아파치
-mysql
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 (작성 필요)
'프로그래밍 > 서버(리눅스,centos)' 카테고리의 다른 글
CentOS 6 yum Error: Cannot find a valid baseurl for repo: base출처: https://www.juntoday.com/500?category=749249 [JunToday.com] (0) | 2021.05.28 |
---|---|
http접속시 https로 (0) | 2021.05.09 |
centos8/9에서 APM - apache php7 mysql 설치하기 (0) | 2021.05.07 |
centos6~8 ftp (0) | 2021.05.07 |
우분투 가상서버 (0) | 2021.02.23 |