Wednesday, May 04, 2005
Monday, May 02, 2005
LVM notes:
vgcreate VolGroup00 /dev/hdc1
vgdisplay VolGroup00
Physical extent size was 4MB (default). Too small.
vgremove VolGroup00
vgcreate -s 32M VolGroup00 /dev/hdc1
Now PE size is 32MB, total PEs 5961.
Create logical volume:
lvcreate -l 5961 VolGroup00 -n LogVol00
mkfs -t ext3 /dev/VolGroup00/LogVol00
(disk formatting takes place)
Create mount point:
cd /
mkdir /myth
Update /etc/fstab. Added line:
/dev/VolGroup00/LogVol00 /myth ext3 defaults 1 2
Mount the volume:
mount -a
Other cmds:
vgchange
vgcreate VolGroup00 /dev/hdc1
vgdisplay VolGroup00
Physical extent size was 4MB (default). Too small.
vgremove VolGroup00
vgcreate -s 32M VolGroup00 /dev/hdc1
Now PE size is 32MB, total PEs 5961.
Create logical volume:
lvcreate -l 5961 VolGroup00 -n LogVol00
mkfs -t ext3 /dev/VolGroup00/LogVol00
(disk formatting takes place)
Create mount point:
cd /
mkdir /myth
Update /etc/fstab. Added line:
/dev/VolGroup00/LogVol00 /myth ext3 defaults 1 2
Mount the volume:
mount -a
Other cmds:
vgchange
Fedora Core 3, yum setup:
Add Redhat keys to yum:
rpm --import /usr/share/doc/fedora-release-3/RPM-GPG-KEY*
Else, you'll get "NOKEY" warning from RPM when trying 'yum install
[ fedorafaq.org ]
yum list
List all available packages.
yum check-update or yum list updates
See if there are updated packages available.
yum update
Update all installed packages that have a newer version available.
yum install
Install specific packages and their dependencies.
yum search
Search all known packages entries (descriptions etc) for word.
yum info
Show basic information about a package.
All of the above commands can take shell-style wildcards (*,?) instead of a package name. Check the yum man page for more details.
Reduce yum retries and timeout cuz mirrors go down and take forever:
/etc/yum.conf:
retries=1
timeout=10
FEDORA EXTRAS SETUP:
--------------------
Import repository key:
rpm --import http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
Created new file called 'fedora-extras.repo' in /etc/yum.repos.d/
File contains:
[extras]
name=Fedora Extras - $releasever - $basearch
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
gpgcheck=1
gpgkey=http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
[extras-debug]
name=Fedora Extras - $releasever - $basearch - Debugging packages
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/debug/
gpgcheck=1
gpgkey=http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
enabled=0
##########################
List available pacakges:
yum list available | less
===
Check for updates:
yum check-update | less
tar exclude:
tar --exclude '*.JPG' --exclude '*.jpg' -zcvf ~/bkup.tgz *
tar --exclude '*.JPG' --exclude '*.jpg' -zcvf ~/bkup.tgz *
ssh server setup:
edit /etc/ssh/sshd_config
Change
# Port 22
to
Port 2222
Change
# Protocol 2,1
to
Protocol 2
# ListenAddress 0.0.0.0
to
ListenAddress x.y.z.t
# PermitRootLogin yes
to
PermitRootLogin no
restart sshd:
# /etc/rc.d/init.d/sshd restart
check sessions with
netstat -a
edit /etc/ssh/sshd_config
Change
# Port 22
to
Port 2222
Change
# Protocol 2,1
to
Protocol 2
# ListenAddress 0.0.0.0
to
ListenAddress x.y.z.t
# PermitRootLogin yes
to
PermitRootLogin no
restart sshd:
# /etc/rc.d/init.d/sshd restart
check sessions with
netstat -a
PHP and mysql installation:
Test if php has mysql module:
Make .php script in user html area:
phpinfo();
?>
View in web browser. If there is a mysql section then mysql is installed.
Test if php has mysql module:
Make .php script in user html area:
phpinfo();
?>
View in web browser. If there is a mysql section then mysql is installed.
phpbb installation:
Quickstart: Flash tutorial on phpbb.com
Extracted all files from .tgz file to tmp dir.
Copied all files to /var/www/html/forum
chmod 666 /var/www/html/forum/config.php
In browser, go to:
http://192.168.1.200:81/forum/install/install.php
Set mysql version, database, username/pw.
chmod back to 644.
delete 'contrib' and 'install' dirs.
Login and setup forums:
http://..../forum/login.php
Quickstart: Flash tutorial on phpbb.com
Extracted all files from .tgz file to tmp dir.
Copied all files to /var/www/html/forum
chmod 666 /var/www/html/forum/config.php
In browser, go to:
http://192.168.1.200:81/forum/install/install.php
Set mysql version, database, username/pw.
chmod back to 644.
delete 'contrib' and 'install' dirs.
Login and setup forums:
http://..../forum/login.php
Mysql installation/setup:
Make sure mysql and mysql-server are installed:
-----------------------------------------------
[root@bouncer tmp]# rpm -qa|egrep -i sql
libdbi-dbd-mysql-0.6.5-9
mysql-3.23.58-13
mod_auth_mysql-20030510-5
php-mysql-4.3.9-3
mysql-bench-3.23.58-13
mysql-server-3.23.58-13
MySQL-python-0.9.2-4
perl-DBD-MySQL-2.9003-5
mysql-devel-3.23.58-13
Run mysql for the first time:
-----------------------------
[root@bouncer tmp]# /etc/rc.d/init.d/mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
Verify mysql server is online:
------------------------------
[root@bouncer tmp]# /usr/bin/mysqladmin status
Remove anonymous access to mysql:
---------------------------------
shell> mysql -u root
mysql> DELETE FROM mysql.user WHERE User = '';
mysql> FLUSH PRIVILEGES;
Set password for user 'root':
-----------------------------
First, find out what the machines hostname is:
mysql> SELECT Host, User FROM mysql.user;
+-------------------------+------+
| Host | User |
+-------------------------+------+
| bouncer.ourbabyhome.com | root |
| localhost | root |
+-------------------------+------+
2 rows in set (0.01 sec)
(hostname is bouncer.ourbabyhome.com)
To assign passwords to the root accounts using mysqladmin, execute the following commands:
shell> mysqladmin -u root password "newpwd"
shell> mysqladmin -u root -h host_name password "newpwd"
eg.
# mysqladmin -u root password "mypass"
# mysqladmin -u root -h bouncer.ourbabyhome.com password "mypass"
Check like so:
mysql> SELECT Host, User,Password FROM mysql.user;
+-------------------------+------+------------------+
| Host | User | Password |
+-------------------------+------+------------------+
| localhost | root | 137245292607ad59 |
| bouncer.ourbabyhome.com | root | 137245292607ad59 |
+-------------------------+------+------------------+
2 rows in set (0.00 sec)
===
Grant a user access to a database:
CREATE DATABASE mydatabase;
GRANT ALL ON mydatabase.* TO fred@localhost IDENTIFIED BY "mypass"
grant all on bouncer.* TO donn@localhost IDENTIFIED by "mypass";
grant all on bouncer.* TO donn@bouncer.ourbabyhome.com IDENTIFIED by "mypass";
Make sure mysql and mysql-server are installed:
-----------------------------------------------
[root@bouncer tmp]# rpm -qa|egrep -i sql
libdbi-dbd-mysql-0.6.5-9
mysql-3.23.58-13
mod_auth_mysql-20030510-5
php-mysql-4.3.9-3
mysql-bench-3.23.58-13
mysql-server-3.23.58-13
MySQL-python-0.9.2-4
perl-DBD-MySQL-2.9003-5
mysql-devel-3.23.58-13
Run mysql for the first time:
-----------------------------
[root@bouncer tmp]# /etc/rc.d/init.d/mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
Verify mysql server is online:
------------------------------
[root@bouncer tmp]# /usr/bin/mysqladmin status
Remove anonymous access to mysql:
---------------------------------
shell> mysql -u root
mysql> DELETE FROM mysql.user WHERE User = '';
mysql> FLUSH PRIVILEGES;
Set password for user 'root':
-----------------------------
First, find out what the machines hostname is:
mysql> SELECT Host, User FROM mysql.user;
+-------------------------+------+
| Host | User |
+-------------------------+------+
| bouncer.ourbabyhome.com | root |
| localhost | root |
+-------------------------+------+
2 rows in set (0.01 sec)
(hostname is bouncer.ourbabyhome.com)
To assign passwords to the root accounts using mysqladmin, execute the following commands:
shell> mysqladmin -u root password "newpwd"
shell> mysqladmin -u root -h host_name password "newpwd"
eg.
# mysqladmin -u root password "mypass"
# mysqladmin -u root -h bouncer.ourbabyhome.com password "mypass"
Check like so:
mysql> SELECT Host, User,Password FROM mysql.user;
+-------------------------+------+------------------+
| Host | User | Password |
+-------------------------+------+------------------+
| localhost | root | 137245292607ad59 |
| bouncer.ourbabyhome.com | root | 137245292607ad59 |
+-------------------------+------+------------------+
2 rows in set (0.00 sec)
===
Grant a user access to a database:
CREATE DATABASE mydatabase;
GRANT ALL ON mydatabase.* TO fred@localhost IDENTIFIED BY "mypass"
grant all on bouncer.* TO donn@localhost IDENTIFIED by "mypass";
grant all on bouncer.* TO donn@bouncer.ourbabyhome.com IDENTIFIED by "mypass";
Mysql
Convert column from char to enum:
ALTER TABLE my_table MODIFY my_col ENUM('K','X') NOT NULL;
Convert column from char to enum:
ALTER TABLE my_table MODIFY my_col ENUM('K','X') NOT NULL;
Apache SSL configuration/setup:
Followed directions from:
http://slacksite.com/apache/certificate.html
(also saved as PDF on laptop)
Gen'd new server key:
$ openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024
Where file1:file2:... are any files for generating seed random numbers.
Created CSR:
$ openssl req -new -key server.key -out server.csr
Self-signed CSR:
$ openssl x509 -req -days 1800 -in server.csr -signkey server.key -out server.crt
(1800 days = 5 years)
Copied server.key to
/etc/httpd/conf/ssl.key/server.key
Copied server.crt to
/etc/httpd/conf/ssl.crt/server.crt
These conf dirs are specified by:
/etc/httpd/conf.d/ssl.conf
Restart apache:
/usr/sbin/apachectl restart
Followed directions from:
http://slacksite.com/apache/certificate.html
(also saved as PDF on laptop)
Gen'd new server key:
$ openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024
Where file1:file2:... are any files for generating seed random numbers.
Created CSR:
$ openssl req -new -key server.key -out server.csr
Self-signed CSR:
$ openssl x509 -req -days 1800 -in server.csr -signkey server.key -out server.crt
(1800 days = 5 years)
Copied server.key to
/etc/httpd/conf/ssl.key/server.key
Copied server.crt to
/etc/httpd/conf/ssl.crt/server.crt
These conf dirs are specified by:
/etc/httpd/conf.d/ssl.conf
Restart apache:
/usr/sbin/apachectl restart
Tweak hard drive parameters with: hdparm
# man hdparm
# man hdparm