본문 바로가기

Operating Systems/Linux

[ Linux ] WORDPRESS 설치

Wordpress Download

[ WORDPRESS 설치 서버 ]

# 나의 아이피 확인
APACHE_SERVER_IP=$(ifconfig | grep -A 2 ens | grep "inet " | awk '{ print $2 }')

# apache mariadb 설치
yum -y install httpd mariadb mariadb-server

# php 설치
# php8 설치(https://hmwoo.tistory.com/26) 에서 넘어온 경우
# yum -y install epel-release
# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
# yum -y install php80-php php80-php-mysqlnd을 설치하여 대응한다.
yum install -y epel-release
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
yum -y install php70w php70w-mysqlnd

systemctl restart mariadb

mysql -e "CREATE DATABASE wordpress;"

mysql -e "GRANT ALL PRIVILEGES ON wordpress.* TO wordadmin@localhost IDENTIFIED BY 'P@ssw0rd"'!'"';"

mysql -e "FLUSH PRIVILEGES;"

mysql -e "SELECT User,Host FROM mysql.user;"

sed -i "s/\s*DirectoryIndex.*/\tDirectoryIndex index.html index.html.var index.php index.php3/g" /etc/httpd/conf/httpd.conf

echo "AddType application/x-httpd-php .php .html .htm .inc" >> /etc/httpd/conf/httpd.conf
echo "AddType application/x-httpd-php-source .phps" >> /etc/httpd/conf/httpd.conf

mkdir -p /app/install

wget https://ko.wordpress.org/latest-ko_KR.tar.gz -O /app/install/wordpress.tar.gz

mkdir -p /var/www/html/wordpress

tar xvfz /app/install/wordpress.tar.gz -C /var/www/html/wordpress --strip-components=1

mkdir -p /var/www/html/wordpress/wp-content/uploads

cp /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php

sed -i "s/\(^\s*define(\s*'DB_NAME'\s*,\s*'\)\([^']*\)\('\s*);\)/\1wordpress\3/g" /var/www/html/wordpress/wp-config.php

sed -i "s/\(^\s*define(\s*'DB_USER'\s*,\s*'\)\([^']*\)\('\s*);\)/\1wordadmin\3/g" /var/www/html/wordpress/wp-config.php

sed -i "s/\(^\s*define(\s*'DB_PASSWORD'\s*,\s*'\)\([^']*\)\('\s*);\)/\1P@ssw0rd\!\3/g" /var/www/html/wordpress/wp-config.php

systemctl restart httpd

setenforce 0

systemctl stop firewalld

firefox http://${APACHE_SERVER_IP}/wordpress/ &

 

'Operating Systems > Linux' 카테고리의 다른 글

[ Linux ] HEREDOC 활용  (0) 2021.08.07
[ Linux ] PHP 설치  (0) 2021.08.06
[ Linux ] PYTHON 설치  (0) 2021.08.01
[ Linux ] APACHE ↔ TOMCAT 연동  (0) 2021.08.01
[ Linux ] TOMCAT 서버 설치  (0) 2021.08.01