编译安装LNMP Centos 6.5 x64(6.6 x64) + Nginx1.6.0 + PHP5.5.13 + Mysql5.6.19

本文涉及的产品
RDS AI 助手,专业版
RDS Agent(兼容OpenClaw),2核4GB
RDS DuckDB + QuickBI 企业套餐,8核32GB + QuickBI 专业版
简介:

环境:

系统硬件:vmware vsphere (CPU:2*4核,内存2G)

系统版本:CentOS-6.5-x86_64-minimal.iso

 

安装步骤:

 

0.虚拟系统安装

0.1 使用VMware 虚拟机进行安装,进行安装界面

(分配内存必须大于1G,否则不会显示图型安装界面,网络设置使用“桥接模式” 即"Bridged"模式)

0.2 选择 Install or upgrade an existing system

0.3 在"Disc found" 框 选择 "skip"

0.4 next 选择 "chinese(simplified)(中文(简介 )) next

0.5 选择 "美国英语式" 下一步

0.6 选择 "基本 存储设备" 下一步

0.7 弹出"警告"框时,选择"重新初始化所有"

0.8 主机名可以保留默认,点击”配置网络“ 弹出“网络连接” 双击“System eth0"

0.9 弹出“正在编辑 System eth0" 选择"自动连接" 点击"应用“ ,点击”关闭“ 关闭”网络连接“框 下一步  

0.10 不要选择“系统时钟使用UTC时间” 下一步

0.11 输入并确认 ”根密码“ 下一步

0.12 选择"替换现有Linux系统 " 下一步 “将修改写入磁盘"

0.13 选择"Basic Server" 下一步

0.14 大概一共200个软件包,复制安装完成后,点击“重新引导”,重新启动计算机

0.15 (安装完成后,可以将虚拟机内存由1G,改为512M)

  

1.系统环境

1.1 更新系统

[root@centos ~]# yum update -y

 

1.2 查看环境

[root@centos ~]# cat /etc/redhat-release

CentOS release 6.5 (Final)

[root@centos ~]# uname -a

Linux zabbix 2.6.32-431.17.1.el6.x86_64 #1 SMP Wed May 7 23:32:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@centos ~]# yum -y install vim wget lsof gcc gcc-c++

  

2.安装Google-perftools (使用tcmalloc 加速 mysql 和 nginx)

2.1下载需要的文件

下载 libunwind-1.1.tar.gz 到 /usr/local/src

下载 gperftools-2.2.tar.gz 到 /usr/local/src

  

2.2 安装libunwind

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf libunwind-1.1.tar.gz

[root@centos ~]# cd libunwind-1.1

[root@centos ~]# ./configure --enable-shared

[root@centos ~]# make && make install

 

2.3 安装google-perftools

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf gperftools-2.2.tar.gz

[root@centos ~]# cd gperftools-2.2

[root@centos ~]# ./configure --enable-shared --enable-frame-pointers

[root@centos ~]# make && make install

 

2.4 更新,使动态链接库能够被系统共享

[root@centos ~]# echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf

[root@centos ~]# ldconfig

 

3.安装mysql

3.1 下载文件

下载 ncurses-5.9.tar.gz到/usr/local/src
下载 bison-3.0.tar.gz到/usr/local/src
下载 cmake-3.0.0.tar.gz到/usr/local/src
下载 mysql-5.6.19.tar.gz到/usr/local/src

  

3.2 安装ncurses

[root@centos ~]# yum install ncurses-devel openssl* -y

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf ncurses-5.9

[root@centos ~]# ./configure

[root@centos ~]# make && make install

 

3.3 安装cmake

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf cmake-3.0.0.tar.gz

[root@centos ~]# cd cmake-3.0.0

[root@centos ~]# ./bootstrap

[root@centos ~]# make && make install

 

3.4 安装bison

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf bison-3.0.tar.gz

[root@centos ~]# cd bison-3.0

[root@centos ~]# ./configure

[root@centos ~]# make && make install

 

