这里说的生产环境是php5.4x,要高版本的其实也一样

第一步:安装xampp

xampp它是跨平台的,且自带很多拓展,安装之后会为我们省去很多事,使用起来很方便。

i>http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.2/ 在这里找个x64版本的,右键复制链接(如果选择5.4*版本的,这步可省略)

ii>下载 wget http://cznic.dl.sourceforge.net/project/xampp/XAMPP%20Linux/1.8.2/xampp-linux-x64-1.8.2-6-installer.run

iii>增加权限:chmod a+x xampp-linux-x64-1.8.3-a-installer.run

iv>

  sh xampp-linux-x64-1.8.--installer.run

 xampp-linux-x64-1.8.--installer.run: xampp-linux-x64-1.8.--installer.run: cannot execute binary file

 [root@nginxone src]# ./xampp-linux-x64-1.8.--installer.run

 ----------------------------------------------------------------------------

 Welcome to the XAMPP Setup Wizard.

 ----------------------------------------------------------------------------

 Select the components you want to install; clear the components you do not want

 to install. Click Next when you are ready to continue.

 XAMPP Core Files : Y (Cannot be edited)

 XAMPP Developer Files [Y/n] :y

 Is the selection above correct? [Y/n]: y

 ----------------------------------------------------------------------------

 Installation Directory

 XAMPP will be installed to /opt/lampp

 Press [Enter] to continue :

 ----------------------------------------------------------------------------

 Setup is now ready to begin installing XAMPP on your computer.

 Do you want to continue? [Y/n]: y

 ----------------------------------------------------------------------------

 Please wait while Setup installs XAMPP on your computer.

  Installing

  % ______________ % ______________ %

  #########################################

 ----------------------------------------------------------------------------

 Setup has finished installing XAMPP on your computer.

 Launch XAMPP [Y/n]: y
六、启动xampp:

[root@nginxone lampp]# /opt/lampp/xampp start

Starting XAMPP for Linux 1.8.-...

XAMPP: Starting Apache...fail.

XAMPP:  Another web server is already running.

XAMPP: Starting MySQL...ok.

XAMPP: Starting ProFTPD...fail.

XAMPP:  Another FTP daemon is already running.

七、停止xampp:

[root@nginxone lampp]# /opt/lampp/xampp stop

Stopping XAMPP for Linux 1.8.-...

XAMPP: Stopping Apache...not running.

XAMPP: Stopping MySQL...ok.

XAMPP: Stopping ProFTPD...not running.

八、添加开机启动:

温习一下ln命令,使用方式:

#ln [option] source dist

#ln –s /opt/lampp/xampp /etc/rc.d/init.d/xampp

九、如果执行完上面这条还不能开机自动启动,再执行下面3条语句。

#chkconfig –add xampp

#chkconfig –list | grep xampp

#chkconfig –level  xampp on

访问localhost时会出现拒绝访问,使用下面的方法

http://blog.csdn.net/jonahzheng/article/details/8032454  非本机访问出现的问题,如果这个还解决不了你的问题,是因为不同版本的xampp的httpd-xampp.conf文件有点不太一样

#/opt/lampp/etc/extra/httpd-xampp.conf
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local 将这个注释掉
ErrorDocument /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

第二步:安装sftp,将项目文件上传上去,当然可以使用svn或者git

http://wenku.baidu.com/link?url=2R3rZQj13tWIGNpmOy__cJ0wbXU02IYnj3Kpjgc2fSs4Oeyqo8fOCwrbDm9q34ky1Gk6OU88Qu1i_zUX88xe1VleuSOIXo9itDqbmQz3dYG

项目访问目录默认是在/opt/lampp/htdocs里,如果需要更改在/opt/lampp/etc/httpd.conf里面更改就行了。修改过后记得重启服务 /opt/lampp/xampp restart

第三步:phpmyadmin默认不需要密码就可以登录,且root的初始密码为空,所以要更改用户密码,最好的办法是禁止root用户外部访问,创建新用户,密码需要10几位且包括大小写和数字。

建议直接将phpmyadmin文件夹删除掉,不允许使用phpmyadmin登录数据库

vim /opt/lampp/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['auth_type'] = 'http'; // 从配置文件中获取密码,还可以配成cookie、http等见default文件可知含义。
$cfg['Servers'][$i]['password'] = 'XXXXX'; // 你新配置的密码

