Setup DATADISK |
fdisk -l |
fdisk /dev/sdc : n - p - 1 - CR - CR |
: t - 8e |
: w |
pvcreate /dev/sdc1 vgcreate lg1 /dev/sdc1 |
vgdisplay |
lvcreate -L 1G /dev/lg1 -n lv1 lvextend -l 100%VG /dev/lg1/lv1 |
lvdisplay |
mkfs.ext3 /dev/lg1/lv1 |
vim /etc/fstab /dev/lg1/lv1 /datadisk ext3 defaults 1 1 |
/dev/mapper/lg1-lv1 /datadisk ext3 defaults 1 1 |
mkdir /datadisk mount /datadisk |
vim /etc/snmp/snmpd.conf vim /etc/mrtg/server-info-num.cfg |
httpd on DATADISK |
cd /datadisk mkdir -p var/log/httpd mkdir -p etc/httpd/conf mkdir -p etc/httpd/conf.d mkdir -p var/www |
cd /var/www cp -a mrtg/ /datadisk/var/www/ rm -rf /var/www |
cd /etc rm -rf httpd mkdir httpd cd /etc/httpd ln -s /datadisk/etc/httpd/conf/ conf ln -s /datadisk/etc/httpd/conf.d/ conf.d cd /var ln -s /datadisk/var/www/ www cd /var/log ln -s /datadisk/var/log/httpd/ httpd |
yum install httpd chkconfig --levels 2345 httpd on chkconfig --list httpd |
system-config-securitylevel-tui |
mkdir /datadisk/www mkdir /www cd / ln -s /datadisk/www www |
cd /etc/httpd/conf vim httpd.conf NameVirtualHost *:80 |
<VirtualHost *:80> <Directory "/www/www.mydomain.com/"> # Options +Includes # XBitHack Full </Directory> ServerName www.mydomain.com ServerAlias mydomain.com DocumentRoot /www/www.mydomain.com ErrorLog logs/vhost_mydomain_com_error_log CustomLog logs/vhost_mydomain_com_access_log combined #ScriptAlias /cgi-bin/ /www/www.mydomain.com/cgi-bin/ </VirtualHost> |
mysqld on DATADISK |
yum install mysql-server |
cd /etc cp -a my.cnf /datadisk/etc/ rm my.cnf ln -s /datadisk/etc/my.cnf my.cnf |
vim /etc/my.cnf [mysqld] datadir=/datadisk/mysql |
service mysqld start |
/usr/bin/mysqladmin -u root password '<newpassword>' |
vim my.cnf [mysqld] wait_timeout=604800 |
tomcat6 on DATADISK |
yum install java-1.6.0 |
yum install tomcat6 |
cd /var/lib/ cp -a tomcat6 /datadisk/ mv tomcat6 __tomcat6 ln -s /datadisk/tomcat6/ tomcat6 cd /etc cp -a tomcat6 /datadisk/etc/ mv tomcat6 __tomcat6 ln -s /datadisk/etc/tomcat6/ tomcat6 |
yum install tomcat6-webapps |
service tomcat6 start |
system-config-securitylevel-tui |
yum install tomcat6-admin-webapps |
vim /etc/tomcat6/tomcat-users.xml ... <user username="admin" password="<#admin password#>" roles="admin,manager"/> ... |
service tomcat6 restart |