当前位置: 首页 > news >正文

dwcs3做网站网络站点推广的方法

dwcs3做网站,网络站点推广的方法,个人微信支付宝做购物网站,域名历史记录查询源码部署lamt架构 lamt由apache,mysql,tomcat三者组成 文章目录 源码部署lamt架构1.准备工作1.1.配置yum源,关闭防火墙和selinux1.2.拉取相应源码包 2.安装apache3.安装mariadb4.安装tomcat 1.准备工作 1.1.配置yum源,关闭防火墙…

源码部署lamt架构

lamt由apache,mysql,tomcat三者组成

文章目录

  • 源码部署lamt架构
    • 1.准备工作
      • 1.1.配置yum源,关闭防火墙和selinux
      • 1.2.拉取相应源码包
    • 2.安装apache
    • 3.安装mariadb
    • 4.安装tomcat

1.准备工作

1.1.配置yum源,关闭防火墙和selinux

[root@tomcat ~]# rm -rf /etc/yum.repos.d/*
[root@tomcat ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100  2495  100  2495    0     0   2231      0  0:00:01  0:00:01 --:--:--  2231
[root@tomcat ~]# cat > /etc/yum.repos.d/server.repo << eof
> [Everything]
> name=everything
> baseurl=https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/
> enabled=1
> gpgcheck=0
> 
> [good]
> name=good
> baseurl=http://rpms.remirepo.net/enterprise/8/remi/x86_64/
> enabled=1
> gpgcheck=0
> eof
[root@tomcat ~]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
12 files removed
[root@tomcat ~]# yum makecache//关闭防火墙和selinux
[root@note1 ~]# systemctl disable --now firewalld.service 
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@note1 ~]# setenforce 0

1.2.拉取相应源码包

[root@tomcat ~]# yum -y install wget vim
省略 . . .
[root@tomcat ~]# wget https://downloads.apache.org/apr/apr-1.7.4.tar.gz
[root@tomcat ~]# wget https://downloads.apache.org/apr/apr-util-1.6.3.tar.gz
[root@tomcat ~]# wget https://downloads.apache.org/httpd/httpd-2.4.57.tar.gz
[root@tomcat ~]# ls
anaconda-ks.cfg  apache-tomcat-9.0.80.tar.gz  apr-1.7.4.tar.gz  apr-util-1.6.3.tar.gz  httpd-2.4.57.tar.gz

2.安装apache

//安装依赖包
[root@tomcat ~]# yum -y install gcc gcc-c++ make pcre-devel openssl openssl-devel libtool expat-devel bzip2
省略 . . . //安装开发工具包
[root@tomcat ~]# yum groups mark install 'Development Tools'//创建apache服务的用户和组
[root@tomcat ~]# groupadd -r apache
[root@tomcat ~]# useradd -r -M -s /sbin/nologin -g apache apache//解压源码包
[root@tomcat ~]# tar xf apr-1.7.4.tar.gz -C /usr/local/
[root@tomcat ~]# tar xf apr-util-1.6.3.tar.gz -C /usr/local/
[root@tomcat ~]# tar xf httpd-2.4.57.tar.gz -C /usr/local/
[root@tomcat ~]# cd /usr/local/ && ls
apr-1.7.4  apr-util-1.6.3  bin  etc  games  httpd-2.4.57  include  lib  lib64  libexec  sbin  share  src//进入apr的源码包目录,在configure定制组件中修改相关信息
[root@tomcat local]# cd apr-1.7.4/
[root@tomcat apr-1.7.4]# ls
apr-config.in  atomic            config.layout  file_io     LICENSE       network_io     README.cmake  time
apr.dep        build             configure      helpers     locks         NOTICE         shmem         tools
apr.dsp        build.conf        configure.in   include     Makefile.in   NWGNUmakefile  strings       user
apr.dsw        buildconf         docs           libapr.dep  Makefile.win  passwd         support
apr.mak        build-outputs.mk  dso            libapr.dsp  memory        poll           tables
apr.pc.in      CHANGES           emacs-mode     libapr.mak  misc          random         test
apr.spec       CMakeLists.txt    encoding       libapr.rc   mmap          README         threadproc
[root@tomcat apr-1.7.4]# sed -i '/$RM "$cfgfile"/ # $RM "$cfgfile"/g' configure
sed: -e expression #1, char 18: comments don't accept any addresses
[root@tomcat apr-1.7.4]# sed -i 's/$RM "$cfgfile"/ # $RM "$cfgfile"/g' configure
[root@tomcat apr-1.7.4]# grep -C2 '# $RM "$cfgfile"' configurecfgfile=${ofile}Ttrap "$RM \"$cfgfile\"; exit 1" 1 2 15# $RM "$cfgfile"cat <<_LT_EOF >> "$cfgfile"
[root@tomcat apr-1.7.4]#//编译安装apr-1.7.4、apr-util-1.6.3、httpd-2.4.57
[root@tomcat apr-1.7.4]# ./configure --prefix=/usr/local/apr
[root@tomcat apr-1.7.4]# make && make install[root@tomcat apr-1.7.4]# cd ../apr-util-1.6.3/
[root@tomcat apr-util-1.6.3]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@tomcat apr-util-1.6.3]# make && make install[root@tomcat apr-util-1.6.3]# cd ../httpd-2.4.57/
[root@tomcat httpd-2.4.57]# ./configure --prefix=/usr/local/apache \--enable-so \--enable-ssl \--enable-cgi \--enable-rewrite \--with-zlib \--with-pcre \--with-apr=/usr/local/apr \--with-apr-util=/usr/local/apr-util/ \--enable-modules=most \--enable-mpms-shared=all \--with-mpm=prefork
[root@tomcat httpd-2.4.57]# make && make install//安装后配置
[root@tomcat httpd-2.4.57]# echo 'export PATH=/usr/local/apache/bin:$PATH' > /etc/profile.d/apache.sh
[root@tomcat httpd-2.4.57]# source /etc/profile.d/apache.sh
[root@tomcat httpd-2.4.57]# ln -s /usr/local/apache/include/ /usr/include/httpd
[root@tomcat httpd-2.4.57]# echo 'MANPATH /usr/local/apache/man' >> /etc/man.config//取消ServerName前面的注释
[root@tomcat httpd-2.4.57]# sed -i '/#ServerName/s/#//g' /usr/local/apache/conf/httpd.conf//启动httpd服务
[root@tomcat httpd-2.4.57]# apachectl start
[root@tomcat httpd-2.4.57]# ss -antl
State          Recv-Q         Send-Q                   Local Address:Port                   Peer Address:Port         
LISTEN         0              128                            0.0.0.0:22                          0.0.0.0:*            
LISTEN         0              128                               [::]:22                             [::]:*            
LISTEN         0              128                                  *:80                                *:*

