LoginSignup
0
0

More than 5 years have passed since last update.

Apache on Centos 7

Last updated at Posted at 2016-05-29

セットアップ

yum install httpd php php-mbstring
hostname "マシン名"
vi /etc/sysconfig/network ```
HOSTNAME="マシン名"
vi /etc/hosts
127.0.0.1   ドメイン名 localhost localhost4

vi /etc/httpd/conf/httpd.conf
>ServerName ドメイン名
>
<Directory />
   Options FollowSymlinks
>
<Directory "/var/www/html">
   Options ExecCGI
   AllowOverride All
>Directoryindex index.html index.php

次に,管理者ユーザを作成,コンテンツフォルダの所有者を作ったユーザにする.

useradd -u 1001 -M -d /home/www/ www
chown -R www:www /var/www/html

テスト

ブラウザで
127.0.0.1:80

MariaDBとの接続

yum install php-mysqlnd
phpが参照するMariaDBのデフォルトソケットを対称のソケットに変更.
```
vi /etc/php.ini

mysql.default_socket = <対称のディレクトリ>

何もしないと恐らく,mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.みたいなエラーが出るので,パスワードを新しいフォーマットに変える.

mysql -u root -p
SET @@session.old_passwords = 0;
SET PASSWORD FOR root@localhost = PASSWORD('ここにパスワード');
```

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