2
2

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.

【CentOS7】<メモ> Webサーバー セットアップ

Last updated at Posted at 2015-12-08

不要なサービス

  • mdmonitor
サービス無効化
systemctl disable mdmonitor

SELinux無効化

selinux
setenforce 0
vim /etc/sysconfig/selinux
    SELINUX=disabled

killall

psmiscパッケージをインストールする

psmisc
yum -y install psmisc

RPMリポジトリ

RPMリポジトリ追加
yum -y install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

httpd

httpd
yum -y install httpd
firewall-cmd --permanent --add-service=http
systemctl restart firewalld
systemctl start httpd
systemctl enable httpd

不要なモジュール、設定

内容をすべてコメントアウトする
削除してはダメ(アップデート時に再作成される)

  • conf.modules.d/00-dav.conf
  • conf.modules.d/00-lua.conf
  • conf.modules.d/00-proxy.conf
  • conf.modules.d/00-ssl.conf
  • conf.modules.d/01-cgi.conf
  • conf.modules.d/10-fcgid.conf
  • conf.d/fcgid.conf
  • conf.d/ssl.conf
  • conf.d/welcome.conf

一部のモジュールをコメントアウトする

  • conf.modules.d/00-base.conf

コメントアウトするモジュール

  • mod_authn_anon
  • mod_authn_dbd
  • mod_authn_dbm
  • mod_authn_socache
  • mod_authz_dbd
  • mod_authz_dbm
  • mod_cache
  • mod_cache_disk
  • mod_dbd
  • mod_dumpio
  • mod_echo
  • mod_ext_filter
  • mod_filter
  • mod_include
  • mod_info
  • mod_status
  • mod_substtute
  • mod_suexec
  • mod_unqiue_id
  • mod_userdir
  • mod_version

VirtualHost

VirtualHost
<VirtualHost *>
  ServerName   HOSTNAME
  ServerAlias  ALIAS_HOSTNAME
  DocumentRoot DOCUMENT_ROOT_DIR
  CustomLog    ACCESS_LOG_FILE_PATH combined
  ErrorLog     ERROR_LOG_FILE_PATH
</VirtualHost>
<Directory DOCUMENT_ROOT_DIR>
  Options       FollowSymLinks
  AllowOverride All
  Require       all granted
</Directory>

PHP 5.6

インストール

インストール
yum -y erase php*
yum -y install php-pear
yum -y install php56 php56-php-bcmath php56-php-gd php56-php-mbstring php56-php-mcrypt php56-php-mysqlnd php56-php-pdo php56-php-pgsql php56-php-soap php56-php-xcache php56-php-xmlrpc php56-xcache-admin php56-php-devel

設定

設定
ln -s /opt/remi/php56/root/etc/php.ini /etc/
ln -s /opt/remi/php56/root/etc/php.d /etc/
mv /usr/bin/php /usr/bin/php54
ln -s /usr/bin/php56 /usr/bin/php
vim /etc/php.ini
    date.timezone = Asia/Tokyo

MariaDB

インストール

MariDB
yum -y install mariadb-server

設定

デフォルトのままでOK

起動

起動
systemctl start mariadb
systemctl enable mariadb

git

デプロイ

デプロイ
git clone REMOTE_REPOSITORY_URL DOUCMENT_ROOT_DIR

更新

更新
git pull
2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?