cenos安装配置owncloud过程_owncloud only sqlite is available.install and acti-程序员宅基地

技术标签: 项目配置  

1、安装LAMP

1.1 安装apache

yum install httpd

1.2 安装mysql

yum install mysql mysql-server

1.3 安装php

yum install php

yum install php-mysql php-gd 

yum install libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc 

yum install php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt

2、配置

2.1、apache配置(可选)

vi /etc/httpd/conf/httpd.conf #编辑文件
ServerTokens OS  在44行 修改为:ServerTokens Prod (在出现错误页的时候不显示服务器操作系统的名称)
ServerSignature On  在536行 修改为:ServerSignature Off (在错误页中不显示Apache的版本)
Options Indexes FollowSymLinks  在331行 修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)
#AddHandler cgi-script .cgi 在796行 修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)
AllowOverride None  在338行 修改为:AllowOverride All (允许.htaccess)
AddDefaultCharset UTF-8 在759行 修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)
Options Indexes MultiViews FollowSymLinks 在554行 修改为 Options MultiViews FollowSymLinks(不在浏览器上显示树状目录结构)
DirectoryIndex index.html index.html.var 在402行 修改为:DirectoryIndex index.html index.htm Default.html Default.htm

index.php Default.php index.html.var (设置默认首页文件,增加index.php)

KeepAlive Off 在76行 修改为:KeepAlive On (允许程序性联机)

MaxKeepAliveRequests 100 在83行 修改为:MaxKeepAliveRequests 1000 (增加同时连接数) 

/etc/init.d/httpd restart #重启
rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #删除默认测试页

2.2、php配置(可选)
vi /etc/php.ini #编辑
date.timezone = PRC #在946行 把前面的分号去掉,改为date.timezone = PRC
disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

#在386行 列出PHP可以禁用的函数,如果某些程序需要用到这个函数,可以删除,取消禁用。
expose_php = Off #在432行 禁止显示php版本的信息
magic_quotes_gpc = On #在745行 打开magic_quotes_gpc来防止SQL注入
short_open_tag = ON #在229行支持php短标签
open_basedir = .:/tmp/ #在380行 设置表示允许访问当前目录(即PHP脚本文件所在之目录)和/tmp/目录,可以防止php木马跨站,如果改了之后安装程序有问题(例如:织梦内容管理系统),可以注销此行,或者直接写上程序的目录/data/www.osyunwei.com/:/tmp/
:wq! #保存退出
/etc/init.d/mysqld restart #重启MySql
/etc/init.d/httpd restart #重启Apche

测试篇
cd /var/www/html
vi index.php #输入下面内容
<?php
phpinfo();
?>
:wq! #保存退出

注意:apache默认的程序目录是/var/www/html

权限设置:chown apache.apache -R /var/www/html

2.3 mysql 配置

创建用户istore

create user istore@localhost idenified by '1234';

grant all privileges on *.* to istore@localhost;

flush privileges;

3 安装owncloud

将owncloud安装包下载后复制到/var/www/html目录,修改owncloud的目录权限。在浏览器中输入ip:port/owncloud,按照提示安装即可。

4、问题与解决办法

4.1 问:yum install不能安装软件。

答:

a、检查了一下,原来是机器没有联网(囧)

b、更新源。方法:http://www.oicto.com/centos-yum-163-sohu/


4.2 问:打开浏览器输入网址后,页面空白

答:查询了apache的日志(这个非常重要),日志目录为/var/log/httpd/,里面的error_log文件,错误显示不能解析一些字符,上网查了一下,原来是php的版本低,要5.3以上。下面是升级php的过程:

Install the extra repositories

The first step requires downloading and installing some RPM files that contain the additional repository definitions, which we'll do with the rpm command:

 
 
  
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm sudo rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

Once installed you should see some additional repository definitions under the /etc/yum.repos.d directory.

 
 
  
$ ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/webtatic.repo /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/webtatic.repo

Enable the webtatic repository

The webtatic repository provides a variety of up-to-date packages that are useful or are a requirement for many popular web-based services.  That means it generally is not a bad idea to enable the webtatic repository by default.

First, open the /etc/yum.repos.d/webtatic.repo repository file using a text editor of your choice,

 
 
  
sudo vim /etc/yum.repos.d/webtatic.repo

Edit the [webtatic] section of the file so that the enabled option is set to 1.  This will enable the remi repository.

 
 
  
[webtatic] name=Webtatic Repository $releasever - $basearch #baseurl=http://repo.webtatic.com/yum/centos/5/$basearch/ mirrorlist=http://repo.webtatic.com/yum/centos/5/$basearch/mirrorlist enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

Installing the PHP 5.3 packages

