LINUX系统 LAMP

一 准备
ip 192.168.100.1
DNS
mount /dev/cdrom
cd /media/cdrom/RedHat/RPMS/
cp caching...~
cd
mount /dev/cdrom
cd /media/cdromRedHat/RPMS/
cp bind-9...~
rpm -ivh caching... bind...
vi /etc/named.conf
zone "benet.com" {
 type master;
 file "benet.com.hosts";
};
zone "accp.com" {
 type master;
 file "accp.com.hosts";
};
cd /var/named/
cp named.local benet.com.hosts
vi benet.com.hosts
www IN A 192.168.100.1
cp benet.com.hosts accp.com.hosts
/etc/rc.d/init.d/named restart
nslookup
二 apache
cp /mnt/hgfs/linux/httpd-2.0.59.tar.gz ~
date -s 20090708
date -s 1111
tar -zxf httpd-2.0.59.tar.gz
cd httpd-2.0.59
ls
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite
make
make install
vi /usr/local/apache2/conf/httpd.conf
[删除dirctory之间的‘#’‘-indexes'
在最后写:
NameVirtualHost 192.168.100.1
<VirtualHost 192.168.100.1>
 serverName www.benet.com
 DocumentRoot /home/benet/public_html
</VirtualHost>
<VirtualHost 192.168.100.1>
 serverName www.accp.com
 DocumentRoot /home/accp/public_html
</VirtualHost>
]
adduser accp
cd /home/benet/
mkdir public_html
cd public_html/
echo benet > index.html
cd /home
cd /accp
mkdir pub
rm -rf pub
mkdir public_html
cd public_html
echo accp > index.html
chmod o=x *
/usr/local/apache2/bin/apachect1 start
三 mysql
cp /mnt/hgfs/linux/mysql-3.23.58-pc-linux-i686.tar.gz ~
tar -zxf mysql-3.23.58-pc-linux-i686.tar.gz -C /usr/local/
cd /usr/local/
ls
ln -s mysql-3.23.58-pc-linux-i686/ mysql
cd mysql
ls
rm -rf /etc/my.cnf
./scripts/mysql_install_db
adduser mysql:mysql * -R
ls
./bin/safe_mysqld --user=mysql &
./bin/mysql
quit
./bin/mysqladmin -u root password '123.com'
./bin/mysql -u root -p
quit
四 PHP
cp /mnt/hgfs/linux/php-4.4.4.tar.gz ~
ls
tar -zxf php-4.4.4.tar.gz
cd php-4.4.4
./configure --prefix=/usr/local/php4 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php4
make
make install
cp php.ini-dist /usr/local/php4/php.ini
vi /usr/local/apache2/conf/httpd.conf
[ LoadModule php4_module ...  .so 
AddType Application/x-httpd-php .php
(/index.html)
DirectoryIndex index.php  index.html index.html.var]
cd /usr/local/apache2/bin/
killall -9 httpd
ps -ax
./apachectl start
cd /home/benet/public_html/
ls
vi index.php
[<?
 phpinfo();
?>]

你可能感兴趣的:(linux,网络,职场,休闲)