访问apache页面
在这里插入图片描述

3.安装mariadb

使用yum命令安装mariadb

[root@tomcat ~]# yum -y install mariadb mariadb-server
[root@tomcat ~]# systemctl enable --now mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@note1 ~]# mysql -e "set password = password('12345678');"//查看端口
[root@tomcat ~]# ss -antl
State          Recv-Q         Send-Q                   Local Address:Port                   Peer Address:Port         
LISTEN         0              128                            0.0.0.0:22                          0.0.0.0:*            
LISTEN         0              128                               [::]:22                             [::]:*            
LISTEN         0              80                                   *:3306                              *:*            
LISTEN         0              128                                  *:80                                *:*

4.安装tomcat

//安装依赖包
[root@tomcat ~]# dnf -y install java-17-openjdk java-17-openjdk-devel//查看安装的版本,能够查看到版本则说明安装成功
[root@tomcat ~]# java --version
openjdk 17.0.1 2021-10-19 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing)//解压源码包至指定目录
[root@tomcat ~]# tar xf apache-tomcat-9.0.80.tar.gz -C /usr/local/
[root@tomcat ~]# cd /usr/local/ && ls
apache                apr        apr-util        bin  games         include  lib64    sbin   src
apache-tomcat-9.0.80  apr-1.7.4  apr-util-1.6.3  etc  httpd-2.4.57  lib      libexec  share//设置tomcat软链接,方便后续如果更换tomcat版本后也能直接使用
[root@tomcat local]# ln -s apache-tomcat-9.0.80 tomcat
[root@tomcat local]# ll 
total 12
drwxr-xr-x. 14 root root   164 Oct 10 23:52 apache
drwxr-xr-x.  9 root root   220 Oct 11 00:07 apache-tomcat-9.0.80
drwxr-xr-x.  6 root root    58 Oct 10 23:45 apr
drwxr-xr-x. 29  501 games 4096 Oct 10 23:45 apr-1.7.4
drwxr-xr-x.  5 root root    43 Oct 10 23:46 apr-util
drwxr-xr-x. 21  501 games 4096 Oct 10 23:46 apr-util-1.6.3
drwxr-xr-x.  2 root root     6 Aug 12  2018 bin
drwxr-xr-x.  2 root root     6 Aug 12  2018 etc
drwxr-xr-x.  2 root root     6 Aug 12  2018 games
drwxr-xr-x. 14  501 games 4096 Oct 10 23:51 httpd-2.4.57
drwxr-xr-x.  2 root root     6 Aug 12  2018 include
drwxr-xr-x.  2 root root     6 Aug 12  2018 lib
drwxr-xr-x.  2 root root     6 Aug 12  2018 lib64
drwxr-xr-x.  2 root root     6 Aug 12  2018 libexec
drwxr-xr-x.  2 root root     6 Aug 12  2018 sbin
drwxr-xr-x.  5 root root    49 Jul 20 11:24 share
drwxr-xr-x.  2 root root     6 Aug 12  2018 src
lrwxrwxrwx.  1 root root    20 Oct 11 00:08 tomcat -> apache-tomcat-9.0.80//将tomcat的lib位置存放在/etc/ld.so.conf/d/下面,命名一个自身名字的文件,方便查找
[root@tomcat local]# vim /etc/ld.so.conf.d/tomcat.conf
[root@tomcat local]# cat /etc/ld.so.conf.d/tomcat.conf
/usr/local/tomcat/lib//启动服务,使用绝对路径执行/usr/local/tomcat/bin/下面的脚本,tomcat不能写进环境变量,放置后续更改tomcat版本后环境变量仍是之前的tomcat版本
[root@tomcat local]# cd tomcat/bin/
[root@tomcat bin]# ./catalina.sh start
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.
[root@tomcat bin]# ss -antl
State          Recv-Q         Send-Q                      Local Address:Port                 Peer Address:Port        
LISTEN         0              128                               0.0.0.0:22                        0.0.0.0:*           
LISTEN         0              128                                  [::]:22                           [::]:*           
LISTEN         0              1                      [::ffff:127.0.0.1]:8005                            *:*           
LISTEN         0              80                                      *:3306                            *:*           
LISTEN         0              100                                     *:8080                            *:*           
LISTEN         0              128                                     *:80                              *:*

