Jump to content

Raspberry Pi Server

I just finished setting up a wordpress website on my Raspberry Pi using this guide. 
https://circuitdigest.com/microcontroller-projects/how-to-setup-webserver-on-raspberry-pi-and-host-a-wordpress-website 
I set it up on the pi just fine, but when I go to another computer on the network and try to access it using localhost, it errors out saying 'localhost refused to connect' and 'error_connection_refused'. What can I do to fix it? I don't want it to be internet accessible, only in the local network, like the tutorial said.

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, elpiop said:

Use the internal ip of the pi on the network, not localhost

I tried that, but it opens the site with html only, all styling disappears. 

Fletchsite problempic.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

Check chrome dev tools Network tab to see where it is trying to load the css from. Might be some configuration issue that only loads it on the local host

Link to comment
Share on other sites

Link to post
Share on other sites

Localhost is just another name for the loopback address, 127.0.0.1, which every single computer uses to address itself. Using localhost on a second computer means that the second computer is trying to connect to itself.

[Out-of-date] Want to learn how to make your own custom Windows 10 image?

 

Desktop: AMD R9 3900X | ASUS ROG Strix X570-F | Radeon RX 5700 XT | EVGA GTX 1080 SC | 32GB Trident Z Neo 3600MHz | 1TB 970 EVO | 256GB 840 EVO | 960GB Corsair Force LE | EVGA G2 850W | Phanteks P400S

Laptop: Intel M-5Y10c | Intel HD Graphics | 8GB RAM | 250GB Micron SSD | Asus UX305FA

Server 01: Intel Xeon D 1541 | ASRock Rack D1541D4I-2L2T | 32GB Hynix ECC DDR4 | 4x8TB Western Digital HDDs | 32TB Raw 16TB Usable

Server 02: Intel i7 7700K | Gigabye Z170N Gaming5 | 16GB Trident Z 3200MHz

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, 2FA said:

Localhost is just another name for the loopback address, 127.0.0.1, which every single computer uses to address itself. Using localhost on a second computer means that the second computer is trying to connect to itself.

That explains why it tells me that it is denied. That makes sense.

Link to comment
Share on other sites

Link to post
Share on other sites

55 minutes ago, elpiop said:

Check chrome dev tools Network tab to see where it is trying to load the css from. Might be some configuration issue that only loads it on the local host

This is what it shows:

 

fletchsite problempic3.PNG

 

It just keeps saying "connection refused".

Link to comment
Share on other sites

Link to post
Share on other sites

The issue comes from your Wordpress installation. You told Wordpress that the domain your server is running on is "localhost". So every time it tries to link to something on your site(such as the stylesheet) it causes an error. You can't connect to your Pi with another machine using "localhost" because localhost means the computer you're currently using. So what you need to do is change the domain to the IP address of your Pi(preferably give the Pi a static address) and connect to it via that address.

Discord: Breadpudding#9078

GitHub: https://github.com/cbpudding

Programming Guild: https://discord.gg/7ZVbxXT

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×