View website over the LAN - error 404

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

View website over the LAN - error 404

Postby mrapache » 15. July 2018 12:34

Hi.

Can you please help. Tried everything.
Am not port forwarding, although I did try port 80 as p.f.
Am running on a mac.

Need to view the website over lan. Am trying both server name/website name and ip of local server and am getting error 404. website works fine
on xampp local box with website name. Ex. xyz.com. but when I tried the ip of the local server even on the local server I get 404.

/etc/hosts config
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 xyz.com
or even with
10.0.1.14 xyz.com

hosts

<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/"
ServerName xyz.com
AllowOverride All
Options Indexes FollowSymLinks
Require all granted

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

ErrorDocument 404 /error-pages/404.html
ErrorDocument 500 /error-pages/500.html
ErrorDocument 503 /error-pages/503.html
ErrorDocument 504 /error-pages/504.html

</VirtualHost>

https.conf

<Directory "/Applications/XAMPP/xamppfiles/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>

Thanks!!
mrapache
 
Posts: 2
Joined: 01. June 2017 06:29
XAMPP version: 3.2.2
Operating System: win 10

Re: View website over the LAN - error 404

Postby Nobbie » 15. July 2018 17:30

mrapache wrote:/etc/hosts config


Thats quite useless on the Xampp server, of course you have to apply the hosts in the CLIENTS(!) host file. It depends on the clients OS, where to find the hosts file.

mrapache wrote:<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/"
ServerName xyz.com
AllowOverride All
Options Indexes FollowSymLinks
Require all granted

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

ErrorDocument 404 /error-pages/404.html
ErrorDocument 500 /error-pages/500.html
ErrorDocument 503 /error-pages/503.html
ErrorDocument 504 /error-pages/504.html

</VirtualHost>


And here is missing a virtualhost for LAN IP 10.0.1.14 if you want to assure a certain DocumentRoot.

Finally there *could* be a redirect in the (untold) software you installed which might redirect to the Servername which you used at installation time (for example "localhost"). Maybe this leads to a redirect to localhost.com/website (a totally different PC, not your Xampp PC) which then issues a 404 error. Just an idea. You also *should* see your AccessLog and ErrorLog for more information about the error.

Your description hides real names, therefore this my last advice, i can only give advice with real code and real names.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 22 guests