谁可相欹 发表于 2015-1-14 21:04:36

来谈谈:CentOS 6.4应用yum装置nginx + php + mysql

小知识:CentOS是企业Linux发行版领头羊RedHatEnterpriseLinux(以下称之为RHEL)的源代码再编译版本。
源码装置nginx能够会艰苦重重啊,所以推举个简略的yum装置方法
添加新源
#wgethttp://www.atomicorp.com/installers/atomic
#sh./atomic
AtomicArchiveinstaller,version2.0.9

BYINSTALLINGTHISSOFTWAREANDBYUSINGANYANDALLSOFTWARE
PROVIDEDBYATOMICORPLIMITEDYOUACKNOWLEDGEANDAGREE:

THISSOFTWAREANDALLSOFTWAREPROVIDEDINTHISREPOSITORYIS
PROVIDEDBYATOMICORPLIMITEDASIS,ISUNSUPPORTEDANDANY
EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THE
IMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULAR
PURPOSEAREDISCLAIMED.INNOEVENTSHALLATOMICORPLIMITED,THE
COPYRIGHTOWNERORANYCONTRIBUTORTOANYANDALLSOFTWAREPROVIDED
BYORPUBLISHEDINTHISREPOSITORYBELIABLEFORANYDIRECT,
INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES
(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODS
ORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,
STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)
ARISINGINANYWAYOUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISED
OFTHEPOSSIBILITYOFSUCHDAMAGE.

Doyouagreetotheseterms?(yes/no)yes
Configuringtheyumarchiveforthissystem

InstallingtheAtomicGPGkey:OK
Downloadingatomic-release-1.0-16.el6.art.noarch.rpm:OK



TheAtomicRocketTurtlearchivehasnowbeeninstalledandconfiguredforyoursystem
Thefollowingchannelsareavailable:
atomic--containsthestabletreeofARTpackages
atomic-testing--containsthetestingtreeofARTpackages
atomic-bleeding--containsthedevelopmenttreeofARTpackages


#yumcheck-update
#yum-yinstallnginxmysql-serverphp-fpmphp-cliphp-pdophp-mysqlphp-mcryptphp-mbstringphp-gdphp-tidyphp-xmlphp-xmlrpcphp-pearphp-pecl-memcachephp-eaccelerator

添加nginx默许主页index.php
#vim/etc/nginx/conf.d/default.conf

location/{
root/usr/share/nginx/html;
indexindex.htmlindex.htmindex.php;
}

设置装备摆设nginx支撑php
#vim/etc/nginx/conf.d/default.conf

#passthePHPscriptstoFastCGIserverlisteningon127.0.0.1:9000
#
location~.php${
root/usr/share/nginx/html;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/$document_root$fastcgi_script_name;
includefastcgi_params;
}
设置装备摆设php-fpm
#vim/etc/php-fpm.d/www.conf

;Unixuser/groupofprocesses
;Note:Theuserismandatory.Ifthegroupisnotset,thedefaultusersgroup
;willbeused.
;RPM:apacheChoosedtobeabletoaccesssomedirashttpd
user=nginx
;RPM:Keepagroupallowedtowriteinlogdir.
group=nginx

启动mysql
#servicemysqldstart
初始化MySQL数据库:InstallingMySQLsystemtables...
13032414:00:01libgovernor.sonotfound
OK
Fillinghelptables...
13032414:00:13libgovernor.sonotfound
OK

Tostartmysqldatboottimeyouhavetocopy
support-files/mysql.servertotherightplaceforyoursystem

PLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!
Todoso,starttheserver,thenissuethefollowingcommands:

/usr/bin/mysqladmin-urootpasswordnew-password
/usr/bin/mysqladmin-uroot-hlocalhost.localdomainpasswordnew-password

Alternativelyyoucanrun:
/usr/bin/mysql_secure_installation

whichwillalsogiveyoutheoptionofremovingthetest
databasesandanonymoususercreatedbydefault.Thisis
stronglyrecommendedforproductionservers.

Seethemanualformoreinstructions.

YoucanstarttheMySQLdaemonwith:
cd/usr;/usr/bin/mysqld_safe&

YoucantesttheMySQLdaemonwithmysql-test-run.pl
cd/usr/mysql-test;perlmysql-test-run.pl

Pleasereportanyproblemswiththe/usr/bin/mysqlbugscript!

[肯定]
正在启动mysqld:[肯定]
#servicenginxstart
正在启动nginx:[肯定]
#/etc/rc.d/init.d/php-fpmstart
正在启动php-fpm:[肯定]

在阅读器中输出http://ip/index.php
小知识:如果说Ubuntu是现今最受桌面用户欢迎的Linux操作系统,那么CentOS就是最受公司、企业、IDC喜爱的Linux发行版了。

精灵巫婆 发表于 2015-1-16 23:38:54

来谈谈:CentOS 6.4应用yum装置nginx + php + mysql

通过自学老师给的资料和向同学请教,掌握了一些基本的操作,比如挂载优盘,编译程序,在Linux环境下运行,转换目录等等。学了这些基础才能进行下面的模拟OS程序。?

柔情似水 发表于 2015-1-22 17:42:13

任何人都可以根据自己的喜好来定制适合自己的操作系统,Linux?是抢占式多任务多用户操作系统.

爱飞 发表于 2015-1-31 12:55:33

有疑问前,知识学习前,先用搜索。

小魔女 发表于 2015-2-6 19:55:57

即便是非英语国家的人发布技术文档,Linux也都首先翻译成英语在国际学术杂志和网络上发表。

不帅 发表于 2015-2-18 12:45:35

上课传授的不仅仅是知识,更重要的是一些道理,包括一些做人的道理,讲课时也抓住重点,循序渐进,让同学理解很快;更可贵的是不以你过去的成绩看问题.

乐观 发表于 2015-3-6 08:35:02

然我们对Linux的学习首先是通过对它的产生,发展,到今天仍然在不断完善开始的。

第二个灵魂 发表于 2015-3-13 00:07:16

有疑问前,知识学习前,先用搜索。

admin 发表于 2015-3-20 07:12:24

虽然大家都比较喜欢漂亮的mm,但是在学 linux 的过程中,还是要多和“男人”接触一下:P 遇到问题的时候,出来看说和上网查之外,就是要多用 linux 下的 man 命令找找帮助。
页: [1]
查看完整版本: 来谈谈:CentOS 6.4应用yum装置nginx + php + mysql