当前位置:首页 » 操作系统 » centoslnmp源码安装

centoslnmp源码安装

发布时间: 2022-02-21 19:44:00

Ⅰ CentOS 7 用户怎样安装 LNMP

Nginx不是从官方CentOS库安装,我们从 nginx 项目安装库安装,修改源:
vi /etc/yum.repos.d/nginx.repo
修改为:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3 安装 Mysql
我们先安装MariaDB。一个免费的MySQL 分支。运行此命令:
yum install mariadb mariadb-server net-tools
然后我们创建MySQL系统启动链接(所以MySQL的自动启动时,系统启动)启动MySQL服务器:
systemctl enable mariadb.service
systemctl start mariadb.service
现在检查网络启用。运行
netstat -tap | grep mysql
它应该显示出这样的内容:
[root@example ~]# netstat -tap | grep mysql
tcp 0 0 0.0.0.0:mysql 0.0.0.0:* LISTEN 10623/mysqld

Ⅱ CentOS 7 用户怎样安装 LNMP

安装方式有多种
一、源码编译安装(一个软件一个软件编译,其实编译的过程都差不多,只要会一个,其它软件都一样,只不过参数修改一下)

二、rpm 包安装,比第一个方法简单些

三、yum安装,很简单 yun install 软件名

四、看你问这个问题,感觉像初次接触 linux 下开发,我建议初次接触的安装集成环境,快、简,比如:安装 wdcp ,在 网络搜 WDCP ,到官网,从下载到安装就几行命令,而且说的很详细

Ⅲ CentOS 7 用户怎样安装 LNMP

LNMP是一个基于CentOS编写的Nginx、php、MySQL、phpMyAdmin、eAccelerator一键安装包。可以在独立主机上轻松的安装LNMP生产环境。 一、获取lnmp源码 1、打开网络,输入lnmp,打开第一个lnmp官网,里面含有很丰富的信息,这里先下载最新版的安装包 2、通过wget soft/lnmp/lnmp1.2-full.tar.gz 下载,选择其他下载地址也可以的; 二、安装lnmp 1、解压tar -xvf lnmp1.2-full.tar.gz ; 2、进入 源码目录cd lnmp1.2-full/ 3、执行./install.sh开始配置,配置完提示Press any key to install...or Press Ctrl+c to cancel,回车后自动编译安装,过程比较漫长,好好等待; 4、安装完成,虽然等待了很久。但是安装完成了很开心。 三、lnmp基本操作 1、开启关闭lnmp服务; 2、访问主要,phpinfo等,验证是否安装成功; 3、在web根目录下编写脚本访问,通过浏览器访问; 访问输出,脚本信息,这样就安装成功了。 注意事项: 下载和安装过程比较漫长,一定耐心仔细

Ⅳ centos6.5 lnmp安装怎样判断是否成功

直接访问ip 看下能不能访问

Ⅳ CentOS 7 用户怎样安装 LNMP

LNMP是一个基于CentOS编写的Nginx、PHP、MySQL、phpMyAdmin、eAccelerator一键安装包。可以在独立主机上轻松的安装LNMP生产环境。
一、获取lnmp源码
1、打开网络,输入lnmp,打开第一个lnmp官网,里面含有很丰富的信息,这里先下载最新版的安装包
2、通过wget http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz 下载,选择其他下载地址也可以的;

二、安装lnmp
1、解压tar -xvf lnmp1.2-full.tar.gz ;
2、进入 源码目录cd lnmp1.2-full/
3、执行./install.sh开始配置,配置完提示Press any key to install...or Press Ctrl+c to cancel,回车后自动编译安装,过程比较漫长,好好等待;
4、安装完成,虽然等待了很久。但是安装完成了很开心。

三、lnmp基本操作
1、开启关闭lnmp服务;
2、访问主要,phpinfo等,验证是否安装成功;
3、在web根目录下编写脚本访问,通过浏览器访问;
访问输出,脚本信息,这样就安装成功了。

注意事项:
下载和安装过程比较漫长,一定耐心仔细

Ⅵ 如何在centos7上部署lnmp环境

