Linux系统下安装apache服务器

Linux系统下目前主要有2种方式安装,
一.压缩包安装方式 ,个人觉得这种安装方式比较繁琐,写个简略步骤吧
1、下载httpd-2.4.29.tar.gz
2、上传到服务器/usr/local/software
3、tar -zxvf httpd-2.4.29.tar.gz
./configure --prefix=/usr/local/apache2/ # 设置apache安装目录。
就写这么多吧,比较繁琐。
二.通过yum源安装方式
这是我推荐的安装方式,一个命令就基本搞定了。
1、yum install httpd
2、yum的默认安装位置在:/etc/httpd/conf,cd 到这个目录下,然后修改IP地址,ServerName [你的IP]:8008
监听Port:8008,我用的8008这个端口,这个端口不要随意设置,会报错apache Permission denied: AH00072: make_sock: could not bind to address [::]:8088,在这里坑了个把小时,SELinux only allowed apache/httpd to bind to the following ports:80, 81, 443, 488, 8008, 8009, 8443, 9000
然后:wq保存
3.操作apache
/usr/sbin/apachectl start 启动
/usr/sbin/apachectl stop 停止
/usr/sbin/apachectl restart 重新启动
也可以 systemctl start httpd.service 启动
systemctl stop httpd.service 关闭服务
最后在浏览器上输入IP+端口
看到Apache欢迎页,就成功啦!

你可能感兴趣的:(微信小程序,python,centos,技术文,macos)