第一次配置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的更多相关文章

  1. CentOS6编译LAMP基于FPM模式的应用wordpress

    CentOS6编译LAMP基于FPM模式的应用wordpress 引言:其实我们可以直接使用yum安装LAMP(Linux+Apache[httpd]+Mysql+PHP),比手动编译安装LAMP要简 ...

  2. centos6.5 lamp 环境 使用yum安装方法

    从网上找了一些 最后整理了下 1.安装Apache yum -y install httpd # 开机自启动 chkconfig httpd on # 启动httpd 服务 service httpd ...

  3. centos6 安装 lamp

    首先更新一下yum -y update 安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start 启动apache 设 ...

  4. CentOS6.4 LAMP环境搭建

    网上的教程,不能按着抄打进去,这样会打乱你环境放置位置, 会导致配置路径会出问题. 要有一个环境目录优化, 把环境文件都装在/usr/local里面 首先,把安装文件rar都放置在/usr/local ...

  5. centos6安装lamp

    1.安装Apache [root@localhost ~]# yum -y install httpd 设置开启自启动 [root@localhost ~]# chkconfig httpd on 启 ...

  6. CentOS6 安装Sendmail + Dovecot + Roundcubemail

    前言 本文是继CentOS6 安装Sendmail + Dovecot + Squirrelmail 关于邮箱服务器配置的第二篇文章,因为关于使用Sendmail进行相关配置的文章.资料等太老,而且资 ...

  7. Ubuntu --- 【转】安装lamp(php7.0)

    本篇转自:http://www.laozuo.org/8303.html.以防丢失,再次记录 PHP7已经出来有一段时间,根据网友的实践测试比之前的版本效率会高不少,而且应用到网站中打开速度会有明显的 ...

  8. centos lamp笔记

    cron and crontab are missing in docker image of ubuntu 16.04 在鏡像中沒有 cron 命令 How to install php-redis ...

  9. 搭建hustoj

    环境:centos6.5 + LAMP环境 LAMP环境的搭建可以参考下面这篇文章 http://www.cnblogs.com/yoke/p/7257184.html 搭建完LAMP环境之后可以按照 ...

随机推荐

  1. js将单个反斜杠转化为斜杠的问题

    var two="https://192.255.255.255:3215/2019/2/26/16/13/b2e8929483c66cefddbe1e49a007e3f8-47358FC3 ...

  2. Python--day41--线程池--python标准模块concurrent.futures

    1,线程池代码示例:(注:进程池的话只要将以下代码中的ThreadPoolExecutor替换成ProcessPoolExecutor即可,这里不演示) import time from concur ...

  3. C# const 和 readonly 有什么区别

    在写常量的时候,是选择使用 const 还是 static readonly 是一个让人难以决定的问题,本文告诉大家这两个方法的区别 如果一个类有静态字段,会如何初始化 可以使用的方法有两个,第一个方 ...

  4. Ubuntu Kylin 14.04安装

    早听说Ubuntu Kylin对中国本地做了很多定制的工作,想搜狗输入法.WPS,还有中国日历等.昨天没事就下载了一个Kylin试用了下,使用的方法还是使用EasyBCD软件做了个硬盘安装启动,关于E ...

  5. P1079 好朋友

    题目描述 小可可和所有其他同学的手腕上都戴有一个射频识别序列号码牌,这样老师就可以方便的计算出他们的人数.很多同学都有一个"好朋友" .如果 A 的序列号的约数之和恰好等于B 的序 ...

  6. jquery自己写的幻灯片插件,好用不解释

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. java打包上传服务器的一些命令

    Maven下package打包成jar包和war包,都在target目录下 其中War包扔在tomcat的webapps目录下.随tomcat启动自行启动 运行jar包命令. nohup java - ...

  8. 【50.54%】【BZOJ 1879】[Sdoi2009]Bill的挑战

    Time Limit: 4 Sec  Memory Limit: 64 MB Submit: 649  Solved: 328 [Submit][Status][Discuss] Descriptio ...

  9. HDU - 4587 TWO NODES (图的割点)

    Suppose that G is an undirected graph, and the value of stab is defined as follows: Among the expres ...

  10. 【Linux】grep笔记

    Linux grep命令用于查找文件里符合条件的字符串. 参数: -a 或 --text : 不要忽略二进制的数据. -A<显示行数> 或 --after-context=<显示行数 ...