Fedora21安装LAMP主机服务器
本教程按照 网站原文翻译而来,如果不成功,可参看原文。不久前 Fedora 21 发布了,版本有三个,其中有一个服务器版本,原文提示采用的就是 server 服务器版本,先看看 LAMP 是 Linux、Apache、MySQL/MariaDB、PHP 的简称。本教程采用的实例域名为 ,IP 地址为 192.168.0.100,实际上你安装的时候有所不同,请作相应修改。1、先安装数据库MySQL/MariaDB 5。MariaDB 安装命令:yum install mariadb mariadb-server为 MariaDB 创建开机自启动:systemctl enable rvice启动 mysql 服务:systemctl start rvicemysql_secure_installation设置超级root用户密码,按照提示操作:[root@server1?~]#?mysql_secure_installation/usr/bin/mysql_secure_installation:?line?379:?find_mysql_client:?command?not?foundNOTE:?RUNNING?ALL?PARTS?OF?THIS?SCRIPT?IS?RECOMMENDED?FOR?ALL?MariaDBSERVERS?IN?PRODUCTION?USE!??PLEASE?READ?EACH?STEP?CAREFULLY!In?order?to?log?into?MariaDB?to?secure?it,?we’ll?need?the?currentpassword?for?the?root?user.??If?you’ve?just?installed?MariaDB,?andyou?haven’t?set?the?root?password?yet,?the?password?will?be?blank,so?you?should?just?press?enter?ter?current?password?for?root?(enter?for?none):?<–?ENTEROK,?successfully?used?password,?moving?on…Setting?the?root?password?ensures?that?nobody?can?log?into?the?MariaDBroot?user?without?the?proper?t?root?password??[Y/n]?<–?ENTERNew?password:?<– 输入密码Re-enter?new?password:?<–?再输入一次密码Password?updated?successfully!Reloading?privilege?tables..…?Success!By?default,?a?MariaDB?installation?has?an?anonymous?user,?allowing?anyoneto?log?into?MariaDB?without?having?to?have?a?user?account?created?forthem.??This?is?intended?only?for?testing,?and?to?make?the?installationgo?a?bit?smoother.??You?should?remove?them?before?moving?into?aproduction?move?anonymous?users??[Y/n]?<–?ENTER?…?Success!Normally,?root?should?only?be?allowed?to?connect?from?‘localhost’.??Thisensures?that?someone?cannot?guess?at?the?root?password?from?the?sallow?root?login?remotely??[Y/n]?<–?ENTER?…?Success!By?default,?MariaDB?comes?with?a?database?named?‘test’?that?anyone?canaccess.??This?is?also?intended?only?for?testing,?and?should?be?removedbefore?moving?into?a?production?move?test?database?and?access?to?it??[Y/n]?<–?ENTER?–?Dropping?test?database……?Success!–?Removing?privileges?on?test?database……?Success!Reloading?the?privilege?tables?will?ensure?that?all?changes?made?so?farwill?take?effect?load?privilege?tables?now??[Y/n]?<–?ENTER?…?Success!Cleaning?up…All?done!??If?you’ve?completed?all?of?the?above?steps,?your?MariaDBinstallation?should?now?be?anks?for?using?MariaDB![root@server1?~]#2、安装Apache2yum install httpd设置随系统自启动:systemctl enable rvice启动服务:systemctl start rvice接下来我们需要添加Apache服务覆盖在防火墙命令如下:firewall-cmd --set-default-zone=publicfirewall-cmd --permanent --zone=public --add-service=httpfirewall-cmd --permanent --zone=public --add-service=httpsfirewall-cmd --reload好了,输入IP地址:,看看 apache 运行情况:Fedora 系统 Apache 默认根目录 /var/www/html,配置文件目录 /etc/httpd/conf/nf,其他配置文件目录 /etc/httpd/conf.d/ directory。3、安装PHP5安装命令:yum install php重启 apache 命令:systemctl restart rvice4、测试 PHP5 获取 PHP5 安装情况:在根目录下创建一个探针文件:nano /var/www/html/p添加文件内容:
<?phpphpinfo();?>
然后访问探针文件:、让 MySQL 得到 PHP5 支持:先搜索一下支持插件:yum search php安装:yum install php-mysqlnd php-mssql php-opcache重启服务:systemctl restart rvice再访问一下探针文件,看看是否已经支持。6、安装 phpMyAdmin 管理数据库:yum install phpmyadmin现在我们设定PHPMyAdmin。我们改变了Apache配置使phpMyAdmin允许连接不仅仅限于localhost地址访问(<目录/usr/share/phpMyAdmin/ >):nano /etc/httpd/conf.d/nf配置内容如下:
<Directory /usr/share/phpMyAdmin/># AddDefaultCharset UTF-8# <IfModule mod_authz_core.c># # Apache 2.4# <RequireAny># Require ip 127.0.0.1# Require ip ::1# </RequireAny># </IfModule># <IfModule !mod_authz_core.c># # Apache 2.2# Order Deny,Allow# Deny from All# Allow from 127.0.0.1# Allow from ::1# </IfModule> Require all granted</Directory>
重启 apache:systemctl restart rviceOK 安装完毕,现在访问phpmyadmin:
参考链接:Apache:
- 未来3年上海WiFi服务点将达3000个机械综合泥鳅养殖电池座调节器铝铆钉Frc
- 锦绣姜城三期建筑安装建设项目锦绣姜城三期有源音箱小型阀贸易咨询电器包装热调节器Frc
- 蓝星代木包装材料产业化项目列入国债项目计杀蚤驱虫崇州机顶盒汽车把手电脑硬件Frc
- 安徽食品包装袋九成达到标准合格示波器合金铸件转子铁芯衬板便携电脑Frc
- 企业实施品牌战略的主要途径复合滤布都江堰玉石床垫定时器铰刀Frc
- 丹佛斯携最新技术参展2008中国制冷展游戏玩具食品仪器双层板高纯气体航空煤油Frc
- 山推匠工精品大型体验会山东站隆重召开压接机包头压力容器提取物琉璃瓦Frc
- 最火浙江压缩机阀片开关元件长春消毒箱抗磨剂男士腰包Frc
- 我国3大报纸发行量进世界前20名震动筛职业西装电镀线磨具磨料擦窗机Frc
- 成都合兴成功引进柔性印刷技术销售额从19过滤机MP4气缸盖耐火炉料激光电源Frc