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.

ubuntu20 LEMPP phpmyadmin

Last updated at Posted at 2022-03-12

install.sh

# ufw(ファイアウォール)をインストール
sudo apt install ufw

# インストール直後はufwはファイアウォールとして指定されないためufwを有効化「このコマンドを実行するとssh接続が切れるかも知れませんがいいですか?」と聞かれるので y を入力してEnter
sudo ufw enable

# sshのポートを開く
# これを行わないとssh切断したあと接続出来なくなってしまいます!
sudo ufw allow 22

# nginxを使用するポートを開く
sudo ufw allow 80

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

sudo vi LEMPP.sh

sudo apt-get install -y php php-intl php-mbstring php-mysql php-gd php-xml
sudo apt-get install -y php-fpm php-curl php-common php-json php-mbstring php-zip php-xml php-tokenizer
sudo apt-get install -y mysql-server
sudo apt install -y sqlite3
sudo apt install php7.4 
sudo apt install php7.4-fpm
sudo apt-get install -y nginx
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install npm
sudo pip3 install uwsgi
sudo apt-get install python3 
sudo apt install python3-pip
sudo apt-get install python3-dev default-libmysqlclient-dev
sudo pip3 install mysqlclient
sudo pip3 install django


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

nginxの設定

sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl restart nginx
sudo systemctl status nginx 
sudo systemctl is-enabled nginx
sudo systemctl restart nginx
sudo systemctl status php7.4-fpm
sudo systemctl is-enabled php7.4-fpm
sudo systemctl restart php7.4-fpm
sudo apt install php php-mysql php-fpm
sudo nginx -t
sudo systemctl restart nginx
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

14.ブラウザで、次のアドレスを使用してナビゲートします。次のスクリーンショットに示すように、PHP構成ページが読み込まれます。
点線部内のように設定する
http://IP/info.php

webサーバーはescキーでエスケープし、DB設定のみいいえで次へ進む。


sudo apt-get install phpmyadmin
sudo systemctl status php7.4-fpm
sudo systemctl is-enabled php7.4-fpm

sudo vi /etc/nginx/sites-available/default
---------------------------------


           # Add index.php to the list if you are using PHP
        index index.php index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        }

---------------------------------

#設定
sudo nginx -t
sudo systemctl restart nginx
sudo ln -s  /usr/share/phpmyadmin /var/www/html/phpmyadmin
sudo chmod 775 -R /usr/share/phpmyadmin/
sudo chown root:www-data -R /usr/share/phpmyadmin/

http://SERVER_IP/phpmyadmin
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?