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

    • PDF-XChange Editor 11.0.1.0 by Razvan Serea PDF-XChange Editor is a comprehensive PDF editor that allows you to create, view, edit, annotate, and digitally sign PDF documents with ease. With advanced features like OCR, document security, and PDF optimization, PDF-XChange Editor is a powerful tool for both personal and professional use. Whether you need to edit text, images, or links, or add comments, stamps, or watermarks, PDF-XChange Editor provides all the necessary tools to make your PDFs look perfect. Additionally, it supports a wide range of file formats, including PDF, XPS, and DOCX, making it easy to convert and share your documents. PDF-XChange Editor key features: Edit text and images in PDF documents Add and remove pages from PDF files Annotate and markup PDFs with comments, highlights, and stamps Use OCR to convert scanned documents into searchable text Create and fill out PDF forms Sign and certify PDF documents digitally Add and edit hyperlinks within PDFs Extract text and images from PDF files Batch process multiple PDF files at once Customize the interface to your preferences Work with multiple documents in tabs Convert PDFs to other formats such as Word, Excel, and HTML Use advanced redaction tools to permanently remove sensitive information Add customizable headers and footers to PDFs Merge multiple PDF documents into a single file Split PDF documents into multiple files Add watermarks to PDF documents Use the measurement tools to calculate distances and areas in PDFs ....and much more PDF-XChange Editor 11.0.1.0 changelog: Fixed a crash in the new Open/Save dialog box when creating a new folder in an unavailable network path. (49552) Fixed a rare/infrequent crash on some dynamic XFA forms after changing their field values. [installer] Fixed an issue where shortcuts were lost during an upgrade from the previous version. [installer] Fixed an issue preventing migration of serial keys during updates from version 10. Fixed the issues with the shell context menu after installation of version 11. Fixed the issue with filtering comments. (49478) Fixed the issue that caused "Error [IO subsystem]: Invalid access mode." when converting PDFs to MS Office formats. Fixed an issue with the context menu position on some multi-monitor systems. (48467) Fixed an issue with handling complex custom file filters, displayed by JS, in the new Open/Save Files dialog box. (49486) Fixed several issues with the new 'Select Folder' dialog box. (49505) Fixed an issue with the new custom 'Open File' dialog box when using double-click to open it. (49498) Fixed an 'infinite' loop/proliferation in the 'Open Files' and 'Manage Places' dialog boxes. (49526) Fixed an issue with handling the mouse wheel inside the document "Find" box. (49539) Fixed an incorrect behaviour in the 'Go back (Alt+Left)' button in the new Open/Save Files dialog box. (49510) Fixed an issue with the shortcut keys (Alt+Left/Right) after navigating via breadcrumb paths in the new Open/Save Files dialog box. (49554) [installer] Fixed an issue with redrawing the progress text in the EXE installers. Fixed the issue where a mouse click outside of the polyline/polygon context menu during annotation creation would cancel the annotation. (49475) We switched back to using the system Open/Save/SelectFolder dialog box by default, instead of using the new one, because some popular features such as the QuickAccess/Recent items are missing in the new version. These will be added in a future release. Replaced the 'Extension' column in the new Open/Save File dialog box with a more user-friendly 'Type' column. Also fixed some issues when handling the 'Show file extension' option. (49497) Added the ability to authenticate local network shares in the new Open/Save Files dialog box. (49557) Improved the handling of dates after 01.01.2030 in XFA files - now such dates are stored properly when set via the dropdown widget. Flags NoZoom and NoRotate are now respected for only a limited subset of annotations. Download: PDF-XChange Editor (64-bit) | Portable ~300.0 MB (Shareware) Download: PDF-XChange Editor (32-bit) | Portable ~200.0 MB Download: PDF-XChange ARM64 | 276.0 MB Download: PDF-XChange Portable @PortableApps.com | 97.0 MB View: PDF-XChange Editor Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Still 3x what it should cost. So, it seems the trick is to increase price by 6x so that a reduction in price back to 4x looks like a steal. "You savvy shoppers win again!" I'm glad I'm not in a desperate spot to actually even need this overpriced crap. Hopefully, it comes back down by the time for when (or if) I ever do.
    • Although AI is great and has it's use cases they likely have massively overhyped it and it has not delivered as per their expectations. I fully expect them to start saying the same things again when it does get to a certain level of intelligence!
    • Microsoft wants to end printer driver headaches with Windows Ready Print by Usama Jawad A few days ago, Microsoft released Windows 11 Experimental build 26300.8553, bringing a ton of enhancements such as Start menu customization, search improvements, Taskbar polish, and other minor UI tweaks. Another relatively major enhancement snuck deep within the change log was related to upgrades to the Windows printing experience. Now, Microsoft has shared more details about these benefits. For starters, Microsoft has renamed its Modern Print Platform to Windows Ready Print. The company believes that this name highlights its shift in strategy, which now focuses on modernizing, securing, and streamlining the printing experience for Windows devices. Some of the upgrades present in Windows Ready Print have already been seeded to customers and partners. This includes ending support for third-party printer drivers via Windows Update and transitioning towards the Internet Printing Protocol (IPP) and the native Windows IPP printer driver. In line with these changes, new printer installations will default to Windows Ready Print on eligible devices starting from July 2026. However, Microsoft recognizes that not all environments will be able to migrate to this platform immediately, so it will allow users to choose between installing the printer via Windows Ready Print or the traditional OEM process. Users will be able to toggle this configuration through Settings > Bluetooth & Devices > Printers & Scanners > Printer preferences. This control applies only to new printer installations, and its functionality can also be modified via Group Policy as follows: Launch Group Policy Editor Navigate to Local Computer Policy -> Administrative Templates -> Printers Find and select 'Configure Windows Ready Print driver ranking' -> double click to open it Select 'Enabled' (if you wish to enable Windows Ready Print driver selection) or 'Disabled' (if you wish to explicitly disable Windows Ready Print driver selection). Select Apply Select OK Similarly, if you set up Windows protected print mode through the same setting in Windows 11, it will also default to using Windows Ready Print exclusively. Microsoft hopes that these improvements will help eradicate dependency on OEM-specific driver installation processes and simplify printer installations. We'll likely find out more about other tangible benefits in the coming months.
  • Recent Achievements

    • One Month Later
      johnjacobb40 earned a badge
      One Month Later
    • 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
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      138
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!