第四步:通过上面的设置,访问host/phpmyadmin里是需要输入密码,但用户名填写root,密码为空还是可以访问的,此时需要修改数据库里的root密码

访问host/phpmyadmin,点击mysql数据库,输入命令,再点击右下角的执行。

UPDATE user SET password=PASSWORD('XXXXX') WHERE user='root';
FLUSH PRIVILEGES;

再重新访问host/phpmyadmin,是不是需要新密码才可以访问了。如果不需要密码还可以访问,请查看第三步。

ln -s /opt/lampp/bin/mysql /usr/bin  #建立软链接,这个可以直接通过mysql -uroot -p 命令访问

 安装Memcached

memcached分服务端与客户端,下面讲解的是服务器的安装,此链接里面还有客户端的安装,如果安装php的memcached拓展,请打开此链接 http://www.cnblogs.com/flywind/p/6021568.html

memcache自带一致性hash算法,所以不用再用php实现

1:下载libevent与memcached软件包.

libevent下载地址:http://monkey.org/~provos/libevent/
 memcache下载地址:http://memcached.org/

curl -O https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
curl -O http://www.memcached.org/files/memcached-1.4.33.tar.gz

2:解压,编译libevent。

# tar -zxvf libevent-2.1.-stable.tar.gz
# cd libevent-2.1.-stable
# ./configure --prefix=/usr/local/memcached/libevent
# make && make install

3:解压,编译memcached。

# cd ../
# tar -zxvf memcached-1.4..tar.gz
# cd memcached-1.4.
# /usr/local/php/bin/phpize
# ./configure --prefix=/usr/local/memcached/ --with-php-config=/usr/local/php/bin/php-config --with-libevent=/usr/local/memcached/libevent
# make && make install

开启memcached,并连接测试:
以守护进程模式启动memcached

# /usr/local/memcached/bin/memcached -d -l 192.168.1.39 -p  -m  -u root

客户端连接测试(使用telnet)

#telnet192.168.1.39 

能连接上,说明memcached成功启用,可使用stats命令查看当前状态

#stats 

安装memcache

php7下memcache安装参考:https://www.cnblogs.com/hejun695/p/5369610.html

(1)、安装memcache

PHP Memcache扩展

官网:http://pecl.php.net/package/memcache
          下载:http://pecl.php.net/get/memcache-2.2.7.tgz

tar -zxvf memcache-2.2.7.tgz
cd memcache-2.2.7
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
//在php.ini中新增配置内容:
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
extension = memcache.so

安装zend guard

下载地址http://www.zend.com/en/products/loader/downloads#Linux

根据选择php版本对应的扩展并下载,将ZendGuardLoader.so放在/opt/lampp/modules/目录下并在php.ini最后添加这行代码

zend_extension="/opt/lampp/modules/ZendGuardLoader.so"

重启xampp

文件不要给777权限,将项目权限给apache用户及用户组 chmod -R daemon:daemon 目录名

添加vhost

vim /opt/lampp/etc/extra/httpd-vhosts.conf

Directory "/data1/www/htdocs/www.simukeji.com">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory> <VirtualHost *:>
ServerAdmin minister.xiang@gmail.com
DocumentRoot "/data1/www/htdocs/www.simukeji.com" ServerName www.qingganzhijia.cn
ServerAlias www.qingganzhijia.cn
</VirtualHost>

redis安装

http://www.cnblogs.com/_popc/p/3684835.html

phpredis扩展配置方法

http://www.cnblogs.com/yangxia-test/p/4195198.html

防火墙配置参考网站

http://www.cnblogs.com/kgdxpr/p/4061646.html centos6+

http://blog.csdn.net/xlgen157387/article/details/52672988  centos7

https配置

http://www.cnblogs.com/chjbbs/p/5748369.html

