|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
小知识:Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。
CentOS源利用的局限很普遍。此次我们要来说一下怎样用CentOS源安装LAMP。为了便利人人的了解,我们利用了很复杂的安装***。但愿人人能够很好的了解。今天又换了VPS,来自DiaHosting。此次最次要的目标是用作Web办事器。为了习气,仍是决意先用Apache。
起首做一些筹办事情,筹办好CentOS源安装包:
cd/usr/local/src
wgethttp://mysql.easynet.be/Downloads/MySQL-5.1/mysql-5.1.44.tar.gz
wgethttp://apache.etoak.com/httpd/httpd-2.2.13.tar.gz
wgethttp://cn.php.net/distributions/php-5.2.13.tar.gz
wgethttp://ncu.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.2.5/phpMyAdmin-3.2.5-all-languages.tar.gz
接着CentOS源安装编译器,运转库等必要的器材:
yuminstallmake
yuminstallgccgcc-c++
yuminstalllibxml2libxml2-devel
yuminstalllibmcryptlibmcrypt-devel
yuminstalllibtool-ltdl
yuminstallaprapr-*
yuminstallncursesncurses-*
CentOS源安装sendmail:
yuminstallsendmailsendmail-*
servicesendmailstart
接上去入手下手CentOS源安拆卸置MySQL:
cd/usr/local/src
tarzxvfmysql-5.1.44.tar.gz
cdmysql-5.1.44
./configure--prefix=/usr/local/mysql
make
makeinstall
cpsupport-files/my-medium.cnf/etc/my.cnf
cd/usr/local/mysql
groupaddmysql
useradd-gmysql-d/usr/local/mysql/varmysql
chown-Rmysql.
chgrp-Rmysql.
bin/mysql_install_db--user=mysql
chown-Rmysqlvar
将MySQL注册为办事,开机自启动:
cp/usr/local/src/mysql-5.1.44/support-files/mysql.server
/etc/rc.d/init.d/mysql
chmod+x/etc/rc.d/init.d/mysql
chkconfig--addmysql
servicemysqlstart
MySQL启动以后,设置root暗码:
/usr/local/mysql/bin/mysqladmin-uroot
-ppasswordnewpassword
下一步安装Apache:
cd/usr/local/src
tarzxvfhttpd-2.2.13.tar.gz
cdhttpd-2.2.13
./configure--prefix=/usr/local/apache
--with-mysql=/usr/local/mysql
--enable-rewrite=shared
--enable-module=so
--enable-shared=max
make
makeinstall
最初CentOS源安装PHP:
cd/usr/local/src
tarzxvfphp-5.2.13.tar.gz
cdphp-5.2.13
./configure--prefix=/usr/local/php
--with-mysql=/usr/local/mysql
--with-apxs2=/usr/local/apache/bin/apxs
--with-mcrypt
--enable-mbstring
make
makeinstall
cpphp.ini-dist/usr/local/php/lib/php.ini
设置httpd.conf:
vi/usr/local/apache/conf/httpd.conf
找到“AddTypeapplication/x-gzip.tgz”这一行,鄙人面增加:
AddTypeapplication/x-httpd-php.php
AddTypeapplication/x-httpd-php-source.phps
找到“DirectoryIndexindex.html”,改成:
DirectoryIndexindex.phpindex.html
找到“#ServerName”,往失落正文的#号。
将一切“AllowOverrideNone”,改成:
AllowOverrideAll
注册办事,并启动Apache:
cp/usr/local/apache/bin/apachectl
/etc/rc.d/init.d/httpd
vi/etc/rc.d/init.d/httpd
找到“#!/bin/sh”,另起一行,增添:
#chkconfig:357030
#description:Apache
持续:
chkconfig--addhttpd
servicehttpdstart
LAMP安装完成,新建一个测试页面:
vi/usr/local/apache/htdocs/index.php
写进:
翻开扫瞄器,http://localhost/index.php。
上面依据必要,CentOS源安装phpMyAdmin:
cd/usr/local/src
tarzxvfphpMyAdmin-3.2.5-all-languages.tar.gz
mvphpMyAdmin-3.2.5-all-languages/usr/local/apache/htdocs/phpmyadmin
设置phpMyAdmin:
cd/usr/local/apache/htdocs/phpmyadmin
cpconfig.sample.inc.phpconfig.inc.php
viconfig.inc.php
找到“blowfish_secret”,在前面的单引号之间增加恣意字符串。
会见http://localhosst/phpmyadmin,以MySQL用户上岸,CentOS源安装LAMP乐成。
小知识:CentOS并不是第一个提供商业支持的RHEL克隆版,其他企业例如Oracle也提供了基于RedHat的自己的企业Linux发布版。 |
|