This section will aim to install PHP 5.3 and any relevant additional modules that may be required. If you are upgrading from an older PHP version to PHP 5.3 please skip to the next section.

The following is an example of a single-shot command of the installation of PHP 5.3 and some common modules:

 
 
  
$ sudo yum install php php-cli php-gd php-mysql php-mbstring

The following is a sample trace output (make note of the package version and the repository):

 
 
  
... Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php x86_64 5.3.20-1.w5 webtatic 1.4 M php-cli x86_64 5.3.20-1.w5 webtatic 2.6 M php-gd x86_64 5.3.20-1.w5 webtatic 108 k php-mbstring x86_64 5.3.20-1.w5 webtatic 1.2 M php-mysql x86_64 5.3.20-1.w5 webtatic 91 k Installing for dependencies: apr x86_64 1.3.12-1.w5 webtatic 102 k apr-util x86_64 1.3.12-1.w5 webtatic 84 k apr-util-ldap x86_64 1.3.12-1.w5 webtatic 15 k ... Transaction Summary ================================================================================ Install 26 Package(s) Upgrade 0 Package(s) ... warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID cf4c4ff9 webtatic/gpgkey | 1.6 kB 00:00 Importing GPG key 0xCF4C4FF9 "Andy Thompson <[email protected]>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy Is this ok [y/N]: y ...

To search for available PHP-related packages we can run the following command:

 
 
  
yum search php

Typically the names of php modules begin with php-. Be careful about any packages that start with php53- as these will conflict with the webtatic versions.

Once you've installed PHP and any required supporting modules, skip to the "Last Steps" section below.

Upgrading to PHP 5.3 packages

If you already have PHP installed the upgrade steps are slightly different.

Warning: Before performing this upgrade please take the time to do a full backup of your system. The upgrade should generally be straightforward, but this will depend on the existing package state of your system.

To upgrade php, run:

 
 
  
$ rpm -q php php-5.1.6-27.el5_5.3 $ sudo yum upgrade php ... Dependencies Resolved =================================================================================== Package Arch Version Repository Size =================================================================================== Updating: php x86_64 5.3.20-1.w5 webtatic 1.4 M Installing for dependencies: ... Updating for dependencies: php-cli x86_64 5.3.20-1.w5 webtatic 2.6 M php-gd x86_64 5.3.20-1.w5 webtatic 108 k php-mbstring x86_64 5.3.20-1.w5 webtatic 1.2 M php-mysql x86_64 5.3.20-1.w5 webtatic 91 k Transaction Summary =================================================================================== ... $ rpm -q php php-5.3.20-1.w5

The above commands will check the installed PHP version then update the existing php package and any associated packages to the 5.3 version in the webtatic and epel repositories.

Last steps

At this point you should have PHP 5.3 installed using the webtatic package repository. The last thing to do is to restart apache if it is currently running so that the new PHP version is loaded.

 
 
  
$ sudo /etc/init.d/httpd restart

A quick confirmation from the terminal should let you check the PHP version:

 
 
  
$ php -v PHP 5.3.20 (cli) (built: Dec 20 2012 18:11:02) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
安装之后页面出来了,但是提示php 的dom module没有安装,执行命令yum install php-xml,问题解决。


附:linux下apache的管理与配置:http://blog.csdn.net/ylqmf/article/details/5291680

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/xia_yu_mao_fa/article/details/37810315

智能推荐

攻防世界_难度8_happy_puzzle_攻防世界困难模式攻略图文-程序员宅基地

文章浏览阅读645次。这个肯定是末尾的IDAT了,因为IDAT必须要满了才会开始一下个IDAT,这个明显就是末尾的IDAT了。,对应下面的create_head()代码。,对应下面的create_tail()代码。不要考虑爆破,我已经试了一下,太多情况了。题目来源:UNCTF。_攻防世界困难模式攻略图文

达梦数据库的导出(备份)、导入_达梦数据库导入导出-程序员宅基地

文章浏览阅读2.9k次,点赞3次,收藏10次。偶尔会用到,记录、分享。1. 数据库导出1.1 切换到dmdba用户su - dmdba1.2 进入达梦数据库安装路径的bin目录,执行导库操作  导出语句:./dexp cwy_init/[email protected]:5236 file=cwy_init.dmp log=cwy_init_exp.log 注释:   cwy_init/init_123..._达梦数据库导入导出

js引入kindeditor富文本编辑器的使用_kindeditor.js-程序员宅基地

文章浏览阅读1.9k次。1. 在官网上下载KindEditor文件,可以删掉不需要要到的jsp,asp,asp.net和php文件夹。接着把文件夹放到项目文件目录下。2. 修改html文件,在页面引入js文件:<script type="text/javascript" src="./kindeditor/kindeditor-all.js"></script><script type="text/javascript" src="./kindeditor/lang/zh-CN.js"_kindeditor.js