访问tomcat的web页面
在这里插入图片描述

启用httpd的代理模块

[root@tomcat ~]# sed -i '/proxy_module/s/#//g' /usr/local/apache/conf/httpd.conf
[root@tomcat ~]# sed -i '/proxy_fcgi_module/s/#//g' /usr/local/apache/conf/httpd.conf
[root@tomcat ~]# sed -i '/proxy_connect_module/s/#//g' /usr/local/apache/conf/httpd.conf
[root@tomcat ~]# sed -i '/proxy_http_module/s/#//g' /usr/local/apache/conf/httpd.conf

配置虚拟主机

[root@tomcat ~]# vim /usr/local/apache/conf/httpd.conf
[root@tomcat ~]# tail -13 /usr/local/apache/conf/httpd.conf
SSLRandomSeed connect builtin
</IfModule><VirtualHost *:80>DocumentRoot "/usr/local/apache/htdocs"ProxyPass / http://192.168.195.133:8080/ProxyPassReverse / http://192.168.195.133:8080/<Directory "/usr/local/apache/htdocs">Options noneAllowOverride noneRequire all granted</Directory>
</VirtualHost>

重启apache

[root@tomcat ~]# apachectl restart
[root@tomcat ~]# ss -antl
State          Recv-Q         Send-Q                      Local Address:Port                 Peer Address:Port        
LISTEN         0              128                               0.0.0.0:22                        0.0.0.0:*           
LISTEN         0              128                                  [::]:22                           [::]:*           
LISTEN         0              1                      [::ffff:127.0.0.1]:8005                            *:*           
LISTEN         0              80                                      *:3306                            *:*           
LISTEN         0              100                                     *:8080                            *:*           
LISTEN         0              128                                     *:80                              *:*

通过80端口进行访问

在这里插入图片描述

http://www.hkea.cn/news/564532/

相关文章:

  • 公众号做视频网站吗关键词排名怎么做上首页
  • 重庆做网站价格优化软件下载
  • 如何做网站镜像今日最火的新闻
  • 水果网站开发所需的成本市场营销实际案例
  • 无锡市新吴区住房和建设交通局网站西安百度关键词包年
  • 网站平台方案设计seo上首页
  • 郑州做网站的联系方式搜狗友链交换
  • 一般建设一个网站多少钱怎么接广告赚钱
  • 计算机专业网站开发方向销售推广方案
  • 上海网站建设公司排名西安百度公司
  • 中国网网址是多少网站推广优化教程
  • 关于加强机关网站建设运营培训
  • dw做的网站怎么让别人看到如何建立一个网站
  • 保险网站建设优缺点seo代码优化步骤
  • 如何快速建网站百度电脑版入口
  • 山东省建设工程信息网站最近最新的新闻
  • 免费网站建设方案锦绣大地seo官网
  • 电子商务的网站建设牛排seo系统
  • 资源收费网站怎么做网站快速优化排名官网
  • 招标网哪个网站信息可靠百度站长工具网站
  • 郑州七七网站建设互联网推广公司
  • 佛山做外贸网站代理商百度收录技术
  • 公司网站建设需要什么今日热搜第一名
  • 烟台建设企业网站网站快速收录入口
  • 怎么做繁体字网站网络营销公司注册找哪家
  • 做ppt介绍网站吗网站搜索引擎优化工具
  • 深圳网站建设有没有市场百度搜索推广的五大优势
  • 网站建设好的图片百度互联网营销
  • 柳州网站制作公司seo优化什么意思
  • 网站建设做的好的公司淘宝关键词优化怎么弄