linux 安装开发工具

在学习linux上旅途中,遇到种种问题,现已解决做下笔记

一  一键安装

[转自]lnmp.org 页面解释的比较详细

安装LNMP稳定版

wget -c http://soft.vpser.net/lnmp/lnmp1.3-full.tar.gz
&& tar zxf lnmp1.3-full.tar.gz && cd lnmp1.3-full
&& ./install.sh lnmp

详细请想看 lnmp.org

安装redis等缓存

请看 https://lnmp.org/faq/addons.html

二 yum 安装 [学习于 http://blog.chinaunix.net/uid-26744202-id-5746873.html]

1,安装 epel源  EPEL源作为CENTOS官方源的补充,里边都是一些基础包(https://fedoraproject.org/wiki/EPEL 官网)

  1. rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

2,安装Remi源,Remi源几乎都是最新稳定版,都是Linux骨灰级大牛维护更新 (http://rpms.famillecollet.com/ 官网)

  1. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

3,开始安装PHP,

  1. ======================================================================================================================= N/S Matched: php-fpm ========================================================================================================================
  2. php-fpm.x86_64 : PHP FastCGI Process Manager
  3. php56-php-fpm.x86_64 : PHP FastCGI Process Manager
  4. php70-php-fpm.x86_64 : PHP FastCGI Process Manager
  5. php71-php-fpm.x86_64 : PHP FastCGI Process Manager

  php-fpm默认为5.3,此处建议安装PHP56

  1. yum install  --enablerepo=remi  php56-php-fpm php56-php-mysqld  php56-php-redis

  可选择性安装  php56-eaccelerator  , 或者  php-pecl-apc ,以及  opcahce 都是PHP加速器。

  yum install  --enablerepo=remi  php56-php-pear php56-php-devel  php56-php-opcache

  1. chkconfig --level 2345 php56-php-fpm on

启动PHP-FPM

  1. service php56-php-fpm restart

4,安装mysql

  1. yum -y --enablerepo=remi  install mysql  mysql-server
  1. chkconfig --level 2345 mysqld on
  1. service mysqld start

用  mysql_secure_installation   命令 开始设置mysqld,然后可按照自己喜好修改mysql
配置文件路径 mysql_install_db --defaults-file=/etc/my.cnf (//查看mysql 启动配置文件ps
-ef | grep mysqld)

ps :

默认 mysql 密码为空  直接按回车即可

6,安装并运行  redis

  1. yum install --enablerepo=remi  redis
  2. service redis start

7,安装nginx

点击(此处)折叠或打开

  1. yum install nginx
  2. service nginx start

修改PHP session 保存方式

vim /opt/remi/php56/root/etc/php-fpm.d/www.conf

找到  session 修改

php_value[session.save_handler] = redis

php_value[session.save_path]    = "tcp://127.0.0.1:6379"

最后关闭防火墙

/etc/init.d/iptables  stop

如若遇到session 保存不了的情况,请检查session保存目录

#建立session保存目录

mkdir /var/lib/php/session

chmod -R 777 /var/lib/php/session

我在安装mysql的时候出现了问题

  • file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686
  • file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-community-5.1.58-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.52-1.el6_0.1.i686

error Summary   原因是包冲突

解决办法把包全部删掉

yum remove mysql-libs-5.1.52*

删除之后再安装一遍

安装完各种环境以后,第二步要做的就是  让nginx 支持PHP

找到 nginx下的default.conf  找到

  1. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  2. #
  3. #location ~ \.php$ {
  4. # root html;
  5. # fastcgi_pass 127.0.0.1:9000;
  6. # fastcgi_index index.php;
  7. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  8. # include fastcgi_params;
  9. #}

因为nginx默认没有关联PHP,所以此处

将其修改为

    1. location ~ \.php$ {
    2. root /usr/share/nginx/html;
    3. fastcgi_split_path_info ^(.+\.php)(/.+)$;
    4. fastcgi_pass 127.0.0.1:9000;
    5. fastcgi_index index.php;
    6. try_files $uri =403;
    7. fastcgi_param SCRIPT_FILENAME $request_filename;
    8. include fastcgi_params;
    9. }

然后,将解析所有文件处 加上默认 index.php  ,按照先后顺序决定优先解析那种文件

  1. location / {
  2. root /usr/share/nginx/html;
  3. index index.html index.htm;
  4. }

修改为

  1. location / {
  2. root /usr/share/nginx/html;
  3. index index.php index.html index.htm;
  4. }

这样 nginx就能解析PHP文件了

另外 此处可加上用socket方式执行php-fpm 来优化速度,具体方式为

找到 php-fpm.d/www.conf  然后  修改其中的

  1. listen = 127.0.0.1:9000

将其改成

  1. listen = /tmp/php-fcgi.sock

另外注意 权限问题,默认mode 是 0660 重启php-fpm会没办法读取 fcgi 需改成  0666

;listen.owner = php-fpm

;listen.group = php-fpm

listen.mode = 0666

然后 再在nginx解析PHP修改 fastcgi_pass 执行方式为socket

  1. location ~ \.php$ {
  2. root /usr/share/nginx/html;
  3. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  4. fastcgi_pass unix:/tmp/php-fcgi.sock;
  5. fastcgi_index index.php;
  6. try_files $uri =403;
  7. fastcgi_param SCRIPT_FILENAME $request_filename;
  8. include fastcgi_params;
  9. }

这样php-fpm就是以socket方式执行了

上传文件大小

vim /etc/nginx/nginx.conf

client_max_body_size 10M;

时间: 2024-08-05 11:17:56

linux 安装开发工具的相关文章

Windows+Linux安装Python工具setuptools

Windows+Linux安装Python工具setuptools setuptools是 Python Enterprise Application Kit(PEAK)的一个副项目,它 是一组Python的 distutilsde工具的增强工具(适用于 Python 2.3.5 以上的版本,64 位平台则适用于 Python 2.4 以上的版本),可以让程序员更方便的创建和发布 Python 包,特别是那些对其它包具有依赖性的状况. 经常接触Python可能会注意到,当需要安装第三方pytho

linux远程开发工具byobu和sublime的SFTP

linux远程开发工具 对话管理工具 byobu 当程序放在远程服务器上运行时,如果连接断开,程序将停止在服务器上运行.或者程序需要执行的时间较长,而超出一定时长后,XShell会自行断开连接,导致程序运行被终止. 在跑深度网络,或下载测试数据时,由于网络不稳定,ssh连接可能会断开,程序终止运行. 为了保证程序能够在断开连接后依然正常运行,且将输出保存到指定文件中,可以使用screen,tmux,byobu,其中推荐使用byobu. byobu使用screen或tumx作为后端,使用起来简单快

使用Visual Studio 2017作为Linux C++开发工具

使用Visual Studio 2017作为Linux C++开发工具

业余草,Java新人入职——配置环境及安装开发工具(总结)

很多新人对于进入新公司,相关工具的安装和环境变量的设定很苦恼.又苦于没有完整的配置开发环境的资料,我这里写一篇操作步骤的案例, 至少让你能把开发工具安装起来,并实用起来,就不会那么无助了.毕竟连开发环境都弄不好的人,leader对你肯定也不抱希望.废话少说,具体操作如下: 一.首先肯定是安装jdk 1.下载jdk版本 这里我的电脑是64位的,用的是Java8  , jdk版本是jdk1.8.0_92.  下载地址:链接:http://pan.baidu.com/s/1pLht3eF 密码:vgw

Linux之一次性安装开发工具:yum groupinstall Development tools

[[email protected] ~]$ yum grouplist | moreLoaded plugins: fastestmirror, refresh-packagekit, securitySetting up Group ProcessDetermining fastest mirrors * base: mirrors.tuna.tsinghua.edu.cn * extras: mirrors.tuna.tsinghua.edu.cn * updates: mirrors.z

安装开发工具

windows用户   安装R            https://cran.r-project.org/ 安装RStudio   https://www.rstudio.com/ 安装Rtools     https://cran.r-project.org/bin/windows/Rtools/ 备注: 1. RStudio是R语言的集成开发环境,包括面向桌面用户的IDE和通过浏览器远程访问的Linux R服务器: 2. Rtools是windows平台上building R packag

Linux安装开发环境,必须配置的环节(Fedora15版本)

前提:U盘安装fedora:<[原]U盘安装Fedora15 DVD镜像>.<Grub引导安装Fedora15> 1.设置代理上网:<fedora 配置网络代理> 建立一个本地连接先. 设置完即可web上网,yum上网. 2.安装最快yum镜像      先设置一下yum本地源<[原]fedora 设置本地源  > #yum install yum-fastestmirror 3.虚拟机共享文件,必装yum.<[原]VirtualBox增强包安装和设置

linux 安装交叉编译工具

以arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2为例 1.获取要安装的交叉编译工具.(一般芯片厂商提供,也可自行下载) 2.使用tar命令:tar jxvf arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 解压缩安装到当前目录下(tar 后面参数可根据具体压缩格式进行变换) 3.使用find .pwd获取安装路径 进入到上一步解压目录使用find查找bin目录 find . -name bin.如果bin目录下有下面交叉编译工具,表

win8.1安装开发工具vs2013.3+mssql2012全程

几个常用的命令 重起计算机命令:shoutdown.exe -r -t 0 立刻重起 在远程桌面中没有关机重起的选项,这个命令是必须的 远程桌面连接:mstsc 硬件环境:I7 4770 64RAM 1T 1.备份系统驱动 http://dlsw.baidu.com/sw-search-sp/soft/1d/11114/DG8Setup_1240TZ.1408925297.exe 这里比较重要是的网卡驱动,虽然win8会自动寻找合适的驱动,建议还是备份一下为好 D:\MyDrivers\back