Recommended Posts

Hey

Im trying to get a web site hosted inside of my LAN so people can test it out. Its ran by Apache to be exact but I just cant seem to get it to work inside of my network. The only way I can get it to work is by editing the hosts file on each PC and pointing them at my IP resolving a FQDM (test.dev).

How can I do this? I have access to the router that forwards ports (although this may or may not have to do with anything)

Link to comment
https://www.neowin.net/forum/topic/1069600-interally-hosting-a-web-site/
Share on other sites

if you host a single site on that server by taping the ip (or name) they should open it. If not you need virtual hosts (define new site and enable it) and editing the host on each computer. Or you can setup apache to listen on another port for this site and do port forwading - like router ip:81 --> redirecting to server_ip:81 (or something)

you need virtual hosts (define new site and enable it) and editing the host on each computer

That is EXACTLY what I am currently doing and want to avoid it. I do not want to edit the host on each computer.

Going to the IP address of the site does not work, because it tries to go to "http://www.test.dev" which is not the site....

Well if you want the computers on your site to be able to resolve test.dev -- then setup local dns to do that! Editing the host file for every machine would not be the way to do it ;)

Going to www.test.dev when you go to http://ipaddress

Points to apache doing that on a redirect. You can clearly serve up a site off an IP quite easy with apache. When you say your going to the ipaddress of the site -- you do mean the private IP of the machine the apache is running on, and not your public IP correct?

Since its private, you could have apache listening on 100's of IPs to serve up 100's of different sites, etc. So you could get by without having to setup host headers/virtualhost/etc

Do you run Active Directory at this location? If so you already have DNS you could create a test.dev zone, etc.

Well if you want the computers on your site to be able to resolve test.dev -- then setup local dns to do that! Editing the host file for every machine would not be the way to do it ;)

Going to www.test.dev when you go to http://ipaddress

Points to apache doing that on a redirect. You can clearly serve up a site off an IP quite easy with apache. When you say your going to the ipaddress of the site -- you do mean the private IP of the machine the apache is running on, and not your public IP correct?

Yes. 192.168.100.73 which is my private IP of my PC on this LAN

Do you run Active Directory at this location? If so you already have DNS you could create a test.dev zone, etc.

No.

So your saying when you go to http://192.168.100.73 it redirects to http://www.test.dev

so what is in your host file on a machine that does this?

And what is your apache config look like? Do you have a .htaccess file with any sort of redirects in it?

so from a cmd prompt on a machine when you do

ping 192.168.100.73

What does the ping respond with, just the ip or does it return www.test.dev ?

If you want to setup DNS for your network - grab isc bind, runs on windows just fine. Or if you have a windows server OS, then you can install the dns role and create whatever zones and hosts you want. Or if you don't want to mess with full dns product like bind, you could grab tftpd32 which has a dns feature, that you could use to resolve test.dev, etc. etc.

http://tftpd32.jounin.net/

Tftpd32 is a free, opensource IPv6 ready application which includes DHCP, TFTP, DNS, SNTP and Syslog servers as well as a TFTP client.

So in your apache config, you sure you don't have something like this setup?

<VirtualHost *:80>

Redirect permanent / http://www.test.dev/

</VirtualHost>

So your saying when you go to http://192.168.100.73 it redirects to http://www.test.dev

so what is in your host file on a machine that does this?

Yes. If I put this in a hosts file on a machine

192.168.100.73 test.dev

It works. But I would have to go machine by machine...

so from a cmd prompt on a machine when you do

ping 192.168.100.73

What does the ping respond with, just the ip or does it return www.test.dev ?

If it is not in the hosts, it does not return test.dev

you could grab tftpd32 which has a dns feature, that you could use to resolve test.dev, etc. etc.

http://tftpd32.jounin.net/

Tftpd32 is a free, opensource IPv6 ready application which includes DHCP, TFTP, DNS, SNTP and Syslog servers as well as a TFTP client.

I thought about this as well but if I set this up wouldnt all other users on the network also have to point to me, a new DNS server? Kinda defeats the purpose....

So in your apache config, you sure you don't have something like this setup?

<VirtualHost *:80>

Redirect permanent / http://www.test.dev/

