2008年3月8日星期六

LAMP starts

First it is ftp. That is always the way one deploy a site to server.

Download vsftp, ./configure and then make install.
Or install with yum or atp.
Edit /etc/vsftpd.conf(or maybe /etc/vsftpd/vsftpd.conf).
To enable anonymous access, add the 2 following line:

anon_root=/data
anon_upload_enable=YES

To add another user,

todo here...

Then we go with mysql 5.0(5.0.51a.)

Get mysql noninstall version, unpack it into /usr/local.
make a symbol link as /usr/local/mysql to /usr/local/mysql.real.path.
and execute the following command to create users and start mysql daemon:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf - shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &

copy one of the support-files/my-*.cnf to /etc/my.cnf as the default mysql config.

To stop mysql : mysqladmin shutdown

If needed, use mysqladmin -u root -p shutdown


After mysql started, we need to add some account to it.

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;

mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';

mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';

'all privileges' means this user can do anything.
*.* means all tables
'monty' is the user name, 'localhost' is the ip address from where this user can login.
'some_pass' is password.
'grant option' means this user can do grant operation.

To use old passward format for old mysql client :

mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Alternative :

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES; 
Or:
Start mysqld with the --old-passwords option.

Then we go with php5 (mysql 4.1 or later requires php 5).

download php source &

./configure --with-mysql & make install.



没有评论: