3
1

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 5 years have passed since last update.

【tutorial】AWS EC2にPHP, Apache, Laravel, MySQLをインストール→ログインページを表示

Last updated at Posted at 2018-04-18

2018/04/18に実施。

1.PHP, Apache, Laravelをインストール。
https://qiita.com/d778980/items/78b467af625b405e7f50

2.MySQLをインストール。

sudo rpm -Uhv http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
sudo yum -y install mysql-community-server

3.MySQLを起動。

sudo service mysqld start

4.MySQLに接続。エラーが発生。

mysql -u root

1.jpg

5.MySQLを停止。オプション付きで起動。

sudo service mysqld stop
sudo mysqld_safe --skip-grant-tables & sudo service mysqld start

6.MySQLに接続。権限を初期化。

mysql -u root
use mysql;
truncate table user;
flush privileges;
grant all privileges on *.* to root@localhost identified by 'パスワード' with grant option;
flush privileges;

7.database, user を作成。

create database homestead;
create user homestead@localhost identified by 'secret';
grant all on homestead.* to homestead@localhost;
exit;

8.プロジェクトに移動してログイン機能を作成。エラーが発生。

cd /var/www/laravel/sample/
sudo chmod -R 777 /var/www/laravel/sample
php artisan make:auth
php artisan migrate

2.jpg

9.php-pdo, php-mysqlをインストール。

sudo yum -y install --disablerepo=* --enablerepo=remi,remi-php70 php-pdo
sudo yum -y install --disablerepo=* --enablerepo=remi,remi-php70 php-mysql

10.「8.」をリトライ。成功。
php artisan migrate

11./etc/httpd/conf/httpd.confを編集して.htaccessを有効化。

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
↓↓
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

12.ブラウザでログインページを表示。
http://(パブリックDNS)/login
3.jpg

終わり。

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?