80端口无法打开 linux
2016-01-26 17:16:00 weixin_34007020 阅读数 1

linux打开80端口
天客户那边有台服务器同一个局域网中都无法访问,排除lamp环境问题,发现时服务器中的防火墙没有开启80端口。

 

代码如下 复制代码
vi /etc/sysconfig/iptables
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT(允许80端口通过防火墙)
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT(允许3306端口通过防火墙)

 

按照这种方法测试,发现重启防火墙的时候,回报这两行错误。
[root@localhost ~]# /etc/init.d/iptables restart
iptables:清除防火墙规则: [确定]
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:正在卸载模块: [确定]
iptables:应用防火墙规则:Bad argument `–-state'
Error occurred at line: 11
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[失败]

 

发现这种方法并不好使,于是尝试另外一种,通过命令去添加端口的方法。
代码如下 复制代码
[root@centos httpd]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
[root@centos httpd]# /etc/rc.d/init.d/iptables save
[root@centos httpd]# /etc/init.d/iptables restart
这样就搞定了,查看效果
代码如下 复制代码
[root@centos httpd]# /etc/init.d/iptables status

 

 

Linux下启动apache报错:80端口已占用解决办法

apache启动报错(98)Address already in use: make_sock: could not bind to address [::]:80
# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]
代码如下 复制代码
1.netstat -lnp|grep 80
tcp 0 0 192.168.180.68:61027 0.0.0.0:* LISTEN 6289/oproxyd
tcp 0 0 :::80 :::* LISTEN 846/httpd
tcp 0 0 ::ffff:192.168.180.68:7001 :::* LISTEN 32015/java
找到pid 846
#ps 846
查看
#kill -9 846
杀掉
#./apachectl start
启动成功
*****************************************************************************
处理办法:
代码如下 复制代码
# ps -aux | grep http
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root 12079 0.0 0.0 61164 720 pts/1 S+ 16:06 0:00 grep http
# ps -aux | grep apache
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
apache 10820 0.0 0.0 2044 600 ? Ss Jan01 0:04 bash
root 12081 0.0 0.0 61160 716 pts/1 S+ 16:06 0:00 grep apache
# kill -9 10820
# /etc/init.d/httpd start
Starting httpd: [ OK ]
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]

转载于:https://www.cnblogs.com/notDog/p/5161054.html

2019-05-27 21:36:05 qq_37306041 阅读数 49

开启80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

出现success表明添加成功

命令含义:

--zone #作用域

--add-port=80/tcp  #添加端口,格式为:端口/通讯协议

--permanent   #永久生效,没有此参数重启后失效

重启防火墙

systemctl restart firewalld.service

 

2017-04-10 09:41:38 csdn265 阅读数 19619
80端口常用于WEB服务器了端口了,下面我来介绍linux防火墙打开80端口方法与在增加端口时碰到问题的解决办法,希望此方法对各位朋友有帮助。

linux打开80端口

天客户那边有台服务器同一个局域网中都无法访问,排除lamp环境问题,发现时服务器中的防火墙没有开启80端口。于是去网上搜索了一下,在脚本之家看到一种添加代码的方法

 代码如下 复制代码

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT(允许80端口通过防火墙) 
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT(允许3306端口通过防火墙)

按照这种方法测试,发现重启防火墙的时候,回报这两行错误。

[root@localhost ~]# /etc/init.d/iptables restart 
iptables:清除防火墙规则:                                 [确定]
iptables:将链设置为政策 ACCEPT:filter                    [确定]
iptables:正在卸载模块:                                   [确定]
iptables:应用防火墙规则:Bad argument `–-state'
Error occurred at line: 11
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
                                                           [失败]

发现这种方法并不好使,于是尝试另外一种,通过命令去添加端口的方法。

 代码如下 复制代码

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

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

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

这样就搞定了,查看效果

 代码如下 复制代码

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


Linux下启动apache报错:80端口已占用解决办法


apache启动报错(98)Address already in use: make_sock: could not bind to address [::]:80
# /etc/init.d/httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]

 代码如下 复制代码
1.netstat -lnp|grep 80
tcp        0      0 192.168.180.68:61027        0.0.0.0:*                   LISTEN      6289/oproxyd        
tcp        0      0 :::80                       :::*                        LISTEN      846/httpd           
tcp        0      0 ::ffff:192.168.180.68:7001 :::*                        LISTEN      32015/java         
找到pid 846
#ps 846
查看
#kill -9 846
杀掉
#./apachectl start

启动成功

*****************************************************************************
处理办法:

 代码如下 复制代码
# ps -aux | grep http
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root     12079 0.0 0.0 61164   720 pts/1    S+   16:06   0:00 grep http
# ps -aux | grep apache
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
apache   10820 0.0 0.0   2044   600 ?        Ss   Jan01   0:04 bash
root     12081 0.0 0.0 61160   716 pts/1    S+   16:06   0:00 grep apache
# kill -9 10820
# /etc/init.d/httpd start
Starting httpd:                                            [ OK ]
# /etc/init.d/httpd restart
Stopping httpd:                                            [ OK ]
2018-03-02 13:35:47 yutingzhaomeng 阅读数 1205

打开spyder碰到问题

Traceback (most recent call last):
  File "/home/**/anaconda2/bin/spyder", line 4, in <module>
    import spyder.app.start
  File "/home/**/anaconda2/lib/python2.7/site-packages/spyder/app/start.py", line 14, in <module>
    from spyder.config.main import CONF
  File "/home/**/anaconda2/lib/python2.7/site-packages/spyder/config/main.py", line 596, in <module>
    raw_mode=True)
  File "/home/**/anaconda2/lib/python2.7/site-packages/spyder/config/user.py", line 202, in __init__
    self.load_from_ini()
  File "/home/**/anaconda2/lib/python2.7/site-packages/spyder/config/user.py", line 247, in load_from_ini
    self.readfp(configfile)
  File "/home/**/anaconda2/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/home/**/anaconda2/lib/python2.7/ConfigParser.py", line 546, in _read
    raise e
ConfigParser.ParsingError: File contains parsing errors: /home/**/.config/spyder/spyder.ini
        [line 548]: u'default/wdir/use_fixed_direc'

按照提示,打开spyder.ini文件,文件最后【run】之后,是上次意外关闭spyder时的log,删除即可重新打开spyder。


linux 开放80端口

阅读数 168

Linux开放80端口

阅读数 1380

没有更多推荐了,返回首页