CentOS6.8 LAMP
第一次配置LAMP运行环境,上网查询了很多资料,一边试命令一边学习。服务器重置了很多次。
虽然有OneinStack这个方便的网站一键命令部署,但知道这个网站却是我自己踩坑之后的事情了,故此记录。
1 安装Apache
yum -y install httpd
# 设置开机启动chkconfig --list httpd查看
chkconfig httpd on
# 进入配置文件进行如下修改
vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
DirectoryIndexindex.html index.php index.htm
service httpd restart
2 安装MySQL
wget https://repo.mysql.com//mysql57-community-release-el6-9.noarch.rpm
rpm mysql57-community-release-el6-9.noarch.rpm
yum install mysql-community-server
service mysqld start
# mysql临时密码保存位置:/var/log/mysqld.log
chkconfig mysqld on
mysql -uroot -p
set password for 用户名@localhost = password('新密码');
3 安装PHP
# 安装依赖包
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# 安装PHP及相关软件
yum install php70w.x86_64 php70w-opcache.x86_64 php70w-pdo.x86_64 php70w-fpm.x86_64 php70w-mysql.x86_64
yum install php70w-gd.x86_64 libjpeg* php70w-ldap.x86_64 php70w-odbc.x86_64 php70w-pear.noarch php70w-xml.x86_64
yum install php70w-xmlrpc.x86_64 php70w-mbstring.x86_64 php70w-bcmath.x86_64 php-mhash php70w-pecl-redis.x86_64
# 查看php-fpm
whereis php-fpm
# 启动php-fpm
service php-fpm start
# 查看php版本
php -v
4 配置SSH
# 配置系统自带的SSH,修改Port 22端口号
/etc/ssh/sshd_config
# 重启SSH服务
service sshd restart
5 安装phpMyAdmin
# 跳转到站点根目录
cd /var/www/html
# 下载压缩包
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.0/phpMyAdmin-4.6.0-all-languages.tar.gz
# 解压
tar zxvf phpMyAdmin-4.6.0-all-languages.tar.gz
# 重命名
mv phpMyAdmin-4.6.0-all-languages.tar.gz newName
service mysqld restart
# 若提示丢失mysqli文件
vi /etc/php.d/mysqli.ini
# 取消掉“;Enable mysqli extension module”前的分号
# 查看已安装软件,如
rpm -qa | grep mysql*
6 Apache配置301重定向
# 打开Apache配置文件
vi /etc/httpd/conf/httpd.conf
# 去掉“#LoadModule rewrite_module modules/mod_rewrite.so”前面的“#”
# 在httpd.conf文件最后加上
#Open 301Rewrite
RewriteEngine on
#Log level
RewriteLogLevel 0
#Log address
RewriteLog logs/rewrite.log
#main code
rewritecond %{HTTP_HOST} ^straystarry.com$
rewriterule ^(.+) %{HTTP_HOST}$1 [C]
rewriterule ^straystarry.com(.*) https://www.straystarry.com$1
CentOS6.8 LAMP的更多相关文章
- CentOS6编译LAMP基于FPM模式的应用wordpress
CentOS6编译LAMP基于FPM模式的应用wordpress 引言:其实我们可以直接使用yum安装LAMP(Linux+Apache[httpd]+Mysql+PHP),比手动编译安装LAMP要简 ...
- centos6.5 lamp 环境 使用yum安装方法
从网上找了一些 最后整理了下 1.安装Apache yum -y install httpd # 开机自启动 chkconfig httpd on # 启动httpd 服务 service httpd ...
- centos6 安装 lamp
首先更新一下yum -y update 安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start 启动apache 设 ...
- CentOS6.4 LAMP环境搭建
网上的教程,不能按着抄打进去,这样会打乱你环境放置位置, 会导致配置路径会出问题. 要有一个环境目录优化, 把环境文件都装在/usr/local里面 首先,把安装文件rar都放置在/usr/local ...
- centos6安装lamp
1.安装Apache [root@localhost ~]# yum -y install httpd 设置开启自启动 [root@localhost ~]# chkconfig httpd on 启 ...
- CentOS6 安装Sendmail + Dovecot + Roundcubemail
前言 本文是继CentOS6 安装Sendmail + Dovecot + Squirrelmail 关于邮箱服务器配置的第二篇文章,因为关于使用Sendmail进行相关配置的文章.资料等太老,而且资 ...
- Ubuntu --- 【转】安装lamp(php7.0)
本篇转自:http://www.laozuo.org/8303.html.以防丢失,再次记录 PHP7已经出来有一段时间,根据网友的实践测试比之前的版本效率会高不少,而且应用到网站中打开速度会有明显的 ...
- centos lamp笔记
cron and crontab are missing in docker image of ubuntu 16.04 在鏡像中沒有 cron 命令 How to install php-redis ...
- 搭建hustoj
环境:centos6.5 + LAMP环境 LAMP环境的搭建可以参考下面这篇文章 http://www.cnblogs.com/yoke/p/7257184.html 搭建完LAMP环境之后可以按照 ...
随机推荐
- C# 判断两条直线距离
本文告诉大家获得两条一般式直线距离 一般式的意思就是 Ax+By+C=0" role="presentation">Ax+By+C=0Ax+By+C=0 如果有两个 ...
- UVA 11212 Editing a Book [迭代加深搜索IDA*]
11212 Editing a Book You have n equal-length paragraphs numbered 1 to n. Now you want to arrange the ...
- 性能测试基础-HTTP用例设计
JSON格式请求: web_custom_request("https://xx.xx.xx.xx:xx/pvcpappinf//msgcustomization/xinPowGenDay, ...
- Spring Security学习笔记-自定义Spring Security过滤链
Spring Security使用一系列过滤器处理用户请求,下面是spring-security.xml配置文件. <?xml version="1.0" encoding= ...
- 【37.48%】【hdu 2587】How far away ?(3篇文章,3种做法,LCA之Tarjan算法)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s) ...
- 游戏《Minecraft》或其他应用程序 实现 自动更新 客户端版本
本渣又来写(水)博客了. 先说一下,我这个解决方案的安全性并不是企业级的,咱们就是一群穷开服的Minecraft玩家. 如果你要投入到企业级应用(容易被黑客攻击的场景),请自己写,思路凑合看看.不然安 ...
- apache WEB服务器安装(包括虚拟主机)
一.apache下载编译安装 yum install apr apr-devel apr-util apr-util-devel gcc-c++ wget tar -y cd /usr/src wge ...
- Linux基础:认识Linux
1.Linux操作系统的特点 优点 (1)可靠性高:linux是基于Unix的概念开发出来的系统,拥有Unix的稳定且效率的特点.运行一年以上而不曾宕机.不必关机是很平常的事情 : (2)彻底 ...
- Spring||Interview
1.依赖注入(DI)(IOC) 对象本身不负责对象的创建和维护,将控制权转交给外部的容器实现,降低程序的耦合度,只提供java方法让容器决定依赖关系,依赖关系的对象通过JavaBean属性或者构造函数 ...
- The second day of Crawler learning
用BeatuifulSoup和Requests爬取猫途鹰网 服务器与本地的交换机制 我们每次浏览网页都是再向网页所在的服务器发送一个Request,然后服务器接受到Request后返回Response ...