STM32学习过程记录11——基于STM32G431CBU6硬件SPI+DMA的高效WS2812B控制方法-程序员宅基地

文章浏览阅读2.3k次,点赞6次,收藏14次。SPI的详情简介不必赘述。假设我们通过SPI发送0xAA,我们的数据线就会变为10101010,通过修改不同的内容,即可修改SPI中0和1的持续时间。比如0xF0即为前半周期为高电平,后半周期为低电平的状态。在SPI的通信模式中,CPHA配置会影响该实验,下图展示了不同采样位置的SPI时序图[1]。CPOL = 0,CPHA = 1:CLK空闲状态 = 低电平,数据在下降沿采样,并在上升沿移出CPOL = 0,CPHA = 0:CLK空闲状态 = 低电平,数据在上升沿采样,并在下降沿移出。_stm32g431cbu6

计算机网络-数据链路层_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输-程序员宅基地

文章浏览阅读1.2k次,点赞2次,收藏8次。数据链路层习题自测问题1.数据链路(即逻辑链路)与链路(即物理链路)有何区别?“电路接通了”与”数据链路接通了”的区别何在?2.数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点。3.网络适配器的作用是什么?网络适配器工作在哪一层?4.数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?5.如果在数据链路层不进行帧定界,会发生什么问题?6.PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输

软件测试工程师移民加拿大_无证移民,未受过软件工程师的教育(第1部分)-程序员宅基地

文章浏览阅读587次。软件测试工程师移民加拿大 无证移民,未受过软件工程师的教育(第1部分) (Undocumented Immigrant With No Education to Software Engineer(Part 1))Before I start, I want you to please bear with me on the way I write, I have very little gen...

随便推点

Thinkpad X250 secure boot failed 启动失败问题解决_安装完系统提示secureboot failure-程序员宅基地

文章浏览阅读304次。Thinkpad X250笔记本电脑,装的是FreeBSD,进入BIOS修改虚拟化配置(其后可能是误设置了安全开机),保存退出后系统无法启动,显示:secure boot failed ,把自己惊出一身冷汗,因为这台笔记本刚好还没开始做备份.....根据错误提示,到bios里面去找相关配置,在Security里面找到了Secure Boot选项,发现果然被设置为Enabled,将其修改为Disabled ,再开机,终于正常启动了。_安装完系统提示secureboot failure

C++如何做字符串分割(5种方法)_c++ 字符串分割-程序员宅基地

文章浏览阅读10w+次,点赞93次,收藏352次。1、用strtok函数进行字符串分割原型: char *strtok(char *str, const char *delim);功能:分解字符串为一组字符串。参数说明:str为要分解的字符串,delim为分隔符字符串。返回值:从str开头开始的一个个被分割的串。当没有被分割的串时则返回NULL。其它:strtok函数线程不安全,可以使用strtok_r替代。示例://借助strtok实现split#include <string.h>#include <stdio.h&_c++ 字符串分割

2013第四届蓝桥杯 C/C++本科A组 真题答案解析_2013年第四届c a组蓝桥杯省赛真题解答-程序员宅基地

文章浏览阅读2.3k次。1 .高斯日记 大数学家高斯有个好习惯:无论如何都要记日记。他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢?高斯出生于:1777年4月30日。在高斯发现的一个重要定理的日记_2013年第四届c a组蓝桥杯省赛真题解答

基于供需算法优化的核极限学习机(KELM)分类算法-程序员宅基地

文章浏览阅读851次,点赞17次,收藏22次。摘要:本文利用供需算法对核极限学习机(KELM)进行优化,并用于分类。

metasploitable2渗透测试_metasploitable2怎么进入-程序员宅基地

文章浏览阅读1.1k次。一、系统弱密码登录1、在kali上执行命令行telnet 192.168.26.1292、Login和password都输入msfadmin3、登录成功,进入系统4、测试如下:二、MySQL弱密码登录:1、在kali上执行mysql –h 192.168.26.129 –u root2、登录成功,进入MySQL系统3、测试效果:三、PostgreSQL弱密码登录1、在Kali上执行psql -h 192.168.26.129 –U post..._metasploitable2怎么进入

Python学习之路:从入门到精通的指南_python人工智能开发从入门到精通pdf-程序员宅基地

文章浏览阅读257次。本文将为初学者提供Python学习的详细指南,从Python的历史、基础语法和数据类型到面向对象编程、模块和库的使用。通过本文,您将能够掌握Python编程的核心概念,为今后的编程学习和实践打下坚实基础。_python人工智能开发从入门到精通pdf