(For myself) Flask_AWS_1 (Install PHP, MySQL, phpMyAdmin, Python in AWS virtual environment)

item

  1. PHP installation
  2. Install MySQL
  3. Install PHPMyAdmin
  4. Python installation

1. PHP installation

Terminal


#Connect to a Linux virtual machine first, if you don't remember this, look at the previous one
$ ssh -i ~/.ssh/FirstKey.pem ec2-user@(Public IP)

#Change to administrator privileges
$$ sudo su

#Install PHP
$$ yum install -y php

#Make a backup before changing PHP settings
$$ cp /etc/php.ini /etc/php.bak

#Change PHP settings with vi
$$ vi /etc/php.ini

--Display line numbers with : set number --Move to line 520 with : 520 --Set to description mode with ʻi and change the line ʻerror_reporting = E_ALL & ~ E_DEPRECATED to ʻerror_reporting = E_ALL & ~ E_DEPRECATED & ~ E_NOTICE --Return to command mode with ʻesc --Go to line 537 with : 537 --Changed display_errors = Off from ʻi to ʻOn, ʻesc --End saving with: wq`

Terminal


#Restart Apache and apply
$$ service httpd restart

# [OK]*2 If it comes out, maybe it's okay

2. Install MySQL

--Assuming that you are logged in with administrator privileges as you did last time

Terminal


#MySQL installation
$$ yum install -y mysql-server

#Put something that makes MySQL work nicely with PHP
$$ yum install -y php-mysqlnd

#It feels good in Python
$$ yum install mysql-connector-python

#Start MySQL
$$ service mysqld start

#This and that of MySQL settings
$$ mysql_secure_installation
#Enter as it is when you are asked for the first root password
#You will be asked if you want to change the root password, so yes
#Enter your favorite password
#Anonymous user will ask if you want to delete it, so yes
#After that, all y is fine

#Set the character code in MySQL
$$ vi /etc/my.cnf

# `:set number`Display the number of lines with and the 10th blank line
$$ character-set-server = utf8
#Enter, but repeat`i`After inputting with`esc`In command mode
# `:wq`End of saving with

#Restart MySQL
$$ service mysqld restart
#[OK]If it comes out`OK`

3. Install PHPMyAdmin

--Continued from the previous time, it is assumed that you are in the administrator authority of the virtual environment

Terminal


#Create installation destination for phpMyAdmin
$$ yum-config-manager --enable epel

#Install phpMyAdmin
$$ yum install -y phpmyadmin

#Open phpMyAdmin settings
$$ vi /etc/httpd/conf.d/phpMyAdmin.conf
#Here 127.0.0.If you change the place where 1 is written to global IP, only your local machine can change the connection.
#I don't have to do it
#If you want to change`:%s/127.0.0.1/My global IP/g`Change with

#Restart apache
$$ service httpd restart

--http: // When you connect to the AWS public IP / phpmyadmin /set earlier, the phpMyAdmin page will appear. --Enter the user name root and the password set in the MySQL installation

4. Python installation

--Continued from before In virtual environment (not administrator privileges)

Terminal


#One Linux environment update
$$ sudo yum -y update

#Python installation
$$ sudo yum install python36-devel python36-libs python36-setuptools
#I already have the one that makes MySQL look good in Python

#Restart apache
$$ service httpd restart

5. At the end

――The worst environment construction is the most boring

Recommended Posts

(For myself) Flask_AWS_1 (Install PHP, MySQL, phpMyAdmin, Python in AWS virtual environment)
virtual environment in python
(For myself) Flask_6 (Open db from python, Mysql basic (phpMyAdmin))
Install scrapy in python anaconda environment
install tensorflow in anaconda + python3.5 environment
Install Networkx in Python 3.7 environment for use in malware data science books
Install pip in Serverless Framework and AWS Lambda with Python environment
Install Django in a pipenv virtual environment
Obtaining temporary AWS credentials in PHP, Python
Let's create a virtual environment for Python
[Mac] Building a virtual environment for Python
AtCoder cheat sheet in python (for myself)
python [for myself]
Prepare the development environment for Python on AWS Cloud9 (pip install & time change)
Ubuntu18.04.05 Creating a python virtual environment in LTS
Install python package in personal environment on Ubuntu
Create a virtual environment with conda in Python
Install the python package in an offline environment
Install Python 3.5.1 + numpy + scipy + α in Windows environment
Work in a virtual environment with Python virtualenv.
Use jupyter-lab installed in python virtual environment (venv)
(For myself) AWS_Flask_3 (Install / Run Flask on AWS)
[Introduction for beginners] Working with MySQL in Python
Build an interactive environment for machine learning in Python
How to run python in virtual space (for MacOS)
Summary of python environment settings for myself [mac] [ubuntu]
[For beginners] Install the package in the Anaconda environment (Janome)
Build a Python virtual environment using venv (Django + MySQL ①)
Command line collection for using virtual environment in Anaconda
AWS SDK for Python (Boto3) development in Visual Studio 2017
Use AWS SDK for Python (boto) under Proxy environment
python memo (for myself): About the development environment virtualenv
python virtual environment Pipenv
Write Python in MySQL
Development environment in Python
Virtual environment with Python 3.6
Install Python (for Windows)
Python environment for projects
Enable the virtualenv Python virtual environment for Visual Studio Code
Check the operation of Python for .NET in each environment
Install AWS SDK for PHP on AWS EC2 (PHP7.2 + Apache2.4.41 + OPCashe + Composer)
[Django3] Display a web page in Django3 + WSL + Python virtual environment
Building a development environment for Android apps-creating Android apps in Python
(For myself) Flask_8 (Add / Edit / Delete in database with python)
[Python] Building a virtual python environment for the pyramid tutorial (summary)
How to develop in a virtual environment of Python [Memo]
After enabling the python virtual environment in the batch file, run the python file
Problems and solutions when asked for MySQL db in Python 3
Install CaboCha in Ubuntu environment and call it with Python.
Create a virtual environment for python on mac [Very easy]
Python memo (for myself): Array
[Python] Scraping in AWS Lambda
Install Python environment with Anaconda
Search for strings in Python
Python Tkinter notes (for myself)
Handle environment variables in Python
Pip install in proxy environment
Python environment construction For Mac
Techniques for sorting in Python
Python3 environment construction (for beginners)
Building a Python virtual environment