3.5 创建mysql需要的目录、配置用户和用户组

[root@centos ~]# groupadd mysql

[root@centos ~]# useradd -g mysql mysql

[root@centos ~]# mkdir -p /data/mysql

[root@centos ~]# chown -R mysql:mysql /data/mysql

  

3.6.安装mysql (需要 cmake ncurses-devel bison 库)

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf mysql-5.6.19.tar.gz

[root@centos ~]# cd mysql-5.6.19

[root@centos ~]#  cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql -DMYSQL_DATADIR=/data/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DSYSCONFDIR=/etc/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=on -DWITH_SSL=yes

[root@centos ~]# make && make install

 

3.7 创建软连接

[root@centos ~]# ln -s /opt/mysql/lib/lib* /usr/lib/

 

3.8配置mysql数据库

[root@centos ~]# cd /opt/mysql

[root@centos ~]# ./scripts/mysql_install_db --basedir=/opt/mysql/ --datadir=/data/mysql/ --user=mysql

 

3.9复制配置文件

3.9.1 (mysql 5.6.19)

[root@centos ~]# cp ./support-files/my-default.cnf /etc/my.cnf

3.9.2 (mysql 5.3.29)

[root@centos ~]# cp ./support-files/my-large.cnf /etc/my.cnf

修改配置文件,设置默认使用utf8编码

[root@centos ~]# vim /etc/my.cnf

在[client]下添加一行

default-character-set = utf8

在[mysqld]下添加一行

character-set-server = utf8

 

3.11 设置mysql开机自动启动服务

[root@centos ~]# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld

[root@centos ~]# chkconfig --add mysqld

[root@centos ~]# chkconfig --level 345 mysqld on

 

3.12 修改服务配置文件

[root@centos ~]# vim /etc/rc.d/init.d/mysqld

根据设定需要,修改mysqld文件中的下面两项

basedir=/opt/mysql

datadir=/data/mysql

 

3.13 启动mysqld服务  

[root@centos ~]# service mysqld start

  

3.14 数据库初始化及修改root密码(root初始密码为空)

[root@centos ~]# ./bin/mysql_secure_installation
根据提示操作

 

3.15 软连接mysql

[root@centos ~]# ln -s /opt/mysql/bin/mysql /bin

 

3.16 重启centos后,尝试用root连接mysql
[root@centos ~]# mysql -u root -p

成功登录后查看状态

status;

  

3.17 使用tcmalloc优化mysql ( 需要安装google-perftools)

[root@centos ~]# vim /opt/mysql/bin/mysqld_safe

在# executing mysqld_safe的下一行,加上:
export LD_PRELOAD=/usr/local/lib/libtcmalloc.so

 

3.18 重启服务,查看tcmalloc是否生效 (第二条命令显示即生效)

[root@centos ~]# service mysqld restart

 

[root@centos ~]# lsof -n | grep tcmalloc

如果显示以下类似的信息,即表示tcmalloc生效

mysqld 30347 mysql mem REG 253,0 2177570 544322 /usr/local/lib/libtcmalloc.so.0.2.2

 

3.18 增加远程访问用户,并且打开防火墙3306端口(不远程连接数据,可省略)

[root@centos ~]# mysql -u root -p

输入密码进行mysql控制台,添加远程访问用户

(root是用户名,%是主机名或IP地址,这里的%代表任意主机或IP地址,也可指定唯一的IP地址;密码是MyPassword )