</VirtualHost>

I skipped over the first apache config question since you reasked it again in the same post. I have this setup in my httpd-vhosts.conf :

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot "C:/test"

ServerName test.dev

ServerAlias test.dev

<Directory "C:/test">

Options Indexes FollowSymLinks Includes execCGI

AllowOverride All

Order Allow,Deny

Allow From All

</Directory>

ErrorLog "logs/test.dev-error.log"

CustomLog "logs/test.dev-access.log" combined

</VirtualHost>

"a new DNS server? Kinda defeats the purpose...."

NO not really -- if you not going to run dns, how do you expect users to resolve test.dev to your IP without a host file? If you current dns does not allow you to create Records to resolve, then your going to have to fire up one that does and use it. Or you going to have to use host files on each machine, or you going to have to use IP address directly.. How else do you think you can resolve a fqdn??

DNS can be handed via dhcp, so you don't have to touch any box to get them to point to your dns.

You clearly have done something either with the site or apache itself to change the to www.test.dev when you access http://ipaddress

Here I just fired up apache on my test linux box. apt-get install apache2

And there you go access of site via IP with no redirects.. So either you messed with the config of apache, edited the .htaccess file or the page your loading from the site is doing the redirect.

What is the source of the site your serving up have in its headers? Are you doing something like

&lt;meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"&gt;

post-14624-0-58885600-1334160548.jpg

I even added your ServerName and ServerAlias tags -- those have nothing to do with redirection

<VirtualHost *:80>

ServerAdmin webmaster@localhost

DocumentRoot /var/www

ServerName test.dev

ServerAlias test.dev

"a new DNS server? Kinda defeats the purpose...."

NO not really -- if you not going to run dns, how do you expect users to resolve test.dev to your IP without a host file? If you current dns does not allow you to create Records to resolve, then your going to have to fire up one that does and use it. Or you going to have to use host files on each machine, or you going to have to use IP address directly.. How else do you think you can resolve a fqdn??

Internally, I dont care if they resolve test.dev or not. I want the internal site to work.

You may have not read correct but if they go to

http://192.168.100.73

they cannot see the site either. And yes, they can ping me.

The only way they can see my site is by editing their host file and putting

192.168.100.73 test.dev

then they can access http://192.168.100.73 AND http://test.dev

You clearly have done something either with the site or apache itself to change the to www.test.dev when you access http://ipaddress

Well, not sure what files to look at although Im almost certain Ive only touched that one. This is a Magento site if it makes any difference.

What is the source of the site your serving up have in its headers? Are you doing something like

&lt;meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"&gt;

Havent done this either.

So you setup this package http://www.magentocommerce.com/

Look at the index.html file or index.php file, etc. in you c:/test folder-- many of these canned sites have redirects built into them.. So yeah you hit http://ipaddress and right away your redirected to http://www.test.dev which no is not going to work, so nothing is going to be shown in the browser.

I have not used this application so would have to install it to see what it does out of the box.

edit: Ok just hit up a demo admin page, and yeah this could be an issue

post-14624-0-70314700-1334162753_thumb.j

It defaults to redirect vs no, and then there is also a setting in here that redirects to base url if cookies disabled, etc..

So your redirect is to www.test.dev that could be your problem right there, if the client can not resolve that.

So you need to either disable this redirection stuff, change it to IP address. Or use your host file, or setup dns.

Here is installation manual:

http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/magento_installation_guide

You could try to run it on wamp server for windows or you could configure some Linux to serve it (it is required, based on manual). It seems to me like normal installation, make database in phpmysql, unzip archive in web folder and go to http://192.168.100.73/folder_where_are_magento_files.

Also, pay attention to this:

During the installation process Magento will set cookies and most browsers will refuse to accept cookies for localhost. This can lead to several problems but no error messages. E.g. when trying to set the locale the page will just refresh and revert to the standard En-US locale..

To avoid this problem, you can set up Magento to use 127.0.0.1 as its domain name or create another entry for localhost in your computer?s /etc/hosts file and use that hostname to access the site, as shown below:

There was something in there that stated if cookies not working, redirect to base url. So yeah if trying to set cookie for localhost, which browser refuses -- if your base url is www.test.dev then sure would explain what is happening.

