Apacheの設定をする。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# vi /etc/httpd/conf/httpd.conf LoadModule php5_module /usr/lib64/httpd/modules/libphp5.so AddType application/x-httpd-php .php .phtml # 追加 #ServerName www.example.com:80 # 変更 ServerName www.example.com:80 <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # #Options Indexes FollowSymLinks # 変更 Options FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # #AllowOverride None # 変更 AllowOverride All # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> #DirectoryIndex index.html index.html.var # 変更 DirectoryIndex index.html index.html.var index.php |
phpの設定をする。
1 2 3 4 5 6 7 8 9 |
# vi /etc/php.ini ;post_max_size = 8M # 変更 post_max_size = 100M ;upload_max_filesize = 2M # 変更 upload_max_filesize = 100M ;short_open_tag = Off # 変更 short_open_tag = On |
MySQLの設定をする。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 default-character-set=utf8 ← # 追加 skip-character-set-client-handshake ← # 追加 # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid default-character-set=utf8 ← # 追加 [mysql] ← # 追加 default-character-set=utf8 ← # 追加 |
ApacheとMySQLを起動する。
1 2 3 4 |
# /etc/rc.d/init.d/httpd start # /etc/rc.d/init.d/mysqld start # /sbin/chkconfig httpd on # /sbin/chkconfig mysqld on |
データベースを作成する
1 2 3 4 |
# mysql -u root mysql> grant all privileges on clipbucket.* to clipbucketuser@localhost identified by '12345678'; mysql> create database clipbucket; mysql> exit |
- Database: clipbucket
- Username; clipbucketuser
- Password: 12345678
ダウンロードしたClipBucketのアーカイブを解凍してウェブディレクトリへ配置。
1 2 3 4 |
# cd /vagrant/clipbucket/upload/ # cp -r * /var/www/html # cd /var/www/html # chown -R apache:apache . |
(続く)