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环境之后可以按照 ...
随机推荐
- CF1166E The LCMs Must be Large
CF1166E The LCMs Must be Large 构造趣题 正着推其实很不好推 不妨大力猜结论 如果两两集合都有交,那么一定可以 证明: 1.显然如果两个集合没有交,一定不可以 2.否则给 ...
- [转]vue - 前置工作 - 目录功能介绍
一个DEMOS的完整目录(由于GWF问题,我就不一一打开网站一个个去搜索并且解释了)可以去关注:https://www.cnblogs.com/ye-hcj build build.js(本文来自ht ...
- win10系统激活 快捷方式
系统不定期就会提示激活,每次激活都是找各种工具折腾,今天捣鼓简单的脚本直接激活~~ 首先查看自己系统的版本,后面才能找到合适的激活码 win+R 启动程序 输入 winver 即可查看系统版本 2.查 ...
- 机器学习——SVM
整理自: https://blog.csdn.net/woaidapaopao/article/details/77806273?locationnum=9&fps=1 带核的SVM为什么能分 ...
- ASP.NET MVC 实现页落网资源分享网站+充值管理+后台管理(7)之扩展基类和区域创建以及文本编辑配置
一.扩展基类和区域创建 (1)在应用之前,我们先在表现层创建一个公共的系统扩展文件来(SystemExtension)存放我们需要延伸和扩展的方法类. 在常规的项目系统操作中,我们都需要用到增删查改的 ...
- Linux 内核列举设备和驱动
如果你在编写总线级别的代码, 你可能不得不对所有已经注册到你的总线的设备或驱动进 行一些操作. 它可能会诱惑人直接进入 bus_type 结构中的各种结构, 但是最好使用已经 提供的帮助函数. 为操作 ...
- es6笔记 day4---模块化
模块化: 注意:需要放到服务器环境 1.如何定义模块? export 东西 export const a = 12; export { a as aaa, b as banana } 2 ...
- Trendalyzer is an information visualization software
Trendalyzer is an information visualization software for animation of statistics that was initially ...
- Stylized Image Caption论文笔记
Neural Storyteller (Krios et al. 2015) : NST breaks down the task into two steps, which first genera ...
- Python5_学习方法论
学习路线: 1.对基础知识的全面掌握,熟悉IDE和基本概念,注重知识体系构建: 2.开发实战.在该过程中掌握各类框架知识.熟悉模块的使用.并根据问题深入学习: ==================== ...