May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

CentOS LAMP

# mount /dev/cdrom /mnt/cdrom

# vi /etc/yum.repos.d/CentOS-Media.repo

[c5-media]
name=CentOS-$releasever – Media
baseurl=file:///mnt/cdrom
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

2?
/etc/yum.repos.d/CentOS-Base.repo
# mv /etc/yum.repos.d/CentOS-Base.repo /backup

3? gcc?gcc-c++
yum -y install gcc
yum -y install gcc-c++

2? RPM Apache?MySQL httpd?mysqld

service httpd stop
service mysqld stop

chkconfig  –level  2345  httpd?mysqld?  off

3? SELinux?

1? SELinux

# vi /etc/selinux/config

SELINUX=disabled

2?Netfilter/iptables

# iptables  -F

iptables -Z

iptables  -X

4?

# ntsysv

atd

crond        # atd?crond

irqbalance

microcode_ctl

network

sendmail

sshd

syslog

5

# vi tar.sh
cd /lamp
/bin/ls *.tar.gz > ls.list
/bin/ls *.tgz >> ls.list
for TAR in `cat ls.list`
do
/bin/tar -zxf $TAR
done
/bin/rm ls.list

#yum  install  -y  libxml2-devel

cd /lamp/libxml2-2.6.30
./configure –prefix=/usr/local/libxml2/
make
make install
# libmcrypt
libmcrypt DES, 3DES, RIJNDAEL, Twofish, IDEA, GOST, CAST-256, ARCFOUR, SERPENT, SAFER+
cd /lamp/libmcrypt-2.5.8
./configure –prefix=/usr/local/libmcrypt/
make
make install

#libltdl?libmcrypt

cd /lamp/libmcrypt-2.5.8/libltdl

./configure –enable-ltdl-install

make

make install

zlib

cd /lamp/zlib-1.2.3

./configure

make

make install  >>  /root/zlib.log

#libpng
cd /lamp/libpng-1.2.31
./configure –prefix=/usr/local/libpng/
make
make install

#jpeg6

mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man/man1
cd /lamp/jpeg-6b
./configure –prefix=/usr/local/jpeg6/ –enable-shared –enable-static
make
make install
* –enable-shared?–enable-static

freetype
cd /lamp/freetype-2.3.5
./configure –prefix=/usr/local/freetype/
make
make install

#autoconf
cd /lamp/autoconf-2.61
./configure
make
make install

GD

mkdir /usr/local/gd2
cd /lamp/gd-2.0.35
* png

vi gd_png.c

#include “png.h”  #include “/usr/local/libpng/include/png.h”

./configure –prefix=/usr/local/gd2/ –with-jpeg=/usr/local/jpeg6/ –with-freetype=/usr/local/freetype/ –with-png=/usr/local/libpng/
make
make install

Apache
cd /lamp/httpd-2.2.9
./configure –prefix=/usr/local/apache2/ –sysconfdir=/usr/local/apache2/etc/ –with-included-apr –enable-so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared
make && make install

Apache
/usr/local/apache2/bin/apachectl start
ps –aux | grep httpd
netstat –tlun | grep :80

/usr/local/apache2/modules/mod_deflate.so
chcon -t texrel_shlib_t /usr/local/apache2/modules/mod_deflate.so ?
“chcon -t texrel_shlib_t

echo “/usr/local/apache2/bin/apachectl start” >> /etc/rc.d/rc.local

Ncurses

1?yum -y install “ncurses*”

2?

cd /lamp/ncurses-5.6

./configure –with-shared –without-debug –without-ada –enable-overwrite

make

make install

# MySQL
groupadd mysql
useradd -g mysql mysql
cd /lamp/mysql-5.1.59
./configure –prefix=/usr/local/mysql –without-debug –enable-thread-safe-client –with-pthread –enable-assembler –enable-profiling –with-mysqld-ldflags=-all-static –with-client-ldflags=-all-static –with-extra-charsets=all –with-plugins=all –with-mysqld-user=mysql –without-embedded-server –with-server-suffix=-community –with-unix-socket-path=/tmp/mysql.sock

make

make install

cp /usr/local/mysql/share/mysql/my-medium.cnf  /etc/my.cnf

vi  /etc/my.cnf

1)[client]

default-character-set=utf8

