1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
| [root@localhost ~] [root@localhost ~]
[root@localhost ~] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] still could not bind() [root@localhost ~] [root@localhost ~] [root@localhost ~]
[root@localhost ~] LISTEN 7080 [root@localhost ~] Listen 7443 https Virtual Host 7443 [root@localhost ~] Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. [root@localhost ~] ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Mon 2021-03-22 23:51:26 CST; 9s ago Docs: man:httpd(8) man:apachectl(8) Process: 2124 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 2124 (code=exited, status=1/FAILURE)
Mar 22 23:51:26 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Mar 22 23:51:26 localhost.localdomain httpd[2124]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message Mar 22 23:51:26 localhost.localdomain httpd[2124]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:7080 Mar 22 23:51:26 localhost.localdomain httpd[2124]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:7080 Mar 22 23:51:26 localhost.localdomain httpd[2124]: no listening sockets available, shutting down Mar 22 23:51:26 localhost.localdomain httpd[2124]: AH00015: Unable to open logs Mar 22 23:51:26 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE Mar 22 23:51:26 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. Mar 22 23:51:26 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. Mar 22 23:51:26 localhost.localdomain systemd[1]: httpd.service failed. [root@localhost ~]# semanage port -l | grep http http_cache_port_t tcp 8080, 8118, 8123, 10001-10010 http_cache_port_t udp 3130 http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t tcp 5988 pegasus_https_port_t tcp 5989 [root@localhost ~]# semanage port -a -t http_port_t -p tcp 7080 [root@localhost ~]# semanage port -a -t http_port_t -p tcp 7443 [root@localhost ~]# semanage port -l | grep http http_cache_port_t tcp 8080, 8118, 8123, 10001-10010 http_cache_port_t udp 3130 http_port_t tcp 7443, 7080, 80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t tcp 5988 pegasus_https_port_t tcp 5989 [root@localhost ~]# systemctl restart httpd [root@localhost ~]# firewall-cmd --list-ports 80/tcp 443/tcp 3306/tcp 8080/tcp [root@localhost ~]# firewall-cmd --zone=public --add-port=7080/tcp --permanent success [root@localhost ~]# firewall-cmd --zone=public --add-port=7443/tcp --permanent success [root@localhost ~]# firewall-cmd --reload success [root@localhost ~]# cd /etc/nginx/ [root@localhost nginx]# ls conf.d koi-utf scgi_params default.d koi-win scgi_params.default fastcgi.conf mime.types uwsgi_params fastcgi.conf.default mime.types.default uwsgi_params.default fastcgi_params nginx.conf win-utf fastcgi_params.default nginx.conf.default [root@localhost ~]# vim nginx.conf #add the following upstream backend_jenkins{ server 127.0.0.1:8080; }
upstream backend_apache{ server 127.0.0.1:7080; } # change the server_name as 'server_name www.linuxserver.com linuxserver.com;' # add the following locations location / { proxy_pass http://backend-apache; }
location /{ proxy_pass http://backend-jenkins; } [root@localhost nginx]# systemctl restart nginx # after jenkins restart, it is easier to access your jenkins page
# then go to your os's hosts config file add the following 192.168.0.120 www.linuxserver.com linuxserver.com
[root@localhost nginx]
server { listen 443 ssl http2 default_server; listen [::]:443 ssl http2 default_server; server_name _; root /usr/share/nginx/html;
ssl_certificate "/etc/pki/nginx/server.crt"; ssl_certificate_key "/etc/pki/nginx/private/server.key"; ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on;
include /etc/nginx/default.d/*.conf;
location / { }
error_page 404 /404.html; location = /404.html { }
error_page 500 502 503 504 /50x.html; location = /50x.html { } [root@localhost nginx] [root@localhost nginx] [root@localhost pki] cp: overwrite ‘/etc/httpd/pki/server.key’? y
ssl_certificate "/etc/nginx/pki/server.crt"; ssl_certificate_key "/etc/nginx/pki/server.key";
location/ { location / { proxy_pass http://backend-apache; }
location /{ proxy_pass http://backend-jenkins; } }
include /etc/nginx/default.d/*.conf;
return 301 https://$host$request_uri; [root@localhost nginx]
|