- 追加された行はこの色です。
- 削除された行はこの色です。
[[Linuxめも]]
#contents
*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
*PostgreSQLのインストール [#mee6e453]
自動起動設定
# yum install postgresql-server
# chkconfig vsftpd on
自動起動設定
設定確認
# chkconfig postgresql on
# chkconfig --list vsftpd
確認
*PostgreSQLのインストール [#mee6e453]
# chkconfig --list postgresql
# yum install postgresql-server
データベースの初期化
自動起動設定
# su postgres
# chkconfig postgresql on
$ initdb --encoding=UTF8 --no-locale -D /var/lib/pgsql/data
データベースの初期化
# su postgres
$ initdb --encoding=UTF8 --no-locale -D /var/lib/pgsql/data
起動
$ postmaster -D /var/lib/pgsql/data
# /etc/rc.d/init.d/postgresql start
*MySQLのインストール [#d69464f3]
$ exit
# yum install mysql mysql-devel mysql-server
# /etc/rc.d/init.d/mysqld start
# yum install mysql mysql-devel mysql-server
# /etc/rc.d/init.d/mysqld start
自動起動設定
# /sbin/chkconfig --add mysqld
# /sbin/chkconfig mysqld on
# /sbin/chkconfig --list mysqld
# chkconfig mysqld on
コンソール経由で文字化けする場合
設定ファイルに2行を追加してMySQLを再起動
# vi/etc/my.cnf
# vi/etc/my.cnf
[mysqld]
default-character-set=utf8
skip-character-set-client-handshake
*Apacheのインストール [#i3eca5e0]
# yum install httpd
# yum install httpd
自動起動設定
# chkconfig httpd on
# chkconfig httpd on
確認
# chkconfig --list httpd
起動
# service httpd start
# /etc/rc.d/init.d/httpd start
# vi /etc/httpd/conf/httpd.conf
# vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
UseCanonicalName On
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>
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<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-mbstring php-pgsql php-mysql php-gd php-pear php-xml
# yum install php php-cli php-common php-mbstring php-pdo php-pgsql php-mysql php-gd php-pear php-xml php-intl