美国vps服务器的CentOS是Community Enterprise Operating System的缩写,也叫做社区企业操作系统。是企业Linux发行版领头羊Red Hat Enterprise Linux(以下称之为RHEL)的再编译版本(是一个再发行版本),而且在RHEL的基础上修正了不少已知的 Bug ,相对于其他 Linux 发行版,其稳定性值得信赖。CentOS是免费的,你可以使用它像使用RHEL一样去构筑企业级的Linux系统环境,但不需要向RedHat付任何的费用。
1.CentOS下载
CentOS是免费版,推荐在官网上直接下载,
网址:https://www.centos.org/download/
DVD ISO:普通光盘完整安装版镜像,可离线安装到计算机硬盘上,包含大量的常用软件,一般选择这种镜像类型即可。
Everything ISO:包含了完整安装版的内容,并对其进行补充,集成了所 有软件。
Minimal ISO:这个版本为精简版的镜像,可以安装一个基本的CentOS系 统,包含了可启动系统基本所需的最小安装包。
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0D:61:B2:52:C2
ONBOOT=yes
TYPE=Ethernet
DHCP_HOSTNAME=mfisp.theplanet.host
IPADDR_START=69.93.239.243
IPADDR_END=69.93.239.254
CLONENUM_START=0
GATEWAY=69.93.239.241
NETMASK=255.255.255.240
NO_ALIASROUTING=yes
安装配置LINUX步骤
—为DZ,PW环境而搭建,实例教程
–Jason Fan 2006/8/10 16:00
1、SSH进入服务器
2、下载软件,后台让系统下载,我们做别的事情。
cd /opt/
wget -c http://svr41.onlinecq.com/apf-current.tar.gz http://svr41.onlinecq.com/eaccelerator-0.9.4.zip http://svr41.onlinecq.com/httpd-2.0.55.tar.gz http://svr41.onlinecq.com/MySQL-client-4.0.26-0.i386.rpm http://svr41.onlinecq.com/MySQL-devel-4.0.26-0.i386.rpm http://svr41.onlinecq.com/MySQL-server-4.0.26-0.i386.rpm http://svr41.onlinecq.com/MySQL-shared-4.0.26-0.i386.rpm http://svr41.onlinecq.com/php-5.1.2.tar.gz http://svr41.onlinecq.com/phpMyAdmin-2.7.0-pl2.zip http://svr41.onlinecq.com/ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz
3、配置时区,服务
setup
时区
Timezone configuration / Asia/Chongqing
System services / isdn 空格取消
System services / pcmcia 空格取消
System services / vsftpd 空格添加
*表示选中
4、配置IP
ifconfig 查看主IP
vi /etc/rc.local
ifconfig eth0:12 69.93.180.208 netmask 255.255.255.0 up
ifconfig eth0:13 69.93.180.209 netmask 255.255.255.0 up
ifconfig eth0:14 69.93.180.210 netmask 255.255.255.0 up
ifconfig eth0:15 69.93.180.211 netmask 255.255.255.0 up
ifconfig eth0:16 69.93.180.212 netmask 255.255.255.0 up
ifconfig eth0:17 69.93.180.213 netmask 255.255.255.0 up
ifconfig eth0:18 69.93.180.214 netmask 255.255.255.0 up
ifconfig eth0:19 69.93.180.215 netmask 255.255.255.0 up
UNIX注意大小写
G 移到文件末尾
o 新起一行并且设置为添加状态 / i 当前位置添加状态
鼠标右键将剪贴板内容粘贴到ssh里面
按两次键盘右上角ESC键
:wq 保存退出
5、删除原系统中不需要之rpm包,主要是httpd,php,mysql等用不到的。
1)通过rpm -qa | grep httpd查询apache包
删除掉查出来的rpm
rpm -e httpd-suexec-2.0.53-3.3 system-config-httpd-1.3.1-1 httpd-2.0.53-3.3
2)通过rpm -qa | grep mysql查询mysql包
删除掉查出来的rpm
rpm -e mysql-devel-3.23.58-16.FC3.1 mysql-3.23.58-16.FC3.1 libdbi-dbd-mysql-0.6.5-9 perl-DBD-MySQL-2.9003-5.i386 dovecot-0.99.13-3.FC3.i386 MyODBC-2.50.39-25.FC3.1.i386 MySQL-python-0.9.2-4.i386
3)通过rpm -qa | grep php查询php包
6、配置FTP,使用vsftpd服务器
vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO #YES=>NO
xferlog_file=/var/log/vsftpd.log
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to FTP service.
chroot_local_user=YES #添加此句
保存退出
service vsftpd start
Starting vsftpd for vsftpd: [ OK ]
7、安装mysql 4.0.26
cd /opt/
rpm -ivh MySQL-client-4.0.26-0.i386.rpm MySQL-devel-4.0.26-0.i386.rpm MySQL-server-4.0.26-0.i386.rpm MySQL-shared-4.0.26-0.i386.rpm
配置my.cnf
cp /usr/share/mysql/my-large.cnf /etc/my.cnf
vi /etc/my.cnf
skip-bdb
skip-innodb
skip-locking
skip-networking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
back_log=200
interactive_timeout=10
wait_timeout=2
connect_timeout=3
max_connections=300
max_connect_errors=1000
long_query_time=5
并且将#log-bin 前面加#注释掉
保存退出
8、安装apache2 2.0.55
cd /opt/
解压 tar zxvf httpd-2.0.55.tar.gz
cd httpd-2.0.55
./configure –prefix=/usr/local/apache2 –enable-file-cache –enable-cache –enable-disk-cache –enable-mem-cache –enable-expires –enable-cgi –enable-cgid –enable-rewrite=shared –enable-so –with-mpm=prefork
make
make install
配置httpd.conf
vi /usr/local/apache2/conf/httpd.conf
Timeout 30 #此行修改
<IfModule prefork.c>
ServerLimit 500 #此行添加
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
User nobody
Group nobody #此行修改
ServerName www.mfisp.com:80
DirectoryIndex index.html index.htm index.php index.html.var
#ErrorLog logs/error_log
ErrorLog /dev/null
# CustomLog logs/access_log common
AddType application/x-httpd-php .php .php3 .php4 .phtml
AddType application/x-httpd-php-source .phps
AddHandler cgi-script .cgi .pl
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /home/admin/www/html
ServerName 67.18.208.232
</VirtualHost>
再配置虚拟主机后,保存退出
ln -s /usr/local/apache2/bin/apachectl /usr/local/bin/apachectl
mkdir -p /home/admin/www/html
apachectl start
vi /etc/rc.local
/usr/local/apache2/bin/apachectl start
保存退出
9、配置php 5.1.2
cd /opt/
tar zxvf php-5.1.2.tar.gz
cd php-5.1.2
./configure –with-apxs2=/usr/local/apache2/bin/apxs –with-config-file-path=/usr/local/etc –enable-force-cgi-redirect –enable-discard-path –enable-fastcgi –disable-rpath –with-zlib –with-curl –enable-exif –enable-ftp –with-gd –with-jpeg-dir –with-png-dir –with-zlib-dir –with-ttf –enable-gd-native-ttf –enable-gd-jis-conv –with-gettext –without-iconv –enable-mbstring –with-mysql=/usr –enable-sockets –enable-maintainer-zts
出错:
configure: error: libjpeg.(a|so) not found.
需要安装libjpeg-devel-6b-33.i386.rpm
wget -c http://mirrors.kernel.org/fedora/core/3/i386/os/Fedora/RPMS/libjpeg-devel-6b-33.i386.rpm
rpm -ivh libjpeg-devel-6b-33.i386.rpm
wget -c http://mirrors.kernel.org/fedora/core/updates/3/i386/libpng-devel-1.2.8-1.fc3.i386.rpm
rpm -ivh libpng-devel-1.2.8-1.fc3.i386.rpm
安装完系统缺少的rpm包后,继续安装
make
make install
配置php.ini
cp php.ini-dist /usr/local/etc/php.ini
vi /usr/local/etc/php.ini
register_globals = On
upload_max_filesize = 8M
memory_limit = 64M
保存退出
10、安装zend 3
cd ..
tar zxvf ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz
cd ZendOptimizer-3.0.0-linux-glibc21-i386
sh install
一路回车到底
11、配置phpmyadmin
cd /opt/
unzip phpMyAdmin-2.7.0-pl2.zip
cd phpMyAdmin-2.7.0-pl2
mkdir -p /home/admin/www/html/phpmyadmin
cp -R * /home/admin/www/html/phpmyadmin
cd /home/admin/www/html/phpmyadmin
vi config.default.php
$cfg[‘blowfish_secret’] = ‘osh4n5l3s4’;
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
保存退出