Fix: Server setting

This commit is contained in:
2018-08-22 14:42:48 +09:00
parent 9529c0dc4b
commit 5c0e823980
5 changed files with 225 additions and 33 deletions
+128
View File
@@ -0,0 +1,128 @@
# 서버 접속
ssh root@106.10.53.153
# 암호 변경
passwd
# 사용자 추가, 암호 변경
adduser jisangs
passwd jisangs
# root ssh 로그인 막기
vi /etc/ssh/sshd_config
...
PermitRootLogin no
...
...
#1 Apache, mariadb, php7.1 설치
https://www.dazzii.com/centos7-apache-mariadb-php-webserver/
# MariaDB 설치 확인
systemctl start mysql
mysql --version
# MariaDB 설정
http://oerun.tistory.com/2
vi /etc/my.cnf
----------------------------------------
[client]
default-character-set = utf8
[mysqld]
character-set-client-handshake = FALSE
init_connect = "SET collation_connection = utf8_general_ci"
init_connect = "SET NAMES utf8"
character-set-server = utf8
collation-server = utf8_general_ci
[mysqldump]
default-character-set = utf8
[mysql]
default-character-set = utf8
----------------------------------------
# php용 remi repository 추가만
https://blog.asamaru.net/2018/02/14/install-php-7-2-on-centos-with-remi-rpm-repository/
# phpMyAdmin 설치
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum --enablerepo=remi,remi-test install -y phpMyAdmin
cp -a /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.original
sed -i '15,17s/Require local/Require all granted/' /etc/httpd/conf.d/phpMyAdmin.conf
systemctl restart httpd
--- 위까지 해서 성공 ---
# (취소) php-fpm 설치
https://blog.bypass.sh/280
yum install -y epel-release
rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum --enablerepo=remi update remi-release
yum --enablerepo=remi-php70 install -y php php-fpm php-mysql
# php7.2 설치
https://blog.asamaru.net/2018/02/14/install-php-7-2-on-centos-with-remi-rpm-repository/
# phpinfo.php
<?php phpinfo(); ?>
# phpMyAdmin 설치
http://luckyyowu.tistory.com/287
yum install -y phpMyAdmin
vi /etc/httpd/conf.d/phpMyAdmin.conf
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Order Allow,Deny
Allow from All
</Directory>
vi /etc/httpd/conf/httpd.conf
<Directory />
AllowOverride none
Require all granted
</Directory>
#2 php 설치 확인
yum list installed | cut -d " " -f 1 | grep php
php -v
# php7.2 설치
http://ellordnet.tistory.com/166
----
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
php설치
yum install -y php70w
자주쓰는 관련 PHP 설치
yum install -y php70w-mysql php70w-pdo php70w-pgsql php70w-odbc php70w-mbstring php70w-mcrypt php70w-gd
yum install -y php70w-pear php70w-pdo_dblib php70w-pecl-imagick php70w-pecl-imagick-devel php70w-xml php70w-xmlrpc
php 설치가능패키지확인
yum search php70w
+1 -1
View File
@@ -23,7 +23,7 @@ if($loginData === null) {
set_error_message("로그인하지 못했습니다.");
send_result_fail();
exit;
} else if($loginData[activateStatus] == 0) {
} else if($loginData[activateStatus] === 0) {
set_error_code("not_activated");
set_error_message("서비스 관리자 계정이 아직 활성화되지 않았습니다.");
send_result_fail();
+43
View File
@@ -0,0 +1,43 @@
USE jisangs;
INSERT INTO `moty_active_app` (`ActiveAppID`, `MaestroID`, `AppID`) VALUES
(1, 1, 101),
(2, 1, 102),
(3, 1, 1),
(4, 1, 2),
(5, 1, 3),
(6, 1, 4),
(7, 1, 5),
(8, 1, 6),
(9, 1, 7),
(10, 1, 8),
(11, 1, 11),
(12, 1, 12),
(13, 1, 13),
(14, 1, 14),
(15, 1, 15),
(16, 1, 16),
(17, 1, 29),
(18, 1, 30),
(19, 1, 39),
(20, 1, 40),
(21, 3, 101),
(22, 3, 102),
(23, 3, 1),
(24, 3, 2),
(25, 3, 3),
(26, 3, 4),
(27, 3, 5),
(28, 3, 6),
(29, 3, 7),
(30, 3, 8),
(31, 3, 11),
(32, 3, 12),
(33, 3, 13),
(34, 3, 14),
(35, 3, 15),
(36, 3, 16),
(37, 3, 29),
(38, 3, 30),
(39, 3, 39),
(40, 3, 40);
+40 -32
View File
@@ -1,35 +1,43 @@
USE jisangs;
INSERT INTO moty_app VALUES
(1, 'korean_basic', 1),
(2, 'korean_left_upper', 1),
(3, 'korean_second_finger', 1),
(4, 'korean_right_upper', 1),
(5, 'korean_left_lower', 1),
(6, 'korean_right_lower', 1),
(7, 'korean_left_upper_double', 1),
(8, 'korean_right_upper_double', 1),
(9, 'korean_word', 1),
(10, 'korean_sentence', 1),
INSERT INTO `moty_app` (`AppID`, `AppName`, `KoreanName`, `AppType`, `HowToPlay`) VALUES
(1, 'practice_korean_basic', '기본 자리', 1, ''),
(2, 'practice_korean_left_upper', '왼손 윗글쇠', 1, ''),
(3, 'practice_korean_second_finger', '검지 글쇠', 1, ''),
(4, 'practice_korean_right_upper', '오른손 윗글쇠', 1, ''),
(5, 'practice_korean_left_lower', '왼손 밑글쇠', 1, ''),
(6, 'practice_korean_right_lower', '오른손 밑글쇠', 1, ''),
(7, 'practice_korean_left_upper_double', '왼손 쌍자음', 1, ''),
(8, 'practice_korean_right_upper_double', '오른손 쌍모음', 1, ''),
(9, 'practice_korean_word', '', 1, ''),
(10, 'practice_korean_sentence', '', 1, ''),
(11, 'practice_english_basic', 'Basic', 2, ''),
(12, 'practice_english_left_upper', 'Left upper', 2, ''),
(13, 'practice_english_second_finger', 'Second finger', 2, ''),
(14, 'practice_english_right_upper', 'Right upper', 2, ''),
(15, 'practice_english_left_lower', 'Left lower', 2, ''),
(16, 'practice_english_right_lower', 'Right lower', 2, ''),
(19, 'practice_english_word', '', 2, ''),
(20, 'practice_english_sentence', '', 2, ''),
(21, 'test_korean_basic', '기본 자리', 11, ''),
(22, 'test_korean_left_upper', '왼손 윗글쇠', 11, ''),
(23, 'test_korean_second_finger', '검지 글쇠', 11, ''),
(24, 'test_korean_right_upper', '오른손 윗글쇠', 11, ''),
(25, 'test_korean_left_lower', '왼손 밑글쇠', 11, ''),
(26, 'test_korean_right_lower', '오른손 밑글쇠', 11, ''),
(27, 'test_korean_left_lower_double', '왼손 쌍자음', 11, ''),
(28, 'test_korean_right_lower_double', '오른손 쌍모음', 11, ''),
(29, 'test_korean_word', '시험 - 단어', 11, '단어를 빠르게 입력하세요.'),
(30, 'test_korean_sentence', '시험 - 문장', 11, '문장을 빠르게 입력하세요.'),
(31, 'test_english_basic', 'Basic', 12, ''),
(32, 'test_english_left_upper', 'Left upper', 12, ''),
(33, 'test_english_second_finger', 'Second finger', 12, ''),
(34, 'test_english_right_upper', 'Right upper', 12, ''),
(35, 'test_english_left_lower', 'Left lower', 12, ''),
(36, 'test_english_right_lower', 'Right lower', 12, ''),
(39, 'test_english_word', 'Word test', 12, '단어를 빠르게 입력하세요.'),
(40, 'test_english_sentence', 'Sentence test', 12, '문장을 빠르게 입력하세요.'),
(50, 'typing_venezia', '베네치아', 50, '물에 잠기지 않도록 잘 준비하세요.'),
(101, 'space_invaders', '외계인 침공', 100, '외계인이 나타났다!\\n마우스 왼쪽 버튼으로\\n외계인을 클릭해서 물리쳐 주세요.'),
(102, 'card_matching', '카드 짝 맞추기', 100, '같은 그림의 카드를 맞춰주세요.');
(11, 'english_basic', 1),
(12, 'english_left_upper', 1),
(13, 'english_second_finger', 1),
(14, 'english_right_upper', 1),
(15, 'english_left_lower', 1),
(16, 'english_right_lower', 1),
(19, 'english_word', 1),
(20, 'english_sentence', 1);
INSERT INTO moty_app VALUES
(101, 'space_invaders', 101);
INSERT INTO moty_active_app VALUES
(1, 1, 1),
(2, 1, 9),
(3, 1, 10),
(4, 1, 19),
(5, 1, 20),
(6, 1, 101);
+13
View File
@@ -0,0 +1,13 @@
USE jisangs;
INSERT INTO `moty_maestro` (`MaestroID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`, `AvailableActivateDateTime`, `PlayerCount`, `AcceptClausesDateTime`, `MaestroTestID`) VALUES
(1, 'testplayer', '', 'test@jinaju.com', 100, 1, '2100-12-31 00:00:00', 0, '2018-05-27 17:13:35', 1),
(2, '마에스트로 체험', '', 'test@jinaju.com', 101, 1, '2100-12-31 00:00:00', 0, '2018-07-08 00:00:00', 2);
INSERT INTO `moty_player` (`PlayerID`, `MaestroID`, `Name`, `EnterCode`, `AccountType`) VALUES
(1, 1, '학생 체험', '', 0),
(2, 2, '마에스트로', '', 0);
INSERT INTO `moty_admin` (`AdminID`, `Name`, `Password`, `Email`, `AccountType`, `ActivateStatus`) VALUES
(1, 'jisangs', '*F2012B4E7A22EED437B79FB53DBF79C8AAC5034B', 'jisangs@gmail.com', 1, 1);