Mysql [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;

Mysql [(none)]> FLUSH PRIVILEGES;

Mysql [(none)]> exit;

 

[root@centos ~]# iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

[root@centos ~]# /etc/rc.d/init.d/iptables save

[root@centos ~]# /etc/init.d/iptables restart

查看防火墙信息

[root@centos ~]# /etc/init.d/iptables status

如果显示以下类似信息,即表示已经打开了3306端口

1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306

 

4.安装Nginx

4.1.准备安装

下载 pcre-8.35.tar.gz到/usr/local/src

下载 nginx-1.6.0.tar.gz到/usr/local/src

  

4.2 更新包

[root@centos ~]# yum install zlib* openssl* -y

 

4.3 安装Pcre


[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf pcre-8.35.tar.gz

[root@centos ~]# cd pcre-8.35

[root@centos ~]# ./configure

[root@centos ~]# make && make install

 

4.4 创建www用户和组,创建www虚拟主机使用的目录,以及Nginx使用的日志目录,并且赋予他们适当的权限

[root@centos ~]# groupadd www

[root@centos ~]# useradd -g www www

[root@centos ~]# mkdir -p /data/www

[root@centos ~]# chmod +w /data/www

[root@centos ~]# chown -R www:www /data/www

为tcmalloc添加目录,并且赋予适当权限

[root@centos ~]# mkdir -p /tmp/tcmalloc/

[root@centos ~]# chown -R www:www /tmp/tcmalloc/

 

4.5 安装Nginx (需要 pcre google-perftools 库)  

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf nginx-1.6.0.tar.gz

 

伪装服务器信息(可以不修改)

[root@centos ~]# cd nginx-1.6.0/src/core

[root@centos ~]# vim ./src/core/nginx.h

修改NGINX_VERSION为你希望显示的版号

修改NGINX_VER为你希望显示的名称

修改NGINX_VAR 为你希望显示的名称

保存

  

开始安装NGINX

[root@centos ~]# ./configure --user=www --group=www --prefix=/opt/nginx --with-http_stub_status_module --with-http_ssl_module --with-google_perftools_module

[root@centos ~]# make && make install

 

4.6 修改 nginx.conf ,令nginx可以 google-perftools实现加速

[root@centos ~]# vim /opt/nginx/conf/nginx.conf

修改前面几行为:

user www www;
worker_processes 8;
error_log logs/error.log crit;
pid logs/nginx.pid;
google_perftools_profiles /tmp/tcmalloc/;
events{
use epoll;
worker_connections 65535;
}

 

4.7 测试和运行

[root@centos ~]# cd /opt/nginx

[root@centos ~]# ldconfig

[root@centos ~]# ./sbin/nginx -t

如果显示下面信息,即表示配置没问题

nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful

 

输入代码运行nginx服务

[root@centos ~]# ./sbin/nginx 

[root@centos ~]# ps au|grep nginx

如果显以类似下面的信息,即表示nginx已经启动

root 2013 0.0 0.0 103156 856 pts/0 S+ 03:22 0:00 grep nginx

  

输入代码检测是否支持加速

[root@centos ~]# lsof -n | grep tcmalloc

如果显示类似下面的信息,即表示支持tcmalloc加速 (mysqld和nginx两个线程都支持)

mysqld 20818 mysql mem REG 253,0 2177570 281050    /usr/local/lib/libtcmalloc.so.0.2.2

nginx 29454 www 25w REG 253,0 0 288399 /tmp/tcmalloc/.29454

nginx 29455 www 27w REG 253,0 0 288403 /tmp/tcmalloc/.29455

 

4.8 打开防火墙80端口

写入规则,保存并重启服务

[root@centos ~]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT

[root@centos ~]# /etc/rc.d/init.d/iptables save

[root@centos ~]# /etc/init.d/iptables restart

查看防火墙信息

[root@centos ~]# /etc/init.d/iptables status

如果显示以下类似信息,即表示已经打开了80端口

1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80

 

4.9 编写nginx 启动服务

[root@centos ~]# vim /etc/init.d/nginx

输入以下代码并保存

 

#!/bin/sh 

# nginx - this script starts and stops the nginx daemon 

# chkconfig: - 85 15 
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ 
# proxy and IMAP/POP3 proxy server 
# processname: nginx 
# config: /etc/nginx/nginx.conf 
# config: /etc/sysconfig/nginx 
# pidfile: /var/run/nginx.pid

# Source function library. 
. /etc/rc.d/init.d/functions

# Source networking configuration. 
. /etc/sysconfig/network

# Check that networking is up. 
[ "$NETWORKING" = "no" ] && exit 0

nginx="/opt/nginx/sbin/nginx" 
prog=$(basename $nginx)

NGINX_CONF_FILE="/opt/nginx/conf/nginx.conf"

[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

lockfile=/var/lock/subsys/nginx

start() { 
[ -x $nginx ] || exit 5 
[ -f $NGINX_CONF_FILE ] || exit 6 
echo -n $"Starting $prog: " 
daemon $nginx -c $NGINX_CONF_FILE 
retval=$? 
echo 
[ $retval -eq 0 ] && touch $lockfile 
return $retval 
}

stop() { 
echo -n $"Stopping $prog: " 
killproc $prog -QUIT 
retval=$? 
echo 
[ $retval -eq 0 ] && rm -f $lockfile 
return $retval 
killall -9 nginx 
}

restart() { 
configtest || return $? 
stop 
sleep 1 
start 
}

reload() { 
configtest || return $? 
echo -n $"Reloading $prog: " 
killproc $nginx -HUP 
RETVAL=$? 
echo 
}

force_reload() { 
restart 
}

configtest() { 
$nginx -t -c $NGINX_CONF_FILE 
}

rh_status() { 
status $prog 
}

rh_status_q() { 
rh_status >/dev/null 2>&1 
}

case "$1" in 
start) 
rh_status_q && exit 0 
$1 
;; 
stop) 
rh_status_q || exit 0 
$1 
;; 
restart|configtest) 
$1 
;; 
reload) 
rh_status_q || exit 7 
$1 
;; 
force-reload) 
force_reload 
;; 
status) 
rh_status 
;; 
condrestart|try-restart) 
rh_status_q || exit 0 
;; 
*) 
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" 
exit 2 
esac

 