2)[ mysqld]

character-set-server=utf8

collation-server = utf8_general_ci

setfacl -m u:mysql:rwx -R /usr/local/mysql

setfacl -m d:u:mysql:rwx -R /usr/local/mysql

* acl mysql /usr/local/mysql

/usr/local/mysql/bin/mysql_install_db –user=mysql

MySQL?

1.mysql

/usr/local/mysql/bin/mysqld_safe –user=mysql &

2.

vi /etc/rc.local

/usr/local/mysql/bin/mysqld_safe –user=mysql &

3.mysql

/usr/local/mysql/bin/mysqladmin -uroot password 123

history  -c

* mysql root lampbrother

“lampbrother”

/usr/local/mysql/bin/mysql -u root -p

mysql>show databases;

mysql>use test;

mysql>show tables;
mysql> exit

PHP
libtool libtool-ltdl

yum -y install “libtool*”

yum -y install “libtool-ltdl*”

cd /lamp/php-5.2.6

./configure –prefix=/usr/local/php/ –with-config-file-path=/usr/local/php/etc/ –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql/ –with-libxml-dir=/usr/local/libxml2/ –with-jpeg-dir=/usr/local/jpeg6/ –with-png-dir=/usr/local/libpng/ –with-freetype-dir=/usr/local/freetype/ –with-gd=/usr/local/gd2/ –with-mcrypt=/usr/local/libmcrypt/ –with-mysqli=/usr/local/mysql/bin/mysql_config –enable-soap –enable-mbstring=all –enable-sockets

l

–with-config-file-path=/usr/local/php/etc/

–with-apxs2=/usr/local/apache2/bin/apxs

–with-mysql=/usr/local/mysql/

–with-libxml-dir=/usr/local/libxml2

–with-jpeg-dir=/usr/local/jpeg6/

–with-png-dir=/usr/local/libpng/

–with-freetype-dir=/usr/local/freetype/

–with-gd=/usr/local/gd2/

–with-mcrypt=/usr/local/libmcrypt/

–with-mysqli=/usr/local/mysql/bin/mysql_config

–enable-soap

–enable-mbstring=all

–enable-sockets

make
make install

php.ini

cp /lamp/php-5.2.6/php.ini-dist  /usr/local/php/etc/php.ini

vi /usr/local/apache2/etc/httpd.conf

AddType application/x-httpd-php .php .phtml .phps

* .phtml.phps PHP

??Apache???/usr/local/apache2/bin/apachectl stop

/usr/local/apache2/bin/apachectl start

* Apache cannot restore segment prot after reloc: Permission denied

chcon -t texrel_shlib_t /usr/local/apache2/modules/libphp5.so

?vi /usr/local/apache2/htdocs/test.php

<?

phpinfo();

?>

?http://Apache/test.php

/var/www/html/

#memcache

cd /lamp/memcache-2.2.5

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make && make install

#PDO_MYSQL

PDO PHP

cd /lamp/PDO_MYSQL-1.0.2/

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config –with-pdo-mysql=/usr/local/mysql

make && make install

/usr/local/php/etc/php.ini

extension_dir = “/usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/”

extension=”memcache.so”;

extension=”pdo.so”;

extension=”pdo_mysql.so”;

# Zend

cd /lamp/ZendOptimizer-3.2.6-linux-glibc21-i386

./install.sh

l Apache

l /usr/local/php/etc/

l /usr/local/apache2/bin/apachectl

memcache

yum -y install “libevent*”

cd /lamp/memcached-1.4.10

./configure –prefix=/usr/local/memcache

make && make install

useradd memcache

passwd memcache

* Linux root memcache?lampbrother?

/usr/local/memcache/bin/memcached -umemcache &

netstat an | grep :11211

telnet 192.168.10.1 11211

stats

vi /etc/rc.d/rc.local

/usr/local/memcache/bin/memcached -umemcache &

#phpMyAdmin

cp -r /lamp/phpMyAdmin-3.0.0-rc1-all-languages /usr/local/apache2/htdocs/phpmyadmin

cd /usr/local/apache2/htdocs/phpmyadmin

cp config.sample.inc.php config.inc.php

vi config.inc.php

$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;

$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;

http://Apache/phpmyadmin/index.php

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘123’ WITH GRANT OPTION;

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>