티스토리 뷰

오랜만에 서버셋팅을 하려니 너무 많이 바꼈네요

CentOS7은 첨이라 많이 헤매고 있습니다.

php7의 성능이 전 버전(5.6, 참고로 6.0은 개발되었지만 출시가 안되었다고 하네요 그래서 다음 버전이 7대로 갔다네요)에 비해 2배 이상 빠르다고 하여 설치하였으나

wordpress에서 진행이 안되는 관계로 yum으로 설치할 수 있는 최고 버전인 php5.4 버전으로 사용

아래와 같은 에러메시지가 나옴

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.



Network  연결부터

CentoOS7에 ethernet interface(흔히 말하는 랜카드)가 기본적으로 사용할 수 없게 되어 있어서 nmcli(Network Management Command Line Tool)로 사용할 수 있게 바꿔줌


현재 ethernet 카드 설정 확인

nmcli d


nmtui(Network Management Text User Interface) 명령어로 설정



network 재시작

systemctl restart network


명령어 정리


기존 네트워크 관련 명령어들이 deprecated 되면서 대체하는 명령어들을 알아야 됩니다. 물론 기존 명령어를 쓸 수도 있지만 새로 익히는게 좋을 거 같네요


ifconfig => ip addr show 


방화벽 설정 관련

firewall-cmd --list-ports

firewall-cmd --state

firewall-cmd --permanent --add-service=ssh

firewall-cmd --permanent --add-service=ssh


TCP listening port 보기

ss -ltn


SELinux 상태 확인

sestatus


mariadb 설치


mariadb 다운로드

https://mariadb.org/download/


dependencies 설치

yum install perl

yum install nmap

yum install lsof

yum install perl-DBI

yum install rsync


기존 10.1.9 설치 시 충돌남

yum remove mariadb-libs


rpm -ivh MariaDB-10.1.9-centos7-x86_64-common.rpm

rpm -ivh MariaDB-10.1.9-centos7-x86_64-client.rpm

rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm

rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm

rpm -ivh MariaDB-10.1.9-centos7-x86_64-server.rpm


설정 파일 복사

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf


utf8로 character-set 수정

[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci


부팅 시 자동 시작 설정

chkconfig --add mysql

chkconfig --level 345 mysql on


maria db start & stop

systemctl start mariadb

systemctl stop mariadb


apache 설치


httpd 설치여부 확인

which httpd


yum list | grep httpd


apache 설치

yum install httpd


apache 버전 확인

httpd -v


apache start & stop

systemctl start httpd


Apache 설정


VirtualHost 설정은 다음 URL을 참고

http://robertan.com/home/2015/01/14/apache-virtual-hosts-on-centos-7/


설정 중 DocumentRoot를 다른 디렉토리 지정 후 403 Forbidden 에러

<Directory "서비스할 디렉토리">

    AllowOverride None

    Require all granted

  </Directory>


php7 설치


yum install autoconf

yum install gcc


apxs 찾을 수 없을 때

yum install httpd-devel


xml-config  관련 오류

yum install libxml2

yum install libxml2-devel


yum install openssl

yum install openssl-devel


yum install bzip2-devel

yum install libcurl-devel


yum install libjpeg-turbo-devel.x86_64

yum install libwebp.x86_64

yum install libwebp-devel.x86_64

yum install libpng-devel.x86_64

yum install libXpm

yum install libXpm-devel

yum install freetype-devel

yum install gmp-devel


yum install epel-release

yum install php-mcrypt


yum install aspell-devel

yum install recode-devel


./configure \

--prefix=/usr/share/php7 \

--with-config-file-path=/usr/share/php7/etc \

--enable-mbstring \

--enable-zip \

--enable-bcmath \

--enable-pcntl \

--enable-ftp \

--enable-exif \

--enable-calendar \

--enable-sysvmsg \

--enable-sysvsem \

--enable-sysvshm \

--enable-wddx \

--with-curl \

--with-mcrypt \

--with-iconv \

--with-gmp \

--with-pspell \

--with-gd \

--with-jpeg-dir=/usr \

--with-png-dir=/usr \

--with-zlib-dir=/usr \

--with-xpm-dir=/usr \

--with-freetype-dir=/usr \

--enable-gd-native-ttf \

--enable-gd-jis-conv \

--with-openssl \

--with-gettext=/usr \

--with-zlib=/usr \

--with-bz2=/usr \

--with-recode=/usr \

--with-mysqli=shared \

--with-apxs2=/usr/bin/apxs


make && make install


php5에서 php7으로 변경 중 아파치 시작 시 세그멘테이션 오류

php 모듈이 중복되어서 /etc/httpd/conf.modules.d/10-php.conf 를 주석처리 함.

php7 설치 시 /etc/httpd/conf/httpd.conf 에 php7 모듈 로딩하는 부분이 있는데 경우에 따라 알맞게 처리하세요 ^^


http://kb.odin.com/en/126642


yum install php-mysqlnd


wordpress 4.4 설치


plugin 설치 중 vsftp 접속이 안될 때

setsebool -P httpd_can_network_connect on


한글 고유주소 설정(한글 URL)

<Directory "/path_to_the_folder/maindomain.org">

  Options FollowSymLinks MultiViews

  AllowOverride All

  Order allow,deny

  Allow from all

</Directory>


wordpress 설정 부분에 나와 있는 .htaccess 설정을 하면 다음과 같은 오류가 발생한다.

REQUEST EXCEEDED THE LIMIT OF 10 INTERNAL REDIRECTS DUE TO PROBABLE CONFIGURATION ERROR.

셋팅을 아래와 같이 수정한다.


.htaccess 셋팅

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ - [L]


# add a trailing slash to /wp-admin

RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]


RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^ - [L]

RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]

RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

RewriteRule . index.php [L]


참고


CentOS7 네트워크 설정

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_the_NetworkManager_Command_Line_Tool_nmcli.html

http://www.krizna.com/centos/setup-network-centos-7/


CentOS 7에서 mariadb 설치

http://firstboos.tistory.com/entry/CentOS-7-%EC%97%90%EC%84%9C-mariadb-%EC%84%A4%EC%B9%98


Deprecated linux networking command and their replacements

https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/


apache virtual hosts on centos 7

http://robertan.com/home/2015/01/14/apache-virtual-hosts-on-centos-7/


apache-virtualhost-403-forbidden

http://stackoverflow.com/questions/6959189/apache-virtualhost-403-forbidden


install and compile php 7 on centos 7 and debian 8

http://www.tecmint.com/install-and-compile-php-7-on-centos-7-and-debian-8/


lamp on centos 7

https://www.linode.com/docs/websites/lamp/lamp-on-centos-7


apxs  on centos 7

http://forums.sentora.org/showthread.php?tid=1363


how to install mcrypt php extension on centos 7

https://www.digitalocean.com/community/questions/how-to-install-mcrypt-php-extension-on-centos-7-0-x64


http://crybit.com/20-common-php-compilation-errors-and-fix-unix/

http://rasyid.net/2015/06/24/building-and-testing-php-7-under-dragonflybsd-4-0-5/

http://sasuke.tistory.com/213


request exceeded the limit of 10 internal redirects due to probable configuration error

https://premium.wpmudev.org/forums/topic/request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuration-error


apache2에 mod_url 설치

http://calflove.tistory.com/336


반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
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 29 30 31
글 보관함