Yes, I read through a lot of the related questions, but I can't seem to make sense of my problem. So, I successfully installed the latest Apache server along with PHP5 on a Pi. It works as it should, including PHP. I was able to view the default index.html page and also my test.php file from another Raspberry Pi and a Linux PC. Then, I took the MicroSD card from the Pi and inserted it on another Raspberry Pi. Now, I can't seem to access the default index.html or my test.php from any machine or Pi and it always says 403 error. I don't understand it. I thought anything and everything that you install on Pi is contained within the MicroSD card. So, switching from one Pi to another Pi shouldn't make any changes as far as any system settings go. Even the user on both RPi is "pi." So, why am I seeing this 403 Error?
closed as off-topic by Milliways, techraf, joan, Gene Dela Rosa, goldilocks♦ Dec 11 '17 at 20:30
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Gene Dela Rosa, goldilocks
I suspect you may have an IP address issue. The default configuration for Raspberry Pis (and most computers and laptops as well) is to have a dynamic IP, meaning the device will get assigned an IP by the DHCP server (likely your home router). In order to avoid devices jumping form IP to IP every time they reboot, routers tend to "lease" an IP for a specific MAC address for 24 hours at a time.
Although both Pis are using the exact same SD card, they will have different MAC addresses, therefore, they will be assigned different IP addresses by the DHCP server. A simple and quick fix is to change your IP configuration from "dynamic" to "static" and manually assign an IP address to your Pi. This is done on the SD card directly, just pick an IP address that is in the same subnet as the rest of your network, but outside your DHCP range.
Instructions on how to do this will vary depending on which specific version of Raspbian you are using.