centos下安装xampp,Zend Guard,memcached的更多相关文章

  1. CentOS下安装XAMPP详细教程

    现在php的集成运行环境越来越多,个人比较喜欢XAMPP,更新速度快,好用,安装便捷.windows下面的安装,就是下一步.下一步,没什么好说的,详细说一下linux下面的安装,这里以CentOS为例 ...

  2. CentOS下安装XAMPP详细教程(转)

    [原文]http://blog.csdn.net/hel12he/article/details/49781813 现在PHP的集成运行环境越来越多,个人比较喜欢XAMPP,更新速度快,好用,安装便捷 ...

  3. centos下安装php环境

    centos下安装php环境 安装apache yum install httpd-devel 启动apache /etc/init.d/httpd start 安装mysql yum install ...

  4. PHP:使用Zend对源码加密、Zend Guard安装以及Zend Guard Run-time support missing的解决方法

    Zend Guard是目前市面上最成熟的PHP源码加密产品了.刚好需要对自己的产品进行加密,折腾了一晚上,终于搞定,将碰到的问题及解决方法记录下来,方便日后需要,也可以帮助其他人.我使用的是Wamps ...

  5. Centos下安装PHP ldap扩展

    Centos下安装PHP ldap扩展,有两种方法,仅供参考. 一.在线安装 执行下面命令: 1 yum install PHP-ldap 可能出现的问题: Error: php70w-common- ...

  6. CentOS下安装hadoop

    CentOS下安装hadoop 用户配置 添加用户 adduser hadoop passwd hadoop 权限配置 chmod u+w /etc/sudoers vi /etc/sudoers 在 ...

  7. CentOS下安装使用start-stop-daemon

    CentOS下安装使用start-stop-daemon 在centos下下了个自启动的服务器脚本 执行的时候发现找不到start-stop-daemon命令 好吧 执行手动编译一下 加上这个命令 w ...

  8. 从零开始学 Java - CentOS 下安装 Tomcat

    生活以痛吻我,我仍报之以歌 昨天晚上看到那个冯大辉老师的微信公众号,「小道消息」上的一篇文章,<生活以痛吻我,我仍报之以歌>.知乎一篇匿名回答,主题为<冯大辉到底是不是技术大牛,一个 ...

  9. CentOS 下安装

    2016年12月5日15:25:58 ----------------------------------- 通常情况下在centos下安装软件就用yum. 关键是,使用yum你要知道安装包的名字是什 ...

随机推荐

  1. C++ 面向对象的三个特点--多态性(一)

    C++的多态性定义 所谓多态性就是不同对象收到相同的消息产生不同的动作.通俗的说,多态性是指一个名字定义不同的函数,这些函数执行不同但又类似的操作,即用同样的接口访问功能不同的函数,从而实现“一个接口 ...

  2. event 对象 小记

    event对象的属性提供了有关事件的细节并且通过event对象的方法,可以控制事件的继续传播和阻止事件的默认行为 2级DOM Events 标准定义了一个标准的事件模型  被除了IE外的所有现代浏览器 ...

  3. 关于字符串replace方法第二个参数探究

    网上有关replace的文章很多了,这里主要聊聊它的第二个参数.阅读本文需要对replace方法有一定了解.W3school=>replace 我们要把一段字符串中的某些指定字符替换掉,第一时间 ...

  4. Jquery easyui Tree的简单使用

    Jquery easyui Tree的简单使用 Jquery easyui 是jQuery EasyUI是一组基于jQuery的UI插件集合,而jQuery EasyUI的目标就是帮助web开发者更轻 ...

  5. java多线程系列6-阻塞队列

    这篇文章将使用经典的生产者消费者的例子来进一步巩固java多线程通信,介绍使用阻塞队列来简化程序 下面是一个经典的生产者消费者的例子: 假设使用缓冲区存储整数,缓冲区的大小是受限制的.缓冲区提供wri ...

  6. Static Cell-静态TableView

    使用静态TableView有两个前提,1.要在Storyboard上  2.需要使用TableViewController PS:如果需要设置不同的cell的高度不同的话,还是需要使用tableVie ...

  7. IOS 网络浅析-(八 NSURLSession简介)

    就在不长也不短的时间前,苹果正式命令咱们要向NSURLSession看,因此我们不得不认认真真的听从老大的教导,努力认知NSURLSession.其实呢,三方早已为我们解决了问题,但是呢,我们还是有必 ...

  8. iOS之UI--CAShapeLayer

    关于CAShapeLayer 内容大纲: CAShapeLayer简介 贝塞尔曲线与CAShapeLayer的关系 strokeStart和strokeEnd 动画 用CAShapeLayer实现进度 ...

  9. MySql下载安装(Mac平台) 终端启动 XMAPP启动

    1,下载 2,点击MySQL Community Server之后,然后看到需要注册登录的节目,我们就点击最下面just start my download直接下载.懒的注册或者登陆: 3.下载后,& ...

  10. iOS中倒计时

    方法一:使用NSTimer来实现(比较适用于发送短信验证码倒计时) 主要是利用NSTimer的scheduledTimerWithTimeInterval方法来每秒执行一次changeTime方法 / ...