パスワードを忘れた? アカウント作成
397071 journal

kyoyaの日記: 5.2CURRENT - cacti/rrdtool/mysql/php/apach2

日記 by kyoya

■mysql導入
$ cd /usr/ports/databases/mysql40-client
$ make install
// so登録
$ cd /usr/local/lib
$ chmod g-w mysql
$ ldconfig -m /usr/local/lib/mysql // これは/usr/local/etc/rc.d以下の起動時スクリプトで起動時実行される。

■cacti導入
$ cd /usr/ports/net/cacti
$ make install
// 途中でPHPのインストール時にオプション選択ダイアログが表示される。とりあえずデフォルト。-> Apach2をチェックする。
==========================================================
Cacti is now installed. You may have to follow this steps
to make it work correctly.

1: Create the MySQL database
# mysqladmin --user=root create cacti
2: Create a mysql user/password for cacti
# echo "CREATE DATABASE cacti;
GRANT ALL ON cacti.* TO cactiuser at localhost IDENTIFIED BY 'cactiuser';
FLUSH PRIVILEGES;" | mysql &&
3: Import the default cacti database
# mysql cacti /dev/null 2>&1
6: Point your web browser to the cacti dir and login with admin/admin

Have fun!
==========================================================

上記メッセージにしたがって
$ mysqladmin --user=root create cacti
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
// エラー

$ ls /tmp/mysql.sock
ls: /tmp/mysql.sock: No such file or directory
// ない。

$ pkg_info |grep -i mysql
mysql-client-4.0.22 Multithreaded SQL database (client)
php4-mysql-4.3.9 The mysql shared extension for php
// mysqlサーバは依存関係でインストールされないようなので自分で。

■mysql-server
$ cd ../../databases/mysql40-server/
$ make install

// エラーが
...
cc -c -I. -I../.././bdb/dist/../include -D_THREAD_SAFE -DDBUG_OFF -O -pipe ../.././bdb/dist/../os/os_open.c
cc -c -I. -I../.././bdb/dist/../include -D_THREAD_SAFE -DDBUG_OFF -O -pipe ../.././bdb/dist/../os/os_region.c
cc -c -I. -I../.././bdb/dist/../include -D_THREAD_SAFE -DDBUG_OFF -O -pipe ../.././bdb/dist/../os/os_rename.c
cccc: in free(): error: junk pointer, too high to make sense
*** Signal 6

Stop in /usr/ports/databases/mysql40-server/work/mysql-4.0.22/bdb/build_unix.
*** Error code 1

Stop in /usr/ports/databases/mysql40-server/work/mysql-4.0.22/bdb.
*** Error code 1

Stop in /usr/ports/databases/mysql40-server/work/mysql-4.0.22.
*** Error code 1

Stop in /usr/ports/databases/mysql40-server/work/mysql-4.0.22.
*** Error code 1

$ make deinstall
$ make reinstall
// よくわからないけど通ったようだ

===> SECURITY REPORT:
            This port has installed the following files which may act as network
            servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/mysqld

            This port has installed the following startup scripts which may cause
            these network services to be started at boot time.
/usr/local/etc/rc.d/mysql-server.sh

            If there are vulnerabilities in these programs there may be a security
            risk to the system. FreeBSD makes no guarantee about the security of
            ports included in the Ports Collection. Please type 'make deinstall'
            to deinstall the port if this is a concern.

            For more information, and contact details about the security
            status of this software, see the following webpage:
http://www.mysql.com/

ls /tmp/mysql.sock
ls: /tmp/mysql.sock: No such file or directory

■mysqlサーバ起動
$ cd /usr/local/bin
$ ./mysql_install_db
Installing all prepared tables
041121 22:25:41 /usr/local/libexec/mysqld: Shutdown Complete

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/bin/mysqladmin -u root password 'new-password'
/usr/local/bin/mysqladmin -u root -h wererat.localdomain password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL &1

// config.php確認
$ /usr/local/share/cacti/include/config.php
...
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
...

// Apach2設定し
$ cat /usr/local/etc/apache2/httpd.conf
...
Alias /cacti/ "/usr/local/share/cacti/"
AddType application/x-httpd-php .php .php4
AddType application/x-httpd-php-source .phps .php4s

// 文法チェック
$ apachectl configtest
Syntax OK

// 再起動
$ /usr/local/etc/rc.d/apache2.sh forcerestart

PHP設定が不安なので再度インストール
$ pkg_remove php
$ cd /usr/port/net/cacti
$ make reinstall
// PHP4のDialogでApach2をチェック。

■もいちどmysql設定
$ /usr/local/bin/mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.0.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti';
Query OK, 0 rows affected (0.15 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.16 sec)

mysql> exit
Bye

$ cd /usr/local/share/cacti
$ mysql -u cacti -p cacti 参考

$ cd /usr/local/share/cacti
$ mysqladmin --user=root create cacti
$ mysql cacti grant all on cacti.* to cactiuser@localhost identified by 'cactiuser' ;
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql> exit
Bye

$ chown -R cactiuser rra/ log/

//crontab 設定
$ crontab -u cactiuser -e

WebAccess
初期 password/user は admin/admin

この議論は賞味期限が切れたので、アーカイブ化されています。 新たにコメントを付けることはできません。
typodupeerror

アレゲはアレゲを呼ぶ -- ある傍観者

読み込み中...