資源描述:
《centos中web服務(wù)器搭建》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫(kù)。
1、安裝mysql……………………………完成mysql的安裝。然后我們需要?jiǎng)?chuàng)建MySQL系統(tǒng)的啟動(dòng)鍵鏈接啟動(dòng)MySQL服務(wù)器,這樣以便于MySQL在系統(tǒng)啟動(dòng)時(shí)自動(dòng)啟動(dòng)?!?.為mysqlroot賬戶設(shè)置密碼:Mysql_secure_installation[root@localhostlx]#mysql_secure_installationNOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMySQLSERVERSINPRODUCTIONUSE!PLEASERE
2、ADEACHSTEPCAREFULLY!InordertologintoMySQLtosecureit,we'llneedthecurrentpasswordfortherootuser.Ifyou'vejustinstalledMySQL,andyouhaven'tsettherootpasswordyet,thepasswordwillbeblank,soyoushouldjustpressenterhere.Entercurrentpasswordforroot(enterfornone):OK,successfullyusedpassword,m
3、ovingon...SettingtherootpasswordensuresthatnobodycanlogintotheMySQLrootuserwithouttheproperauthorisation.Setrootpassword?[Y/n]yNewpassword:Re-enternewpassword:Passwordupdatedsuccessfully!Reloadingprivilegetables.....Success!Bydefault,aMySQLinstallationhasananonymoususer,allowinga
4、nyonetologintoMySQLwithouthavingtohaveauseraccountcreatedforthem.Thisisintendedonlyfortesting,andtomaketheinstallationgoabitsmoother.Youshouldremovethembeforemovingintoaproductionenvironment.Removeanonymoususers?[Y/n]...Success!Normally,rootshouldonlybeallowedtoconnectfrom'localh
5、ost'.Thisensuresthatsomeonecannotguessattherootpasswordfromthenetwork.Disallowrootloginremotely?[Y/n]...Success!Bydefault,MySQLcomeswithadatabasenamed'test'thatanyonecanaccess.Thisisalsointendedonlyfortesting,andshouldberemovedbeforemovingintoaproductionenvironment.Removetestdata
6、baseandaccesstoit?[Y/n]-Droppingtestdatabase......Success!-Removingprivilegesontestdatabase......Success!Reloadingtheprivilegetableswillensurethatallchangesmadesofarwilltakeeffectimmediately.Reloadprivilegetablesnow?[Y/n]...Success!Cleaningup...Alldone!Ifyou'vecompletedalloftheab
7、ovesteps,yourMySQLinstallationshouldnowbesecure.ThanksforusingMySQL!創(chuàng)建成功。2.安裝apacheApache2的是作為一個(gè)CentOS的軟件包,因此我們可以直接用下面命令安裝它:……………………安裝成功?,F(xiàn)在配置系統(tǒng)在引導(dǎo)時(shí)啟動(dòng)apache,第二步啟動(dòng)apache查看本地IP現(xiàn)在,在瀏覽器中輸入本地IP地址,可以看到apache2的測(cè)試頁(yè),如下圖:Apache的默認(rèn)文檔根目錄是在CentOS上的/var/www/html目錄,配置文件是/etc/httpd/conf/httpd.con
8、f。配置存儲(chǔ)在的/etc/httpd/conf.d/目錄。3、安裝php用下列命