Per your other thread seems like this site will be hosted elsewhere, this seems like a good idea to me ;)

There was something in there that stated if cookies not working, redirect to base url. So yeah if trying to set cookie for localhost, which browser refuses -- if your base url is www.test.dev then sure would explain what is happening.

But technically since they are other IPs, they arent localhosts.......

Per your other thread seems like this site will be hosted elsewhere, this seems like a good idea to me ;)

It will :) This was just for some internal testing.

Hosting it somewhere else is another complete challenge which I have never in my life done...

"But technically since they are other IPs, they arent localhosts......."

Which has nothing to do with the name on the cookie that application might set.

Fix up your redirect stuff in the admin page of that web app and you should be able to use http://ipaddress vs host name, etc. Which should remove your need for host file entries or dns.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • You can disable the bloat on every browser. That's not the point. I will never use a browser of a shady company. I don't trust them at all. I can still find adblocking solutions than having to rely on a browser from a shady company. Every year they try something shady lol 2016: Brave Ad Replacement https://archive.is/W0k4j#selection-203.7-203.28 2016: pay-to-win Wikipedia clone into the default search engine list https://github.com/brave/browser-laptop/issues/5475 2018: Tom Scott and other creators noticed Brave was soliciting donations in their names without their knowledge or consent. https://www.reddit.com/r/brave...aims_that_brave_is_falsely/ 2020: Brave got caught injecting URLs with affiliate codes https://www.theverge.com/2020/...-crypto-privacy-ceo-apology 2021: Brave's TOR window was found leaking DNS queries https://www.zdnet.com/article/...n-addresses-in-dns-traffic/ 2022: Brave floated the idea of further discouraging users from disabling sponsored messages. https://github.com/brave/brave-browser/issues/22066 2023: Brave got caught installing a paid VPN service on users' computers without their consent. https://www.xda-developers.com...owser-installs-vpn-windows/ 2023: Brave got caught scraping and reselling people's data with their custom web crawler, which was designed specifically not to announce itself to website owners. https://stackdiary.com/brave-s...ghted-data-for-ai-training/ 2024: Brave gave up on providing advanced fingerprint protection, citing flawed statistics https://www.bleepingcomputer.c...tion-as-it-breaks-websites/ 2025: Brave staff publish an article endorsing PrivacyTests and say they "work with legitimate testing sites" like them. This article fails to disclose PrivacyTests is run by a Brave Senior Architect! https://brave.com/blog/adblock...esting-websites-harm-users/
    • Alpine Linux 3.24 released with support for COSMIC Desktop and other improvements by David Uzondu Alpine Linux 3.24 has been released with updated system packages, including Linux kernel 6.18 and Rust 1.96. The team also added IPv6 support to the system installer, and they introduced automatic serial console configuration for headless setups. System76's COSMIC desktop environment is now available in the community repo. System76 originally started building this DE because its developers found GNOME to be pretty limited. Plus, it did not help that with virtually every GNOME update, the changes broke System76's custom desktop extensions. As for system packages, the Alpine team moved GTK+ 3.0 from the main repository to the community repository due to its legacy status. py3-setuptools has been upgraded to version 82.0.0, while the old pkg_resources module has been completely dropped. The team also removed outdated packages that still relied on py3-six and GTK+ 2.0. In addition to that, libsoup 2 has been removed because the library was affected by multiple security vulnerabilities. If you're a GRUB user, the Alpine Team said that you must manually run the grub-install command with your specific device or EFI options right after upgrading your system, otherwise, your computer may fail to boot properly with the newly updated GRUB 2.14 bootloader. New installations of Alpine Linux now offer an optional path to a /usr-merged directory layout if you set the BOOTSTRAP_USR_MERGED environment variable to 1 before you execute the setup-disk command. If you already run an older installation, you can migrate manually by installing the merge-usr package and executing its binary as the root user. The team recommends this layout to align Alpine with modern Linux standards, though you should verify your custom scripts before making the switch. Alpine Linux is a pretty tiny (~5MB) Linux distro built around musl libc, BusyBox, and OpenRC. It's been around since 2005, comes with its own package manager called Alpine Package Keeper (APK), and is widely used in modern cloud computing and software deployment.
    • Instagram now lets you manually reorder posts on your profile grid by David Uzondu Instagram is finally rolling out the ability to customize your feed layout as you see fit by letting you reorder posts on your profile grid. This feature comes several months after the app introduced a tool that lets users rearrange photos and videos within a carousel post after it has already been published. To do that, people tap the three-dot menu in the top right corner of the post, select the edit option, and reorganize their slides. Now that Instagram has expanded the feature to your profile grid, you can organize your main page without deleting old uploads. To use the new system, you simply tap any picture on your grid and select the option to reorder. This action opens up a separate screen where you can freely drag your grid items around until you get your preferred aesthetic, and then you just hit the back button to save your changes. Instagram's Threads account posted that the system would reach accounts starting this week, so you might need to wait for the automatic update to hit your phone. https://www.threads.com/@instagram/post/DZVV_fyjjSW In other Instagram news, last week, people figured out that if you ask Meta's AI support assistant to hand over any Instagram account, the bot will actually hand it over (even if the victim's account had 2FA enabled). The security exploit involved the assistant accepting prompts from users and generating password reset links for unauthorized email addresses. Meta said that the issue has now been fixed, but this came after the issue affected several high-profile accounts, including @obamawhitehouse. Last month, the company finally rolled out paid subscription tiers for WhatsApp and other Meta social platforms after months of testing. WhatsApp Plus costs $2.99 a month and gives you custom themes, while Instagram Plus and Facebook Plus cost $3.99 a month for extra profile customization and story rewatch counters. Meta's also working on Meta One, a unified subscription service that contains options for heavy users of its servers who want more reach or advanced features. For instance, Meta One Essential ($14.99/mo) comes with a verified badge and impersonation protection. If you pay for Meta One Premium ($19.99/mo), you get deeper AI reasoning tools, whereas the Meta One Advanced ($49.99/mo) tier increases your search placement (on Facebook and Instagram) and visibility.
    • Hello mysterious lamborghiniv10, I was in Australia and... now I'm in the Netherlands. 
    • EU says Meta must restore rival chatbots' access to WhatsApp by Hamid Ganji The European Commission has ordered Meta to restore third-party AI chatbots’ access to WhatsApp after the tech giant decided to block them from operating on the popular messaging platform. After Meta banned rival AI chatbots from operating on WhatsApp, the European Commission launched an antitrust investigation to determine whether the company had abused its market dominance. As a result of Meta’s decision, third-party AI chatbots, including Microsoft’s Copilot and OpenAI’s ChatGPT, were prevented from operating on WhatsApp. At the time, Meta said it wanted to reserve the WhatsApp Business API for other types of businesses and did not allow rival chatbots to use it. This effectively prevented the WhatsApp ecosystem from being used to distribute rival chatbot services. However, the European Commission has now announced an interim measures decision requiring Meta to restore access to WhatsApp for rival general-purpose AI assistants on the same terms and conditions as before October 15, 2025. The Commission has also asked Meta to maintain that access until the antitrust investigation is concluded. The Commission argues that Meta has used its dominant market position to prevent rival AI chatbots from accessing the WhatsApp Business API. While Meta allowed rival services to return to WhatsApp by paying a fee, the European Commission still considers that arrangement to be a de facto access ban. According to EU antitrust chief Teresa Ribera, the fees introduced by Meta are so high that using WhatsApp is no longer economically sustainable for competitors. “It seems that Meta expects to leverage the vast reach and likely dominance of WhatsApp to benefit its own AI assistant and to foreclose rivals,” Ribera said. “We cannot let large digital incumbents leverage their dominance of the past to dictate who in Europe gets to compete and who gets to innovate in AI.”
  • Recent Achievements

    • One Year In
      Primer1st earned a badge
      One Year In
    • Experienced
      JayZJay went up a rank
      Experienced
    • Reacting Well
      Sir_Timbit earned a badge
      Reacting Well
    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      512
    2. 2
      PsYcHoKiLLa
      229
    3. 3
      Edouard
      134
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      80
  • Tell a friend

    Love Neowin? Tell a friend!