RPM Apache安装与调试

操作命令:

yum -y install httpd*

安装完成之后,(一个软件安装之后)注意三个东西

  1. 服务的脚本位置
  2. 工作区(网站的根目录位置)
  3. 配置文件的位置

如下:

启用httpd.service 命令:

systemctl enable  httpd.service

操作如下:

[root@localhost httpd]# systemctl enable httpd.service
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost httpd]# 

启动httpd.service

systemctl start httpd.service

查看进程: pstree |grep httpd

[root@localhost httpd]# pstree |grep httpd
        |-httpd-+-httpd
        |       |-httpd---80*[{httpd}]
        |       `-2*[httpd---64*[{httpd}]]
[root@localhost httpd]# 

查看80端口:netstat -tunpl

[root@localhost httpd]# netstat -tunpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1971/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1013/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1014/cupsd          
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp6       0      0 :::22                   :::*                    LISTEN      1013/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      1014/cupsd          
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::80                   :::*                    LISTEN      37483/httpd         
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           870/avahi-daemon: r 
udp        0      0 0.0.0.0:50596           0.0.0.0:*                           870/avahi-daemon: r 
udp        0      0 192.168.122.1:53        0.0.0.0:*                           1971/dnsmasq        
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1971/dnsmasq        
udp        0      0 192.168.225.128:68      0.0.0.0:*                           998/NetworkManager  
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd           
udp6       0      0 :::5353                 :::*                                870/avahi-daemon: r 
udp6       0      0 :::111                  :::*                                1/systemd           
udp6       0      0 :::34958                :::*                                870/avahi-daemon: r 
[root@localhost httpd]# 

Add a Comment

电子邮件地址不会被公开。 必填项已用*标注