一、安装httpd。
yum install -y httpd
安装完成之后使用以下命令启动httpd服务:
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动 可以在浏览器中输入服务器所在的主机的IP即可看到apache的欢迎界面。要在另外一台主机上实现这种访问,需要关闭系统的防火墙。 在CentOS7中,修改防火墙的机制已经做了修改,在CentOS 6.x系统中可以使用以下命令:
service iptables stop
chkconfig iptables off // 开机禁止启动
而在CentOS7中只能使用以下命令,如果使用上面的命令并不会报任何错误,但是起不到关闭防火墙的效果:
systemctl stop firewalld.service
systemctl disable firewalld.service //禁止防火墙开机启动关闭SeLinux:
使用getenforce命令可以查看SeLinux的状态,SeLinux有三种状态,分别为enforcing、permissive和disabled。因为我们的服务器只在内部使用,所以这里我们选择完全关闭(disabled)。具体的做法为修改/etc/sysconfig/selinux文件,具体操作可以看里面的说明。
成功安装httpd(apache)的效果图为:
二、安装MySQL数据库
MySQL数据库,新版本已经更名为Mariadb,所以这里需要安装Mariadb,可以使用下面的命令进行安装:
yum install -y mariadb
安装完成以后使用下面的命令开启数据库服务:
systemctl start mariadb.service #启动MariaDB
systemctl stop mariadb.service #停止MariaDB
systemctl restart mariadb.service #重启MariaDB
systemctl enable mariadb.service #设置开机启动
三、安装PHP。
使用下面的命令可以安装PHP:
yum -y install php
使用下面的命令安装php对Mariadb的支持:
yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
使用下面的命令重启Mariadb和httpd服务:
systemctl restart mariadb.service #重启MariaDB
systemctl restart httpd.service #重启apache

Ⅶ CentOS 7 用户怎样安装 LNMP

1 先说一下
本文使用的主机名称: server1.example.com 和IP地址: 192.168.1.105。这些可能与你的计算机有所不同,注意进行修改。
2 使用外部仓库
Nginx不是从官方CentOS库安装,我们从 nginx 项目安装库安装,修改源:
vi /etc/yum.repos.d/nginx.repo
修改为:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

3 安装 MySQL
我们先安装MariaDB。一个免费的MySQL 分支。运行此命令:
yum install mariadb mariadb-server net-tools
然后我们创建MySQL系统启动链接(所以MySQL的自动启动时,系统启动)启动MySQL服务器:
systemctl enable mariadb.service
systemctl start mariadb.service
现在检查网络启用。运行
netstat -tap | grep mysql
它应该显示出这样的内容:
[root@example ~]# netstat -tap | grep mysql
tcp 0 0 0.0.0.0:mysql 0.0.0.0:* LISTEN 10623/mysqld

运行
mysql_secure_installation
为用户设置根口令(否则,任何人都可以访问你的MySQL数据库!):
[root@example ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] <– 回车
New password: <– 输入ROOT密码
Re-enter new password: <– 再输入一次ROOT密码
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
proction environment.
Remove anonymous users? [Y/n] <– 回车
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <– 回车
… Success!
By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a proction environment.
Remove test database and access to it? [Y/n] <– 回车
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <– 回车
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
[root@example ~]#
[root@server1 ~]# mysql_secure_installation

4 安装 Nginx
Nginx可以作为一个包从nginx.org安装,运行:
yum install nginx
然后我们创建的系统启动nginx的链接和启动它:
systemctl enable nginx.service
systemctl start nginx.service
有时,你会得到一个错误,如80端口已在使用中,错误消息会是这样的
[root@server1 ~]# service nginx start
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
[FAILED]
[root@server1 ~]#
这就意味着有时在运行Apache服务。停止服务,进一步启动服务nginx如下
systemctl stop httpd.service
yum remove httpd
systemctl disable httpd.service
systemctl enable nginx.service
systemctl start nginx.service
开放的HTTP和HTTPS防火墙中的端口
firewall-cmd –permanent –zone=public –add-service=http
firewall-cmd –permanent –zone=public –add-service=https
firewall-cmd –reload
输出的shell结果将看起来像这样:
[root@example ~]# firewall-cmd –permanent –zone=public –add-service=http
success
[root@example ~]# firewall-cmd –permanent –zone=public –add-service=https
success
[root@example ~]# firewall-cmd –reload
success
[root@example ~]#
在你的Web服务器的IP地址或主机名称输入到浏览器(如HTTP:/ /192.168.1.105),你应该看到nginx的欢迎页面。
5 安装 PHP5
我们可以通过PHP-FPM使nginx的PHP5工作(PHP-FPM(FastCGI进程管理器)是一种替代PHP FastCGI执行一些额外的功能,支持任何规模大小,尤其是繁忙的站点很有用)。我们可以安装php-fpmtogether用PHP-CLI和一些PHP5的模块,如PHP,MySQL,你需要的,如果你想使用MySQL的PHP命令如下:
yum install php-fpm php-cli php-mysql php-gd php-ldap php-odbc php-pdo php-pecl-memcache php-pear php-mbstring php-xml php-xmlrpc php-mbstring php-snmp php-soap
APC是一个自由和开放的PHP操作码来缓存和优化PHP的中间代码。它类似于其他PHP操作码cachers,如eAccelerator和XCache。强烈建议有���些安装,以加快您的PHP页面。
我会从PHP PECL库中安装的APC。 PECL要求CentOS开发工具beinstalled编译APC包。
yum install php-devel
yum groupinstall ‘Development Tools’
安装 APC
pecl install apc
[root@example ~]# pecl install apc
downloading APC-3.1.13.tgz …
Starting to download APC-3.1.13.tgz (171,591 bytes)
……………..done: 171,591 bytes
55 source files, building
running: phpize
Configuring for:
PHP Api Version: 20100412
Zend Mole Api No: 20100525
Zend Extension Api No: 220100525
Enable internal debugging in APC [no] : <– 回车
Enable per request file info about files used from the APC cache [no] : <– 回车
Enable spin locks (EXPERIMENTAL) [no] : <– 回车
Enable memory protection (EXPERIMENTAL) [no] : <– 回车
Enable pthread mutexes (default) [no] : <–回车
Enable pthread read/write locks (EXPERIMENTAL) [yes] : <– 回车
building in /var/tmp/pear-build-rootVrjsuq/APC-3.1.13
……
然后打开 /etc/php.ini 并设置 cgi.fix_pathinfo=0:
vi /etc/php.ini
[...]
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://www.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
cgi.fix_pathinfo=0
[...]

