- 追加された行はこの色です。
- 削除された行はこの色です。
[[Linuxめも]]
#contents
*日本語化 [#pf4ec3f0]
# localectl set-locale LANG=ja_JP.UTF-8
# source /etc/locale.conf
*SELinuxを無効化 [#i87d33e8]
# vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled
サーバを再起動
*vsftpdのインストール [#rf599119]
# yum install vsftpd
# vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
ls_recurse_enable=YES
use_localtime=YES
# touch /etc/vsftpd/chroot_list
# chmod 600 /etc/vsftpd/chroot_list
# /etc/rc.d/init.d/vsftpd start
自動起動設定
# chkconfig vsftpd on
設定確認
# chkconfig --list vsftpd
*PostgreSQLのインストール [#mee6e453]
# yum install postgresql-server
自動起動設定
# chkconfig postgresql on
データベースの初期化
# su postgres
$ initdb --encoding=UTF8 --no-locale -D /var/lib/pgsql/data
起動
# /etc/rc.d/init.d/postgresql start
無ければ
# service postgresql start
*MySQLのインストール [#d69464f3]
# yum install mysql mysql-devel mysql-server
# /etc/rc.d/init.d/mysqld start
自動起動設定
# chkconfig mysqld on
コンソール経由で文字化けする場合
設定ファイルに2行を追加してMySQLを再起動
# vi/etc/my.cnf
[mysqld]
default-character-set=utf8
skip-character-set-client-handshake
**MariaDBのインストール [#vc9b31ee]
CentOS7からはMySQLと互換性があるMariaDBが標準になっているようです。
# yum install mariadb mariadb-server
起動
# systemctl start mariadb.service
停止
# systemctl stop mariadb.service
自動起動を有効にする
# systemctl enable mariadb.service
確認
# systemctl is-enabled mariadb.service
*Apacheのインストール [#i3eca5e0]
# yum install httpd
自動起動設定
# chkconfig httpd on
起動
# /etc/rc.d/init.d/httpd start
無ければ
# systemctl start httpd.service
CentOS7の場合、configtestとgracefulはserviceを使用します。
# service httpd configtest
# vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
UseCanonicalName On
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
AllowOverride All
Options FollowSymlinks ExecCGI
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
*つながらない場合 [#t9b7d63f]
firewalldとやらがじゃまをしているらしいので停止
# systemctl stop firewalld
再起動後も自動起動しないようにするためには
# systemctl disable firewalld
*PHPのインストール [#lc043ef2]
# yum install php php-cli php-common php-mbstring php-pdo php-pgsql php-mysql php-gd php-pear php-xml php-intl
**PHP7のインストール [#o26c9768]
# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# yum install --enablerepo=remi,remi-php70 php php-cli php-common php-mbstring php-pdo php-pgsql php-mysql php-gd php-pear php-xml php-intl