运维开发网
广告位招商联系QQ:123077622
 
广告位招商联系QQ:123077622

安装atnmp

运维开发网 https://www.qedev.com 2021-04-12 20:48 出处:51CTO 作者:化身天使
1.下载源码$cd/usr/local/srcmariadb10.5.9nginx1.18php7.4.16tomcat9.044httpd-2.4.46apr-util-1.6.1apr-1.7.02.安装2.1httpaprcd/usr/local/src/apr1.7.0;./configure--prefix=/usr/local/aprmake&&makeinstalla

1.下载源码

$cd /usr/local/src

mariadb10.5.9

nginx1.18

php7.4.16

tomcat9.044

httpd-2.4.46 apr-util-1.6.1 apr-1.7.0

2.安装

2.1 http

apr

cd /usr/local/src/apr1.7.0;

./configure --prefix=/usr/local/apr

make && make install

apr-util

sudo yum install expat-devel -y

cd /usr/local/src/apr-util-1.6.1/

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make && make install

httpd

sudo yum install pcre-devel -y

sudo yum install openssl-devel -y

sudo yum install libxml2-devel -y

cd /usr/local/src/httpd-2.4.46

./configure --prefix=/usr/local/apache --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

make && make install

2.2mariadb

sudo yum install ncurses-devel -y

sudo yum install gcc-c++ -y

sudo yum install libcurl-devel -y

sudo yum install bison-devel -y

sudo yum install boost-devel -y

sudo useradd maria

cd /usr/local/src/mariadb-10.5.9

cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DMYSQL_DATADIR=/data/mariadb -DSYSCONFDIR=/etc -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL-INFILE=1 -DWITH_EXTRA_CHARSETS=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BIG_TABLES=1 -DWITH_DEBUG=0

make && make install

cd /usr/local/mariadb

cp support-files/my-large"or"small.cn /etc/my.cnf #根据内存大小选择large或small

cp support-files/mysql.server /etc/init.d/mariadb

chkconfig --add mariadbd

chkconfig --level 35 mariadbd on

./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb/ --basedir=/usr/local/mariadb

ln -s /usr/local/mariadb/bin/* /usr/bin

#启动脚本位置/etc/init.d/mariadb , 启动脚本中指定配置文件位置,选项conf=/配置文件路径

3.nginx

sudo yum install pcre-devel -y

sudo yum install openssl-devel -y

sudo useradd www

cd /usr/local/src/nginx-1.18.0

./configure --prefix=/usr/local/nginx --user=www --with-http_stub_status_module --with-http_ssl_module

make && make install

/usr/local/nginx/sbin/nginx

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

#报错,非root不可使用 1024以内的端口。1.以root身份启动,或2.修改nginx默认端口,再做端口转发, iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 7070

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消