174 lines
3.8 KiB
Plaintext
174 lines
3.8 KiB
Plaintext
# 서버 접속
|
|
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.if-not-true-then-false.com/2010/install-apache-php-on-fedora-centos-red-hat-rhel/
|
|
|
|
|
|
|
|
# MariaDB 설치 확인
|
|
https://www.dazzii.com/centos7-apache-mariadb-php-webserver/
|
|
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/
|
|
|
|
# php 설치후 /etc/httpd/conf/httpd.conf 수정
|
|
LoadModule php7_module modules/libphp7.so
|
|
DirectoryIndex index.html index.html.var index.php index.php3
|
|
AddType application/x-httpd-php .php .html .htm .inc
|
|
AddType application/x-httpd-php-source .phps
|
|
|
|
|
|
# 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>
|
|
|
|
|
|
# git 설치 및 설정
|
|
http://morningame.tistory.com/27
|
|
|
|
scp id_rsa.pub jisangs@106.10.45.240:/home/jisangs/
|
|
scp id_rsa.pub git@106.10.45.240:/home/git/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- 위까지 해서 성공 ---
|
|
|
|
|
|
# (취소) 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(); ?>
|
|
|
|
|
|
|
|
#2 php 설치 확인
|
|
yum list installed | cut -d " " -f 1 | grep php
|
|
php -v
|
|
|
|
# php7.2 설치
|
|
http://ellordnet.tistory.com/166
|
|
|
|
|
|
|
|
|
|
|
|
git 설치
|
|
yum install git
|
|
|
|
git 세팅
|
|
adduser git
|
|
passwd git
|
|
|
|
mkdir /git_repository
|
|
chown git:git /git_repository
|
|
|
|
mkdir /git_repository/mouse_typing.git
|
|
chown git:git /git_repository/mouse_typing.git
|
|
|
|
vi /git_reposotory/mouse_typing.git/hooks/post-receive
|
|
#!/bin/sh
|
|
# GIT_WORK_TREE=/var/www/html/mouse_typing git checkout -f
|
|
|
|
while read oldrev newrev ref
|
|
do
|
|
branch=`echo $ref | cut -d/ -f3`
|
|
|
|
if [ "master" == "$branch" ]; then
|
|
echo 'Changes pushed live.'
|
|
fi
|
|
|
|
if [ "release" == "$branch" ]; then
|
|
git --work-tree=/volume1/docker/chocomae/html/mouse_typing/ checkout -f $branch
|
|
cp /volume1/docker/chocomae/html/mouse_typing/src/web/server/setup/NA_service_db_setting.php /volume1/docker/chocomae/html/mouse_typing/src/web/server/setup/service_db_setting.php
|
|
sed -i 's/localhost/mysql' /volume1/docker/chocomae/html/mouse_typing/src/web/server/setup/service_db_setting.php
|
|
echo 'Changes pushed to dev.'
|
|
fi
|
|
done
|
|
|
|
(root) mkdir /var/www/html/mouse_typing
|
|
(root) chown git:git /var/www/html/mouse_typing
|
|
|
|
|
|
|
|
|
|
|
|
----
|
|
|
|
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 |