Alpine issue: curl (7) couldnt connect to server

Watch
manifesting
Badges: 9
Rep:
?
#1
Report Thread starter 1 month ago
#1
trying to connect internal and webserver getting this issue:
curl (7) couldnt connect to server

help?!
0
reply
username5383500
Badges: 18
Rep:
?
#2
Report 1 month ago
#2
(Original post by manifesting)
trying to connect internal and webserver getting this issue:
curl (7) couldnt connect to server

help?!
As explained in your previous thread, we need more details to help troubleshoot this. For some reason, curl cannot connect. Could be a firewall rule getting in the way. Could be the server is not listening properly. Who knows. Without knowing the network you've got setup, we cannot help. This was mentioned last time, and making another thread does not change that.
0
reply
RoyalSheepy
Badges: 20
Rep:
?
#3
Report 1 month ago
#3
(Original post by manifesting)
trying to connect internal and webserver getting this issue:
curl (7) couldnt connect to server

help?!
More info...
0
reply
manifesting
Badges: 9
Rep:
?
#4
Report Thread starter 2 weeks ago
#4
(Original post by AcseI)
As explained in your previous thread, we need more details to help troubleshoot this. For some reason, curl cannot connect. Could be a firewall rule getting in the way. Could be the server is not listening properly. Who knows. Without knowing the network you've got setup, we cannot help. This was mentioned last time, and making another thread does not change that.
what information do you need?
0
reply
manifesting
Badges: 9
Rep:
?
#5
Report Thread starter 2 weeks ago
#5
(Original post by RoyalSheepy)
More info...
could you specify what information you need please
0
reply
manifesting
Badges: 9
Rep:
?
#6
Report Thread starter 2 weeks ago
#6
This is the error:

curl (7): failed to connect to 10.0.2.15 port 80: connection refused
0
reply
username5383500
Badges: 18
Rep:
?
#7
Report 2 weeks ago
#7
(Original post by manifesting)
what information do you need?
At a bare minimum, the full curl command that you are trying to run, the IP address of both the client and server (the machine you're sending the command from and the machine you're trying to curl from), any additional details on the networking involved and details on the web server running on the target.

(Original post by manifesting)
This is the error:

curl (7): failed to connect to 10.0.2.15 port 80: connection refused
Without the above info, this is only a guess. But I'd wager you don't have a webserver running on the target system. Hence you can't curl because there's nothing running to curl from.
0
reply
manifesting
Badges: 9
Rep:
?
#8
Report Thread starter 2 weeks ago
#8
(Original post by AcseI)
At a bare minimum, the full curl command that you are trying to run, the IP address of both the client and server (the machine you're sending the command from and the machine you're trying to curl from), any additional details on the networking involved and details on the web server running on the target.


Without the above info, this is only a guess. But I'd wager you don't have a webserver running on the target system. Hence you can't curl because there's nothing running to curl from.
ermmm the only thing i can understand from that is the command i am running which is:
curl 10.0.2.15

