LNMP环境快速搭建 + Wiki部署
来源:互联网 发布:淘宝运营前景 编辑:程序博客网 时间:2024/05/21 21:44
- 一安装msyqlPHP
- 1系统centos65
- 2安装 开发软件包
- 步骤1安装开发工具
- 步骤2安装相关工具
- 步骤3安装mysql
- 步骤4下载PHP-562 wget
- 步骤5configure
- 步骤6make make install
- 步骤7修改php配置文件
- 3安装nginx
- 修改 vim etcnginxnginxconf
- 步骤8启动服务
- 二wiki安装部署
- 1首先登录进入mysql数据库
- 2创建一个wiki库
- 下载wiki软件
- 三需要的相关技术
- 1vim
- 2上传下载功能
- 3mysql相关命令
- 4修改文件权限
- 一安装msyqlPHP
一、安装msyql+PHP
1、系统centos6.5
2、安装 开发软件包
步骤1:安装开发工具
yum -y groupinstall "Development Tools"yum groupinsall group1 安装程序组group1
步骤2:安装相关工具
yum -y install libxml2* curl curl-devel libjpeg* libpng* libmcrypt* freetype-devel
Libxml2:是个C语言的XML程式库,能简单方便的提供对XML文件的各种操作,并且支持XPATH查询,及部分的支持XSLT转换等功能
curl:是利用URL语法在命令行方式下工作的开源文件传输工具
libjpeg库是专门用于jpeg图片格式解压和压缩的库
libpng库是专门用于png图片格式解压和压缩的库
libmcrypt:This is a modular version of libmcrypt, that uses dynamic loading. It is usefull where adding/removing of algorithms at run-time is necessary.
如果Linux没有修改成163的源可以直接安装 如果已经改成了163的源需要执行下面的代码
echo $?检查是否有报错
官网不自带 libmcrypt libmcrypt-develwget http://www.atomicorp.com/installers/atomic 下载这个yum源执行 sh ./atomic yum -y install libmcrypt libmcrypt-devel
步骤3:安装mysql:
yum -y install mysql mysql-server mysql-devel
步骤4:下载PHP-5.6.2 wget
wget http://cn2.php.net/distributions/php-5.6.2.tar.gz解压 tar -xvf php-5.6.2.ta.rgz 1. cd php-5.6.2 2. 编译安装php
步骤5:./configure
二种情况 1. mysql的rpm包用这种方式编译./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/services/mysql --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl --enable-bcmath --enable-sockets 2. 你使用yum来安装mysql ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl --enable-bcmath --enable-sockets
configure注释:
configure,这一步一般用来生成 Makefile,为下一步的编译做准备,你可以通过在 configure 后加上参数来对安装进行控制,比如代码:./configure –prefix=/usr 意思是将该软件安装在 /usr 下面,执行文件就会安装在 /usr/bin (而不是默认的 /usr/local/bin),资源文件就会安装在 /usr/share(而不是默认的/usr/local/share)。同时一些软件的配置文件你可以通过指定 –sys-config= 参数进行设定。有一些软件还可以加上 –with、–enable、–without、–disable 等等参数对编译加以控制,你可以通过允许 ./configure –help 察看详细的说明帮助。
步骤6:make && make install
运行 make && make installmake与make install是两个命令,在你./configuration生成了Makefile之后执行编译安装;与&&一起的还有||,不过意思不一样,&&是与,||是或;make && make install的意思就是执行make如果没有发生错误就执行make install
步骤7:修改php配置文件
将相应的文件复制到自己将使用的地方 cp php.ini-production /usr/local/php/etc/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp /opt/php-5.6.2/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm 对文件php-fpm进行权限修改chmod +x /etc/init.d/php-fpm
–注意–
如果出现未安装的错误一般使用yum安装即可 记得别忘记libcurl* 1. 出现找不到文件路径的情况下 用 find / -name 'name'去查找一下 2. 出现warning的謦欬下大多是因为版本以及默认安装了,可以去掉该行 3. 启动php 等安装完nginx后才启动
3、安装nginx
yum -y install nginx
修改 vim /etc/nginx/nginx.conf
user nginx nginx;worker_processes 16;#日志存放地#error_log /data/logs/nginx_error.log crit;error_log /var/log/nginx_error.log crit;#pid /usr/local/services/nginx/nginx.pid;pid /var/run/nginx.pid;#Specifies the value for maximum file descriptors that can be opened by this process.worker_rlimit_nofile 65535;events{ use epoll; worker_connections 65535;}http{ include mime.types; default_type application/octet-stream; #charset gb2312; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; #limit_zone crawler $binary_remote_addr 10m; log_format www '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; server { listen 80; server_name vagrant-centos65.vagrantup.com; index start.php index.htm index.html index.php pengyou.php weibo.php qzone.php; root /usr/share/nginx/html; #limit_conn crawler 20; location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index start.php;# include fcgi.conf; include fastcgi.conf; } location ~ .*.(svn|git|cvs) { deny all; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } }}
步骤8:启动服务
1、启动php-fpm #修改user和group vim /usr/local/php/etc/php-fpm user=nginx group=nginx 2、启动php-fpm /etc/init.d/php-fpm start 3、启动nginx /etc/init.d/nginx start 4、编写php文件测试,服务是否正常 vim /usr/share/nginx/html/cc.php <?php phpinfo(); ?> 虚拟机IP/cc.php 例如:192.168.1.115/cc.php
LNMP安装完成
二、wiki安装部署
1、首先登录进入mysql数据库
#进入到数据库的命令行模式mysql -uroot
2、创建一个wiki库
#创建wiki数据库create database wiki charset utf8; #对数据库进行权限赋予grant all on wiki.* to wiki@'localhost' identified by 'wiki'; #刷新MySQL的系统权限相关表flush privileges;
下载wiki软件
http://kaiyuan.hudong.com/ #创建hdwiki的文件夹touch hdwiki#下载HDWiki UTF的压缩包,上传后解压缩unzip HDWiki-v6.0UTF8-20170209.zip #将文件夹内解压缩的文件移到我们的环境下mv hdwiki/* /usr/share/nginx/html/
浏览器http://192.168.1.115/hdwiki直接进行配置就可以了
三、需要的相关技术
1、vim
Vim是一个类似于Vi的著名的功能强大、高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性。[1] VIM是自由软件。安装 yum -y install vim
2、上传下载功能
安装 yum -y install lrzsz
使用方法:
sz命令发送文件到本地:# sz filenamerz命令本地上传文件到服务器:# rz执行该命令后,在弹出框中选择要上传的文件即可。
3、mysql相关命令
设置初始密码或修改密码
1、mysql -uroot2、use mysql;3、update user set password=password("123456") where user="root";4、flush privileges;5、exit
4、修改文件权限
语法:
chmod [who] [+ | - | =] [mode] 文件名
命令中各选项的含义为
u 表示“用户(user)”,即文件或目录的所有者。g 表示“同组(group)用户”,即与文件属主有相同组ID的所有用户。o 表示“其他(others)用户”。a 表示“所有(all)用户”。它是系统默认值。
操作符号可以是:
+ 添加某个权限。- 取消某个权限。= 赋予给定权限并取消其他所有权限(如果有的话)。
设置mode所表示的权限可用下述字母的任意组合:
r 可读。w 可写。x 可执行。
X 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性。
s 在文件执行时把进程的属主或组ID置为该文件的文件属主。方式“u+s”设置文件的用户ID位,“g+s”设置组ID位。t 保存程序的文本到交换设备上。u 与文件属主拥有一样的权限。g 与和文件属主同组的用户拥有一样的权限。o 与其他用户拥有一样的权限。
实例
修改文件可读写属性的方法:
#把index.html 文件修改为可写可读可执行:chmod 777 index.html#把目录 /images/xiao 修改为可写可读可执行chmod 777 /images/xiao#修改目录下所有的文件夹属性chmod 777 *#要修改目录下所有文件属性可写可读可执行:chmod 777 *.*
阅读全文
1 0
- LNMP环境快速搭建 + Wiki部署
- yum 快速搭建lnmp环境
- LNMP环境+Laravel快速搭建
- CentOS7快速搭建LNMP环境
- [环境部署]Linux之LNMP环境搭建
- LNMP内网部署wiki
- 搭建lnmp环境,部署php动态网站
- Lnmp环境搭建和部署xapi文档
- centos下快速搭建LNMP开发环境
- 学习ubuntu之快速搭建LNMP环境
- Ubuntu 16.04 下快速搭建 LNMP环境
- Ubuntu 16.04 下快速搭建 LNMP环境
- contos7 使用yum快速 搭建lnmp 环境
- 新手部署LNMP环境
- linux 部署lnmp环境
- lnmp环境部署
- 快速搭建lnmp
- HP gen8 服务器快速搭建Centos 7 + lnmp 测试环境
- JVM垃圾收集器整理汇总以及JVM系列文章推荐
- mysql内置函数清除数据中的空格
- java对list进行排序
- 没学过 C 语言的代价
- quartz
- LNMP环境快速搭建 + Wiki部署
- 51nod 1551 集合交易
- 解决AngularJs 缓存问题
- [JZSC2017]【NOIP2017提高组模拟6.29】总结
- 北大丑闻不断,北大资源管理混乱
- 汉字拼音相互转化(QT)
- MySQL的基本操作及SQL语句的基本命令
- 博客第一篇--开博客的初衷
- windows下composer安装说明