保存后,设置权限,并添加到启动服务列表中

[root@centos ~]# chmod 755 /etc/init.d/nginx

[root@centos ~]# chkconfig --add nginx

[root@centos ~]# chkconfig --level 345 nginx on

[root@centos ~]# service nginx start

 

5 安装PHP

5.1 准备安装

下载php-5.5.13.tar.gz到/usr/local/src
下载 libiconv-1.14.tar.gz到/usr/local/src
下载 libmcrypt-2.5.8.tar.gz到/usr/local/src
下载mcrypt-2.6.8.tar.gz到/usr/local/src
下载mhash-0.9.9.9.tar.gz到/usr/local/src

更新依赖

yum -y install autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* gcc gcc-c++


5.2 安装libiconv (加强系统对支持字符编码转换的功能)

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf libiconv-1.14.tar.gz

[root@centos ~]# cd libiconv-1.14

[root@centos ~]# ./configure --prefix=/usr/local

[root@centos ~]# make && make install

 

5.3 安装libmcrypt(加密算法库,PHP扩展mcrypt功能对此库有依耐关系,要使用mcrypt必须先安装此库)

5.3.1 安装libmcrypt

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf libmcrypt-2.5.8.tar.gz

[root@centos ~]# cd libmcrypt-2.5.8

[root@centos ~]# ./configure

[root@centos ~]# make && make install

5.3.2安装libltdl(6.6 x64自带不用装)

[root@centos ~]# cd libltdl/

[root@centos ~]# ./configure --enable-ltdl-install

[root@centos ~]# make && make install

5.3.3 更新共享

[root@centos ~]# ln -sf /usr/local/lib/libmcrypt.* /usr/lib64/

[root@centos ~]# ln -sf /usr/local/bin/libmcrypt-config /usr/lib64/

[root@centos ~]# ln -sf /usr/local/lib/libiconv.so.2 /usr/lib64/

[root@centos ~]# ldconfig

5.4 安装mhash(hash加密算法库)

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf mhash-0.9.9.9.tar.gz

[root@centos ~]# cd mhash-0.9.9.9

[root@centos ~]# ./configure

[root@centos ~]# make && make install

更新共享

[root@centos ~]# ln -sf /usr/local/lib/libmhash.* /usr/lib64/

