0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CentOS django

Last updated at Posted at 2022-04-15

vi CentOSLAMP.sh


#インストール
sudo yum remove php*
sudo yum remove mariadb-libs
sudo rm -rf /var/lib/mysql

#phpをExtraでインストール
sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
sudo yum -y install --enablerepo=remi,remi-php74 php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-pecl-mcrypt php-mysqlnd php-pecl-mysql

#python3をインストール
sudo yum groupinstall -y "Development Tools"
sudo yum install -y kernel-devel kernel-headers bzip2-devel libdb-devel libffi-devel
sudo yum install -y gdbm-devel xz-devel ncurses-devel readline-devel tk-devel uuid-devel openssl-devel

#Python3に必要なモジュールをインストール(ついでにgitも)
sudo yum install -y gcc gcc-c++ git
sudo yum install -y python3 python3-pip python3-setuptools python3-wheel python3-devel httpd-devel

#Djangoとmod_wsgiのインストール。
sudo pip3 install -y django mod_wsgi

#インストール確認djangoとmod_wsgiが表示されればインストール成功
sudo yum install -y python3 python3-devel
pip3 install mod_wsgi



#javaJDK1.8.0をインストール
sudo yum install -y java-1.8.0-openjdk-devel.x86_64

#MySQL8のインストール
sudo yum install https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

#mysql-develをインストール(mysqlclientに必要)
sudo yum install -y mysql-devel
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo yum install mysql-community-server -y
sudo pip3 install mysqlclient
sudo systemctl enable --now mysqld
sudo systemctl status mysqld
 
#mysql起動設定
sudo systemctl start mysqld.service
sudo systemctl stop mysqld.service
sudo systemctl restart mysqld.service
sudo systemctl enable mysqld.service

#apacheインストールから設定
sudo yum -y install httpd
sudo systemctl start httpd

#redisインストール
sudo yum install -y redis
sudo systemctl start redis
pip3 install django-redis

#redisとapacheの確認
sudo systemctl stop redis
sudo systemctl restart redis
sudo systemctl restart httpd
sudo systemctl enable httpd
sudo systemctl is-enabled httpd
sudo systemctl enable redis
firewall-cmd --add-service=http --zone=public --permanent
firewall-cmd --reload

sudo chmod u+x CentOSLAMP.sh
sudo ./CentOSLAMP.sh

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?