(the 10.0.2.15 is inet address that shows when i type the 'ifconfig' command.

does it help at all?
0
reply
manifesting
Badges: 9
Rep:
?
#9
Report Thread starter 2 weeks ago
#9
the Bcast is

0.0.0.0

does this have any significance?
0
reply
username5383500
Badges: 18
Rep:
?
#10
Report 2 weeks ago
#10
(Original post by manifesting)
ermmm the only thing i can understand from that is the command i am running which is:
curl 10.0.2.15

(the 10.0.2.15 is inet address that shows when i type the 'ifconfig' command.

does it help at all?
So you're running ifconfig on your host, then running curl 10.0.2.15? Effectively, what you're trying to do is use curl to download whatever is stored at 10.0.2.15. Connection refused means your host isn't allowing that connection, most likely because you don't actually have a web server running on your host to connect to. Presumably you were either supposed to start a webserver on your host, or connect to another machine that had a webserver running.

What have you actually been asked to do here?
0
reply
manifesting
Badges: 9
Rep:
?
#11
Report Thread starter 2 weeks ago
#11
(Original post by AcseI)
So you're running ifconfig on your host, then running curl 10.0.2.15? Effectively, what you're trying to do is use curl to download whatever is stored at 10.0.2.15. Connection refused means your host isn't allowing that connection, most likely because you don't actually have a web server running on your host to connect to. Presumably you were either supposed to start a webserver on your host, or connect to another machine that had a webserver running.
been asked to test an internal web server i created by using curl on a different internal server and try to connect to to the web server i created IP address
0
reply
manifesting
Badges: 9
Rep:
?
#12
Report Thread starter 2 weeks ago
#12
..
Last edited by manifesting; 2 weeks ago
0
reply
username5383500
Badges: 18
Rep:
?
#13
Report 2 weeks ago
#13
(Original post by manifesting)
been asked to test an internal web server i created by using curl on a different internal server and try to connect to to the web server i created IP address
When you say server, are these running actual server software? Or are they just a server by name (e.g. Ubuntu Server)? Do you have multiple servers running? If so, what are each of their IP addresses and can you clarify which server you are connecting to/from. So for example:

Server A: 10.0.2.15
Server B: 10.0.2.16
Running the command curl 10.0.2.15 on server B.


What do you actually have running on this server? You're trying to connect to 10.0.2.15 using curl, what are you expecting to see? The connection being refused basically means the port isn't open, which is why I assumed you haven't actually got a webserver running in the first place to connect to.
0
reply
manifesting
Badges: 9
Rep:
?
#14
Report Thread starter 2 weeks ago
#14
(Original post by AcseI)
When you say server, are these running actual server software? Or are they just a server by name (e.g. Ubuntu Server)? Do you have multiple servers running? If so, what are each of their IP addresses and can you clarify which server you are connecting to/from. So for example:

Server A: 10.0.2.15
Server B: 10.0.2.16
Running the command curl 10.0.2.15 on server B.


What do you actually have running on this server? You're trying to connect to 10.0.2.15 using curl, what are you expecting to see? The connection being refused basically means the port isn't open, which is why I assumed you haven't actually got a webserver running in the first place to connect to.
supposed to see the <html> code

its alpine linux server

does that make sense?
0
reply
username5383500
Badges: 18
Rep:
?
#15
Report 2 weeks ago
#15
(Original post by manifesting)
supposed to see the <html> code

its alpine linux server

does that make sense?
But what HTML code? Have you actually put some code on the machine? Is there a web server running to serve the code when you request it? That's probably what you are missing.

Just having an Alpine Linux Server distro doesn't mean you have a server, you also need to be running some server software to perform the tasks you want (in this case serving HTML pages). If you're following instructions, you were probably asked to start a web server (maybe Apache, or a Python SimpleHTTPServer for example) and that's what you're most likely missing.
0
reply
manifesting
Badges: 9
Rep:
?
#16
Report Thread starter 2 weeks ago
#16
(Original post by AcseI)
But what HTML code? Have you actually put some code on the machine? Is there a web server running to serve the code when you request it? That's probably what you are missing.

Just having an Alpine Linux Server distro doesn't mean you have a server, you also need to be running some server software to perform the tasks you want (in this case serving HTML pages). If you're following instructions, you were probably asked to start a web server (maybe Apache, or a Python SimpleHTTPServer for example) and that's what you're most likely missing.
i have put code in a nano file called /data/www/index.html - this code is on the web server
0
reply
username5383500
Badges: 18
Rep:
?
#17
Report 2 weeks ago
#17
(Original post by manifesting)
i have put code in a nano file called /data/www/index.html - this code is on the web server
Have you started a web server though? Just putting a HTML file in /data/www doesn't mean it'll automatically get served, you'd need to manually start (or restart) whichever web server software you're using (e.g. Apache).
0
reply
manifesting
Badges: 9
Rep:
?
#18
Report Thread starter 2 weeks ago
#18
(Original post by AcseI)
Have you started a web server though? Just putting a HTML file in /data/www doesn't mean it'll automatically get served, you'd need to manually start (or restart) whichever web server software you're using (e.g. Apache).
theres no menton of web server software?

steps i had to do:
1. create intenral server (alpine)
2. create internal web server (linked clone of above)
all remaining steps done on internal web server:
3. install the web/proxy server nginx
4. create directories to store web page of internal server (mkdir /www and mkdir /www/data
5. use nano to create/edit webpage - index.html
6. on the internal server from step 1, use curl to try to connect to the web server ip address, when the address is curled the content of the web page stored in the intenral web server should be displayed

is this any use?
0
reply
username5383500
Badges: 18
Rep:
?
#19
Report 2 weeks ago
#19
(Original post by manifesting)
theres no menton of web server software?

steps i had to do:
1. create intenral server (alpine)
2. create internal web server (linked clone of above)
all remaining steps done on internal web server:
3. install the web/proxy server nginx
4. create directories to store web page of internal server (mkdir /www and mkdir /www/data
5. use nano to create/edit webpage - index.html
6. on the internal server from step 1, use curl to try to connect to the web server ip address, when the address is curled the content of the web page stored in the intenral web server should be displayed

is this any use?
Ah okay, so in this context nginx is your web server software. Another slightly odd choice, but it is what it is. So just to confirm everything, you've got two servers (both Alpine). I'll refer to them as internal and web to make them easier to differentiate.

Internal server is where you are running the curl command
Web server is where you installed nginx, and it has an IP address of 10.0.2.15

The main things to check:
  • What is the IP address of the internal server (the one you are running curl on). You can check that using ifconfig like you did before, but it should be different from your web server. So if both servers have an IP address of 10.0.2.15, that'd be a problem.
  • In virtualbox, what type of network are you using? Right click each of the two servers, click settings, click network and check the "attached to" field. If the adapters are different, that'd probably be a problem.
  • Is nginx actually running? I'm not familiar with Alpine, so IDK for sure how you'd check it. I'd assume either "service nginx status" or "systemctl status nginx". If it's not running, that'd be a problem.

Those are the main things to check for first. Although you need to do this on Alpine, I'm wondering if it'd be easier to do it on something like Ubuntu first to get you more familiar with things like IP addressing, starting the web server, etc. Then you'd find it easier to troubleshoot Alpine. NGL, Alpine doesn't seem all that user friendly if you don't have the experience to troubleshoot.
0
reply
manifesting
Badges: 9
Rep:
?
#20
Report Thread starter 2 weeks ago
#20
(Original post by AcseI)
Ah okay, so in this context nginx is your web server software. Another slightly odd choice, but it is what it is. So just to confirm everything, you've got two servers (both Alpine). I'll refer to them as internal and web to make them easier to differentiate.

Internal server is where you are running the curl command
Web server is where you installed nginx, and it has an IP address of 10.0.2.15

The main things to check:
  • What is the IP address of the internal server (the one you are running curl on). You can check that using ifconfig like you did before, but it should be different from your web server. So if both servers have an IP address of 10.0.2.15, that'd be a problem.
  • In virtualbox, what type of network are you using? Right click each of the two servers, click settings, click network and check the "attached to" field. If the adapters are different, that'd probably be a problem.
  • Is nginx actually running? I'm not familiar with Alpine, so IDK for sure how you'd check it. I'd assume either "service nginx status" or "systemctl status nginx". If it's not running, that'd be a problem.

Those are the main things to check for first. Although you need to do this on Alpine, I'm wondering if it'd be easier to do it on something like Ubuntu first to get you more familiar with things like IP addressing, starting the web server, etc. Then you'd find it easier to troubleshoot Alpine. NGL, Alpine doesn't seem all that user friendly if you don't have the experience to troubleshoot.
1. inet 6 addr of both are similar (its a load of jumbled up letters/numbers fe80::a00:27ff and so on...
i net addr of both are the same- 127.0.0.1

(im v confused about what happened to the 10.0.2.15- this number no longer seems to be part of it?

2. both network types are 'internal' and both have enable network adapter ticked

3. sorry didnt mention there is a line of text i have to type to start nginx (which i have)
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Are you travelling in the Uni student travel window (3-9 Dec) to go home for Christmas?

Yes (113)
28.18%
No - I have already returned home (52)
12.97%
No - I plan on travelling outside these dates (80)
19.95%
No - I'm staying at my term time address over Christmas (39)
9.73%
No - I live at home during term anyway (117)
29.18%

Watched Threads

View All
Latest
My Feed