并添加行:
[...]
extension=apc.so

在 /etc/php.ini 文件后面。
除此之外,为了避免这样的时区的错误:
[21-July-2014 10:07:08] PHP Warning: phpinfo(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Europe/Berlin’ for ‘CEST/2.0/DST’ instead in /usr/share/nginx/html/info.php on line 2
… in /var/log/php-fpm/www-error.log 当你在浏览器中调用一个PHP脚本,你应该设置 date.timezone in /etc/php.ini:
[...]
[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = "Europe/Berlin"
[...]

您可以通过运行正确的时区支持您的系统:
cat /etc/sysconfig/clock
[root@server1 nginx]# cat /etc/sysconfig/clock
ZONE=”Europe/Berlin”
[root@server1 nginx]#
接下来,创建系统启动链接的PHP-FPM并启动它:
systemctl enable php-fpm.service
systemctl start php-fpm.service
PHP-FPM是一个守护进程(使用init脚本/etc/init.d/php-fpm) 运行在端口9000的FastCGI服务器。

Ⅷ CentOS 7 用户怎样安装 LNMP

您可以选择使用下载版(推荐国外或者美国VPS使用)或者完整版(推荐国内VPS使用),两者没什么区别,只是完整版把一些需要的源码文件预先放到安装包里。
安装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.shlnmp

默认安装lnmp可不写,如需要安装LNMPA或LAMP,将./install.sh 后面的参数替换为lnmpa或lamp即可。
如下载速度慢请更换其他下载节点,详情请看下载页面。LNMP下载节点具体替换方法。
按上述命令执行后,会出现如下提示:
需要设置MySQL的root密码(不输入直接回车将会设置为root)如果输入有错误需要删除时,可以按住Ctrl再按Backspace键进行删除。输入后回车进入下一步,如下图所示:
问是否需要启用MySQL InnoDB,InnoDB引擎默认为开启,一般建议开启,直接回车或输入 y ,如果确定确实不需要该引擎可以输入 n,输入完成,回车进入下一步
选择MySQL版本,目前提供了较多版本的MySQL和MariaDB,需要注意的是MySQL 5.6,5.7及MariaDB 10必须在1G以上内存的更高配置上才能选择:
输入对应MySQL或MariaDB版本前面的序号,回车进入下一步,选择PHP版本:
注意:选择PHP7等高版本时需要自行确认是否与自己的程序兼容。
输入要选择的PHP版本的序号,回车进入下一步,选择是否安装内存优化:
可以选择不安装、Jemalloc或TCmalloc,输入对应序号回车,直接回车为默认为不安装。
如果是LNMPA或LAMP的话还会提示“Please enter Administrator Email Address:”,需要设置管理员邮箱,该邮箱会在报错时显示在错误页面上。
再选择Apache版本
按提示输入对应版本前面的数字序号,回车。
提示"Press any key to install...or Press Ctrl+c to cancel"后,按回车键确认开始安装。
LNMP脚本就会自动安装编译Nginx、MySQL、PHP、phpMyAdmin、Zend Optimizer这几个软件。
安装时间可能会几十分钟到几个小时不等,主要是机器的配置网速等原因会造成影响。

热点内容
phpapache伪静态 发布:2024-09-20 20:54:45 浏览:588
新浪云缓存 发布:2024-09-20 20:53:45 浏览:286
怎么上传学历 发布:2024-09-20 20:53:42 浏览:848
华为至尊平板电脑是什么配置 发布:2024-09-20 20:47:47 浏览:293
shell脚本字符串查找 发布:2024-09-20 20:47:44 浏览:274
如何在服务器上搭建linux系统 发布:2024-09-20 20:43:32 浏览:386
上传汽车保单 发布:2024-09-20 20:30:46 浏览:436
樱花服务器测试ip 发布:2024-09-20 20:10:39 浏览:280
炉石传说安卓怎么玩 发布:2024-09-20 20:09:59 浏览:313
ios开会员为什么比安卓贵 发布:2024-09-20 20:09:55 浏览:569