怎样进行lnmp服务搭建


本篇文章为大家展示了怎样进行lnmp服务搭建,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。即Nginx网站服务 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为“engine X”,是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服务器。优点:一款高性能、轻量级Web服务软件,稳定性高,系统资源消耗低,对HTTP并发连接的处理能力高,单台物理服务器可支持30 000~50 000个并发请求。Rhel-server-6.5-x86_64-dedbind-9.8.2-0.17.rc.el6_4.6.x86_64.rpmbind-util-9.8.2-0.17.rc.el6_4.6x86_64.rpmbind-chroot-9.8.2-0.17rc1.el6_4.6_x86_64.rpmbind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64.rpmncurses-devel-5.7-3.2009.2.8.el8.x86.rpmcmake:cmake-2.8.6.tar.gzmysql:mysal-5.5.22.tar.gznginx:nginx-1.6.0.tar.gzlibxml2-devellibjpeg-devellibpng-develphp:php-5.3.28.tar.gzZendGuarLoader:ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gzSKYUC:SKYUC.v3.4.2.SOURCE三.拓扑图导入RED HAT镜像文件#cd /media/RHEL_6.5 X86_64 Disc 1/Packages/ //进入镜像文件的Packages//安装与bind相应的包#rpm -ivh bind-9.8.2-0.17.rc.el6_4.6.x86_64.rpm#rpm -ivh bind-util-9.8.2-0.17.rc.el6_4.6x86_64.rpm#rpm-ivh bind-chroot-9.8.2-0.17rc1.el6_4.6_x86_64.rpm#rpm -ivh bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm#vim /etc/named.conf //进入配置文件options {Directory “/var/named”;//指定服务的工作目录,同时指定配置文件的路径};zone “benet.com” IN { //新建域http://benet.comtype master; //主服务器域类型file “benet.com.zone”;//指定文件,是正向解析文件};#vim /var/named/benet.com.zone$TTL 86400 //生存时间记录字段,它以秒为单位@ SOA benet.com. admin.benet.com. ( //SOA记录,特殊字符@, 是 ORIGIN admin 授权主机和管理者信箱。2011030301 //更新序列号4H //刷新时间30M //重试延迟12H //失效时间1D //无效解析记录的生存周期)@ IN NS test.benet.com.test IN A 192.168.1.61www IN A 192.168.1.61#service named restart //重启named#nslookuphttp://test.benet.com//域名解析# rpm -qa mysql-server mysql//查看系统是否安装了mysql服务# yum -y remove mysql //如果安装了mysql,就卸载mysql#cd /media/RHEL_6.5 X86_64 Disc 1/Packages/ //进入镜像文件的Packages#rpm -ivh ncurses-devel-5.7-3.2009.2.8.el8.x86..rpm //安装ncurse# tar zxf cmake-2.8.6.tar.gz //解压# cd cmake-2.8.6 //进入cmake# ./configure //定义路径# gmake && gmake install //进行源代码编译,行源代码安装#tar zxf mysql-5.5.22.tar.gz -C /usr/src/ //解压mysql到/usr/src目录下#cd /usr/src/mysql-5.5.22/ //进入/usr/src/mysql-5.5.22#cmake //指定mysql的安装路径,指向-DCMAKE_INSTALL_PREFIX=/usr/local/mysql // mysql配置文件-DDEFAULT_CHARSET=utf8 //目录/etc/mysql,指定默认的字符集-DDEFAULT_COLLATION=utf8_general_ci //为utf8,设置默认排-DWITH_EXTRA_CHARSETS=all# make && make install //进行源代码编译,执行源代码安装# rm -rf /etc/my.cnf //删除/etc/my.cnf/的配置# cp/usr/src/mysql-5.5.22/support-files/my-medium.cnf /etc/my.cnf//将文件复制到/etc/my.cnf添加系统服务# cp /usr/src/mysql-5.5.22/support-files/mysql.server/etc/rc.d/init.d/mysqld //复制# chmod +x /etc/rc.d/init.d/mysqld //给可执行的权限# chkconfig –add mysqld //添加mysqld服务# echo “PATH=$PATH:/usr/local/mysql/bin” >> /etc/profile //将环境变量下的文件输出到 /etc/profile# groupadd mysql //添加组# useradd -M -s /sbin/nologin mysql -g mysql //添加用户# chown -R mysql:mysql /usr/local/mysql //对数据库目录进行权限设置初始化数据#/usr/local/mysql/scripts/mysql_install_db–user=mysql–basedir=/usr/local/mysql –datadir=/usr/local/mysql/data/# service mysqld start //启动mysql服务器# /etc/init.d/mysqld status //查看mysql的状态# netstat -anpt | grep mysqld //过滤mysql启用的端口# mysqladmin -u root -p password 123456//更改mysql的root用户密码# mysql -u root -p //登录用户并输入密码mysql> SHOW MASTER LOGS;//查看当前数据库服务的日志文件信息mysql> EXIT //退出#vi /etc/yum.repos.d/local.repo //指定仓库位置,并编辑[local]name=123baseurl=file:///media/cdromenabled=1gpgcheck=0#cd /etc/yum.repos.d //进入此目录#mkdir /li //创建文件夹#mv C* /li //移动所有以C开头的文件到/li下面# yum -y install pcre-devel zlib-devel//用yum安装pcre zlib# useradd -M -s /sbin/nologin nginx //建立用户账户#tar zxf nginx-1.6.0.tar.gz //解压Nginx#cd nginx-1.6.0 //进入此目录#./configure–prefix=/usr/local/nginx–user=nginx–group=nginx–with-http_stub_status_module //定义路径#make && make install //源代码编译,并执行源代码编译#ln -s /usr/local/nginx/sbin/nginx/usr/local/sbin///软连接#ln -l /usr/local/sbin/nginx //访问文件#nginx -t //检查配置文件#nginx //启动#nginx -anpt | grep nginx //停止nginx使用elink浏览器#yum -y install elink //已经安装#elinkhttp://localhost#kill -s HUP nginx //重载配置#kill -s QUIT nginx //停止服务#vim /etc/init.d/nginx //编辑文件#!/bin/bash#chkconfig: – 99 20#description: Nginx Service Control ScriptPROG=”/usr/local/nginx/sbin/nginx”PIDF=”/usr/local/nginx/logs/nginx.pid”case “$1” instart)$PROG;;stop)kill -s QUIT $(cat $PIDF);;restart)kill -s QUIT $(cat $PIDF)$PROG;;reload)kill -s HUP $(cat $PIDF);;*)echo “Usage: $0 { start | stop | restart | reload }”exit 1esacexit 0#chmod +x /etc/init.d/nginx //给文件执行权限#chkconfig –add nginx //启动nginx服务#mkdir -p /var/www/benet //创建文件夹#echo “#vim /usr/local/nginx/conf/nginx.conf //调整nginx.conf配置文件server {listen 80; //端口server_name ng.accp.com; //主机域名charset ‘utf-8’;access_log logs/benet.access.log;location / {root /var/www/benet; //根index index.html test .php; //PHP所在的路径}}#service nginx restart //重启nginxhttp://ng.benet.com#rpm -qa | grep “^php” //查看是否已安装PHP#yum -y install gd libxml2-devellibjpeg-devel libpng-devel //yum安装libxml2 libjpeg libpng# tar zxf php-5.3.28.tar.gz -C /usr/src/ //解压到/usr/src# cd /usr/src/php-5.3.28/ //进入目录# ./config–prefix=/usr/local/php5–with-gd –with-zlib –with-mysql=/usr/lcoal/mysql –with-config-file-path=/usr/local/php5 –enable-mbstring –enable-fpm –with-jpeg-dir=/usr/lib //定义路径#make && make install //编译并安装#cp /usr/src/php-5.3.28/php.ini-development /usr/local/php5/php.ini //复制#vim免费云主机域名 /usr/local/php5/php.ini //修改文档default_charset = “utf-8″file_uploads = Onupload_max_filesize = 2Mmax_file_uploads = 20post_max_size = 8Mshort_open_tag = On# ln -s /usr/local/php5/bin/* /usr/local/bin/ //软连接# ln -s /usr/local/php5/sbin/* /usr/local/sbin/ //软连接1.#tarzxfZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz-C /usr/src/ //解压到usr/src#cd /usr/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/ //进入PHP目录# cp ZendGuardLoader.so /usr/local/php5/lib/php///复制到/usr/local/php5/lib/php/修改php.ini配置文件,添加加载及启用ZendGuardLoader.so模块的配置语句# vim /usr/local/php5/php.ini //增加路径zend_extension=/usr/local/php5/lib/php/ZendGuardLoader.so //指定路径zend_loader.enable=1 //# vim /var/www/benet/test.php //编辑php

$link=mysql_connect(‘localhost’,’root’,’123456′);if($link) echo “mysql_close();?>~# server nginx restart //重启Nginx#rpm -qa unzip //查看zip#yum -y install unzip //yum安装#cd SKYUC.v3.4.2.SOURCE#mv wwwroot /var/www/benet//skyuc#cd /var/www/benet/skuc/#chown -R php:php admincp /data/ templates/ upload#mysql -u root -pmysql> create DATABASE skyucdb;mysql>GRANT all ON skyucdb.* TO runskyuc@locaohost INDENTIFIED BY 123456上述内容就是怎样进行lnmp服务搭建,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注云编程开发博客行业资讯频道。

相关推荐: 怎么搞定HTTPS 配置

本篇文章给大家分享的是有关怎么搞定HTTPS 配置,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。01、关于 FreeSSL.cnFreeSSL.cn 是一个免费提供 HTTPS 证书申请、HTTP…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

Like (0)
Donate 微信扫一扫 微信扫一扫
Previous 02/03 11:44
Next 02/03 11:44