[root@centos ~]# ldconfig

 

5.5 安装mcrypt

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf mcrypt-2.6.8.tar.gz

[root@centos ~]# cd mcrypt-2.6.8

[root@centos ~]# ./configure

[root@centos ~]# make && make install


5.6 安装php

5.6.1 创建mysql软连接、ldap软连接

[root@centos ~]# mkdir -p /opt/mysql/include/mysql

[root@centos ~]# ln -s /opt/mysql/include/* /opt/mysql/include/mysql/

[root@centos ~]# ln -s /usr/lib64/libldap* /usr/lib

 

5.6.2 安装

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf php-5.5.13.tar.gz

[root@centos ~]# cd php-5.5.13

[root@centos ~]# ./configure --prefix=/opt/php --with-config-file-path=/opt/php/etc --with-mysql=/opt/mysql --with-mysqli=/opt/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --disable-safe-mode --with-curlwrappers 

[root@centos ~]# make ZEND_EXTRA_LIBS='-liconv'

[root@centos ~]# make && make install

 

5.6.3 复制配置文件

[root@centos ~]# cp php.ini-production /opt/php/etc/php.ini

 

5.6.4 安装memcache扩展(已经安装PHP)

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf memcache-3.0.6.tar.gz

[root@centos ~]# cd memcache-3.0.6

[root@centos ~]# /opt/php/bin/phpize

[root@centos ~]# ldconfig

[root@centos ~]# ./configure --with-php-config=/opt/php/bin/php-config

[root@centos ~]# make && make install

 

修改php配置文件,支持memcache

[root@centos ~]# vim /opt/php/etc/php.ini

在文件中搜索extension_dir、extension ,在相应位置添加下面两行
extension_dir = "/opt/php/lib/php/extensions/no-debug-non-zts-20121212/"
extension = "memcache.so"

 

5.6.5 安装ZendOpcache扩展(已经安装php)

[root@centos ~]# cd /usr/local/src/

[root@centos ~]# tar zvxf zendopcache-7.0.3.tgz

[root@centos ~]# cd zendopcache-7.0.3

[root@centos ~]# /opt/php/bin/phpize

[root@centos ~]# ./configure --with-php-config=/opt/php/bin/php-config

[root@centos ~]# make && make install

 

修改php配置文件,支持ZendOpcache

[root@centos ~]# vim /opt/php/etc/php.ini

在文件尾加入以下代码

zend_extension=/opt/php/lib/php/extensions/no-debug-non-zts-20121212/opcache.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

 

5.6.5 安装php-fpm

[root@centos ~]# cp /opt/php/etc/php-fpm.conf.default /opt/php/etc/php-fpm.conf

[root@centos ~]# vim /opt/php/etc/php-fpm.conf

修改以下地方

[global]
pid = run/php-fpm.pid-p
error_log = log/php-fpm.log
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 5s
pm.max_children = 35
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35

[www]
user = www
group = www


5.6.6 修改nginx,支持php

[root@centos ~]# vim /opt/nginx/conf/nginx.conf

找到并修改以下代码

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;
include fastcgi_params;
}

5.6.7将php-fpm 作为服务运行

[root@centos ~]# cd /usr/local/src/php-5.5.13

[root@centos ~]# cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

[root@centos ~]# chmod 700 /etc/init.d/php-fpm

[root@centos ~]# chkconfig --add php-fpm

[root@centos ~]# chkconfig --level 345 php-fpm on

    
服务方式启动php-fpm

[root@centos ~]# service php-fpm restart

 

5.6.8 编写测试页面

[root@centos ~]# vim /data/www/index.php

[root@centos ~]# chown -R www:www /data/www

输入代码

<html>
<head><title>hello php</title></head>
<body>
<?php phpinfo();?>
</body>
</html>


5.6.8 打开浏览器进行测试

[root@centos ~]# service nginx restart

[root@centos ~]# service php-fpm restart

[root@centos ~]# curl http://localhost/index.html

[root@centos ~]# curl http://localhost/index.php






