介绍Linux的配置和安装
1.命令行配置:
ifconfig eth0:0 10.19.78.5 netmask 255.255.255.248 #设本机的外网IP和掩码
route del -net 0.0.0.0 #删除原来网关
route add -net 0.0.0.0 gw 10.19.78.1 eth0 #添加新网关
ipchains -A forward -s 192.168.2.0/24 -j MASQ #设置内网可访问的网段
计算机重起后失效
改网络配置文件
1.修改 /etc/sysconfig/network
NETWORKING=yes
FORWARD_IPV4=yes
HOSTNAME=wangyu
GATEWAY=192.168.1.1
GATEWAYDEV=eth0
2.在/etc/sysconfig/network-scripts目录下创建文件ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
NETMASK=255.255.255.0
IPADDR=192.168.1.111
GATEWAY=192.168.1.1
3.用/ect/rc.d/init.d/network restart 使配置生效
VM虚拟机软件选择0号设备网桥链接
Apache安装
tar zxvf apache_1.3.28.tar.gz;
cd apache_1.3.28 ;
./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max
make;
make install&
mysql安装
#!/bin/sh
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql
make
sleep 1
make install
sleep 1
scripts/mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/safe_mysqld --user=mysql &
sleep 5
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
/usr/local/mysql/bin/mysqladmin -u root password uarefool
sleep 1
echo "/usr/local/mysql/bin/safe_mysqld& --user=mysql" >> /etc/rc.d/rc.local
php安装
# tar -zxvf php-4.3.4.tar.gz
# cd php-4.3.4
# ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
# vi /usr/local/lib/php.ini register_globals =off 更改为:register_globals =on (为了兼容老版本,但会产生安全问题)
phpMyAdmin安装
$cfg['PmaAbsoluteUri'] = ''; ,将该行内容更改为$cfg['PmaAbsoluteUri'] = 'http://192.168.1.244/phpMyAdmin/'
查找password
修改数据库密码
修改数据库用户名