ubuntu php mysql apache_Ubuntu+Apache+PHP+Mysql环境搭建(完整版)(转)
标签:
http://www.2cto.com/os/201505/401588.html
Ubuntu+Apache+PHP+Mysql环境搭建(完整版)
一、操作系统
Ubuntu 14.04 64位,阿里云服务器
二、Apache
1、安装Apache,安装命令:sudo apt-get install apache2
2、环境配置:
1)配置文件:路径为/etc/apache2,配置文件是apache2.conf,而没有http.conf。
2)默认网站根目录:/var/www/html,使用浏览器访问http://localhost 即可打开;
3)修改网站根目录:
A、“sudo vim /etc/apache2/apache2.conf"-->找到""的位置-->更改"/var/www/"为新的根目录“/home/www”即可
B、"sudo vi/etc/apache2/sites-available/000-default.conf"-->找到"DocumentRoot /var/www/html"的位置-->更改"/var/www/html"为新的根目录“/home/www”即可。
4)重启Apache服务器: sudo /etc/init.d/apache2 restart
三、PHP
1、更新源列表,否则安装php会失败:
命令行输入: vim /etc/apt/source.list
在最前面添加以下内容:
deb http://mirrors.aliyun.com/ubuntu/ precise main restricteduniverse multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-security mainrestricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-updates mainrestricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed mainrestricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ precise-backports mainrestricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise mainrestricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-securitymain restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updatesmain restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposedmain restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backportsmain restricted universe multiverse
apt-get update //更新一下列表
2、安装PHP,安装命令:sudoapt-get install php5
3、让Apache支持php,安装命令:sudo apt-get install libapache2-mod-php5
4、安装php5-gd模块,安装命令:sudoapt-get install php5-gd
5、让PHP支持curl
1)首先查看php5-curl是否已安装:dpkg -l | grep ‘php5-curl‘
2)如果没有安装,则:apt-get install php5-curl
3)确保 extension_dir存在,并且包含curl.so,
查找extension_dir:php -i | grep extension_dir
4)确保 /etc/php5/mods-available/curl.ini存在,文件内容如下:
; configuration for php CURL module
; priority=20
extension=curl.so
5)如果以上步骤均确定,重启服务器。
四、Mysql
1、安装Mysql,安装命令:sudoapt-get install mysql-server,安装过程中设置密码
2、允许root远程登录:
1)从所有主机:grant all privileges on *.* toroot@"%" identified by "passw0rd" with grant option;
2)can‘t connect to mysql server解决方法:修改配置文件,路径为/etc/mysql/my.cnf,注释掉bind-address = 127.0.0.0
即:#bind-address = 127.0.0.1
五、FTP
1、安装FTP,安装命令:sudoapt-get install vsftpd
2、查看是否安装成功:输入"sudo service vsftpdrestart"重启vsftpd服务
3、建立FTP目录: sudo mkdir/home/ftpfile/ftpfile
4、新建ftp用户: sudouseradd –d /home/ftpfile –s /bin/bash myftp
5、设置myftp用户密码: sudopasswd myftp ,输入两次密码
6、修改ftp配置文件,路径为/etc/vsftpd.conf,
1)配置修改如下:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
2)在/etc/目录中新建vsftpd.chroot_list文件,添加ftp用户名:myftp。或直接:
echo “myftp” >> /etc/vsftpd.chroot_list 即可。
六、SVN
1、安装SVN,安装命令:sudo apt-getinstall subversion
2、创建SVN工程:sudosvnadmin create /home/svn/kyssp
3、修改svn配置: vim /home/svn/kyssp_pub/conf/svnserve.conf
anon-access = read
auth-access = write
password-db = passwd
4、设置访问用户以及密码: 编辑文件vim /home/svn/kyssp_pub/conf/passwd
在最后一行添加:用户名 = 密码
5、启动svn:svnserve -d-r /home/svn/
6、使用SVN的post-commithooks 同步推送代码到生产环境
1)进入/home/svn/kyssp/hooks目录,cp post-commit.tmpl post-commit
2)在最后,添加如下:
REPOS="$1"
REV="$2"
#TXN_NAME="$3"
WEB_PATH="/home/www/kyssp"
#"$REPOS"/hooks/mailer.py commit "$REPOS"$REV "$REPOS"/mailer.conf
#export LANG=zh_CN.UTF-8
export LANG=en_US.UTF-8
#
#svn co --username zrs --password zrs@tzuo.cnsvn://112.74.**.**/kyssp_pub /home/www/kyssp
svn update --username zrs --password zrs@tzuo.cn /home/www/kyssp
其中:
svn co --username zrs --password zrs@tzuo.cnsvn://112.74.**.**/kyssp /home/software/www/kyssp 下载工程代码
svn update --username z** --password z*** /home/software/www/kyssp 更新工程代码
标签:
ubuntu php mysql apache_Ubuntu+Apache+PHP+Mysql环境搭建(完整版)(转)相关推荐
- Hadoop基础环境搭建完整版
Hadoop基础环境搭建(转载尚硅谷) 说明 个人学习记录 基于虚拟机搭建,需要提前准备虚拟机环境 搭建版本:hadoop-3.1.3 搭建HDFS和yarn 提前准备Hadoop安装包:hadoop ...
- 【重磅推荐】Win7+Appium+ Android-SDK+逍遥模拟器【兼容其他模拟器】环境搭建完整版
完整环境搭建视频课程[腾讯课堂]:https://ke.qq.com/course/3418559?taid=10984662330780095 Android SDK的安装与环境变量配置:https ...
- Hive环境搭建(完整版)-配置
Hive部署: 前提: 在安装Hive之前,要求先预装: - 安装JDK 8 - 安装Hadoop-2.7.7 - 安装MySQL 5.6.x !!!我这里主节点叫chun1,根据自己的进行修改 一. ...
- win10 64bit 深度学习环境搭建完整版
前言 文件准备 开始安装 1.安装 Visual Studio 2013 Community 2.安装 DXSDK_Jun10 3.安装 CUDA 8.0 3.安装 cuDNN v6.0 4.安装 A ...
- SharePoint2013开发环境搭建(完整版:图文并茂)
windows 8 系统下安装SharePoint 2013 开发环境 配置windows8 系统 12G内存包含虚拟机(windows server2012 系统 1.5G AD服务器),(wind ...
- Appium环境搭建-完整版
环境依赖 Node.js Appium Appium-desktop Appium-doctor Appium-Python-Client Python JDK Andriod SDK 以上所需的软件 ...
- flutter环境搭建-完整版
1.下载 flutter 安装包 https://storage.flutter-io.cn/flutter_infra/releases/stable/macos/flutter_macos_2.2 ...
- apache支持mysql ubuntu_Ubuntu+Apache+PHP+Mysql环境搭建(完整版)
Ubuntu+Apache+PHP+Mysql环境搭建(完整版) 一.操作系统 Ubuntu 14.04 64位,阿里云服务器 二.Apache 1.安装Apache,安装命令:sudo apt-ge ...
- Spring Boot + JPA +MySQL 数据操作及示例环境搭建(自动建表)
JPA 是Java官方提供的数据持久的统一API , 是一个接口标准,并没有具体实现. JPA的实现常见的有: Hibernate TopLink (Eclipse Link) Spring Boot ...
最新文章
- 查询手机号段对应地区编码_2020陕西专升本考试今日起查询成绩啦
- magento 获取类别和子类别 Display Categories and SubCategories in Magento
- 错误:Type javax.xml.bind.JAXBContext not present
- openssh-server (= 1:6.6p1-2ubuntu1) but it is not going to be installed
- 测视力距离5米还是3米_装B冷知识 | 小孔镜为什么可以提高视力?
- 第一行代码--笔记(3)
- 获取地理位置 百度地图
- PGIS平台部署中的问题及解决方案
- idea 格式化vue代码,检查语法
- Inpaint 5.6 图片去水印工具 限时免费
- 【iOS越狱开发】iOS越狱步骤1之环境搭建
- CSS中的四种定位以及top和margin-top的区别
- MONKOVEL-安卓端免费的小说阅读器 源码分享
- 【js语法】获取星期 new Date().getDay()
- 3d建模师就业前景?
- app爬虫抓包不能抓到对应的http网络请求解决办法,以某团app为例
- cs61a笔记-2020fall
- 构建之法前三章读后感—软件工程
- 睿频开启及睿频与超频的区别
- 【NOIP2002】银河英雄传说
热门文章
- html文件转换成dwt文件,如何把dwt页面转换成html页面
- 获取date等于某一天的第一个id sql_leetcode(sql)之经典困难题合集
- SpringMVC中注解@RequestBody和@ResponseBody的使用区别
- Java的equals()和==的区别
- 大数据 -- 安装Hadoop-单机模式(1)
- 各個瀏覽器CSS樣式控制
- 第一次HACK别人的DLL
- \r:command not found
- Leetcode——连续子数组的最大和(剑指offer 42)
- 过山车99java游戏_过山车乐园游戏下载