本文转自 vfast_chenxy 51CTO博客,原文链接:http://blog.51cto.com/chenxy/1621658,如需转载请自行联系原作者
相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
目录
相关文章
|
应用服务中间件 Linux 网络安全
Centos 8.0中Nginx配置文件和https正书添加配置
这是一份Nginx配置文件,包含HTTP与HTTPS服务设置。主要功能如下:1) 将HTTP(80端口)请求重定向至HTTPS(443端口),增强安全性;2) 配置SSL证书,支持TLSv1.1至TLSv1.3协议;3) 使用uWSGI与后端应用通信(如Django);4) 静态文件托管路径设为`/root/code/static/`;5) 定制错误页面(404、50x)。适用于Web应用部署场景。
1065 87
|
Ubuntu 网络协议 应用服务中间件
在 Ubuntu 上安装 Nginx
在 Ubuntu 上安装和配置 Nginx 非常简单。首先更新系统包,然后通过 `apt` 安装 Nginx,检查服务状态并配置防火墙规则。访问服务器 IP 测试是否成功显示默认页面。还可管理服务、创建虚拟主机及排查常见问题,适合新手快速上手部署高性能 Web 服务。
1437 0
|
应用服务中间件 Linux 网络安全
技术指南:如何把docsify项目部署到基于CentOS系统的Nginx中。
总结 与其他部署方法相比,将docsify项目部署到基于CentOS系统的Nginx中比较简单。以上步骤应当帮助你在不花费太多时间的情况下,将你的项目顺利部署到Nginx中。迈出第一步,开始部署你的docsify项目吧!
472 14
|
前端开发 应用服务中间件 nginx
docker安装nginx,前端项目运行
通过上述步骤,你可以轻松地在Docker中部署Nginx并运行前端项目。这种方法不仅简化了部署流程,还确保了环境的一致性,提高了开发和运维的效率。确保按步骤操作,并根据项目的具体需求进行相应的配置调整。
1546 25
|
负载均衡 Ubuntu 应用服务中间件
nginx修改网站默认根目录及发布(linux、centos、ubuntu)openEuler软件源repo站点
通过合理配置 Nginx,我们可以高效地管理和发布软件源,为用户提供稳定可靠的服务。
2126 13
|
负载均衡 应用服务中间件 Linux
nginx学习,看这一篇就够了:下载、安装。使用:正向代理、反向代理、负载均衡。常用命令和配置文件,很全
这篇博客文章详细介绍了Nginx的下载、安装、配置以及使用,包括正向代理、反向代理、负载均衡、动静分离等高级功能,并通过具体实例讲解了如何进行配置。
770 5
nginx学习,看这一篇就够了:下载、安装。使用:正向代理、反向代理、负载均衡。常用命令和配置文件,很全
|
应用服务中间件 网络安全 nginx
轻松上手Nginx Proxy Manager:安装、配置与实战
Nginx Proxy Manager (NPM) 是一款基于 Nginx 的反向代理管理工具,提供直观的 Web 界面,方便用户配置和管理反向代理、SSL 证书等。本文档介绍了 NPM 的安装步骤,包括 Docker 和 Docker Compose 的安装、Docker Compose 文件的创建与配置、启动服务、访问 Web 管理界面、基本使用方法以及如何申请和配置 SSL 证书,帮助用户快速上手 NPM。
15078 1
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。通过具体案例,读者可以了解如何准备环境、下载源码、编译安装、配置服务及登录 MySQL。编译源码安装虽然复杂,但提供了更高的定制性和灵活性,适用于需要高度定制的场景。
820 3
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。
本文介绍了在 CentOS 7 中通过编译源码安装 MySQL 数据库的详细步骤,并与使用 RPM 包安装进行了对比。内容涵盖准备工作、下载源码、编译安装、配置服务、登录设置及实践心得,帮助读者根据需求选择最适合的安装方法。
651 2
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤
【10月更文挑战第7天】本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据自身需求选择合适的方法。
616 3