How to set up an internal website? - apache

How do I set up a website that's accessible within a small (office) network? I've only worked on localhost (using WAMP) so far and have no idea where to start. Also, is it possible to access that website through a pseudo domain name/alias instead of an IP?

This is of topic here - and wil be covered by lots of basic set up tutorials.
It's exactly the same process, except you need to ensure that clients on the lan can connect to the webserver runing on port 80 - i.e. make sure your firewall isn't blocking the access and that apache is listening on the LAN interface address (the default configs are usually to listen on all addresses).
is it possible to access that website...
Yes - just publish a DNS record for the webserver in your DNS server - or add it to the hosts files on all of the clients.

Related

Accessing localhost (xampp) from another computer

First, I already searched stack overflow and followed the suggestions in previous answers, such as How do I connect to this localhost from another computer on the same network?
I have created a PHP/MySQL application for a client. The want to host it locally on that server.
The machine in question is running an application written in another langauge (I'm not sure which one) and running Tomcat on port 8080.
They also do not have separate staging/production environments, so this is not ideal.
Their other web application needs to remain running while I also port over the new app. I installed XAAMP onto their system and got the app running locally using Apache HTTP. However, they want other computers both within and outside their networks to be able to connect to the Windows server as well. They are already doing this for the previously created app that is running on Tomcat.
Ports 80 and 8080 are already being used, so the firewall was updated to allow my application to run on port 8086.
I used ipconfig to the find the local IPv, and then tried updating the http.conf and vhost file and am listening to the IP on port 8086. However, going to the IP/foldername doesn't resolve on another computer in the network. As a test, I also just typed in the IP of the windows machine, and it never resolves.
I generally don't implement of windows; until now, all of my production applications have run on some flavor of unix. Their other application is live and I don't want to disturb it. They access it by going to {servername}:8080. I tried server:8086 to see if my app could be accessed that way, but it can't.
I confirmed that localhost/foldername resolves.
Here are the exact steps that I have taken. I tried two different solutions.
Solution 1, using How do I connect to this localhost from another computer on the same network? as a guide:
Make sure firewall allows port 8086 access
I modified the C:\xampp\apache\conf\extra\httpd-vhosts.conf file to include a virtual host for the application:
DocumentRoot "C:/xampp/htdocs/{foldername}"
ServerName dispatchserver
Went to the Windows host file located at \Windows\system32\drivers\etc\hosts and added the following:
192.xxx.x.xx dispatchserver
From a computer outside the network, tried to go to the following URLs (non resolved):
http://192.xxx.x.xx
http://192.xxx.x.xx:8086/
http://192.xxx.x.xx/foldername
http://dispatchserver
http://dispatchserver/foldername
Since they didn't work, I tried a solution using this older stack overflow answer: Accessing localhost (xampp) from another computer over LAN network - how to?
Made sure firewall allows port 8086 access
XAMPP control panel > Config > Service and Port Settings > Apache > Changed main port to 8086.
XAMPP control panel > Apache > Config > http.conf
Searched for "Listen 80" and replaced with Listen 8086
Right above that, added Listen 192.xxx.x.xx:8086 (I used the IPv4, but don't want to include full address for security reasons). I added this line with hashtag at first (#192.xxx.x.xx:8086) and then without hastag after that didn't work (192.xxx.x.xx:8086).
Searched for and set this up as the directory statement:
AllowOverride All
Require all granted
Restart Apache
What steps can I take to allow the new webapplication I installed via XAMPP to be accessible to other computers?
In that case it's a little different if you want to web enable this. You need to set up your router to port forward to your server (app)so that the other network can reach it from the internet. Your router blocks incoming requests by default so a port forwarding rule using the port you mentioned will work. You should also put your server computer (the one with the app) on a static ip address to make things easier. Then for the user to see your app you need to give them the ip address of your internet connection (seen via sites like ipchicken.com) and the port number in the url.
Normally you just need to open the ports in the windows firewall on both computers (inbound and outbound) for the ports your application is using and then connect to the other machine via ip address and port number if they are on the same network.

IIS sites can be viewed with http://localhost:port but not with local machine IP or loopback

I have googled this and found a lot of posts, but no definitive answer.
Basically, I want to play with making websites and set up a local virtual server with only IIS (v8.5) installed. It's not connected to the internet and it's purely for self education.
The problem is that I have sites working, different sites on different ports. All of these are viewable in a browser on the server if I use http://localhost:port-number as per the site's binding.
I can live with this - but I'm curious as to why, if I substitute the localhost with the server IP, or the loopback address the page can not be found. Clearly IIS is working as it serves pages with localhost.
I have added multiple bindings to a site so that 'all unassigned' the server ip and the loopback are bindings for the site on port 80.
As per some posts I've used CMD to add netsh add iplisten.
netstat - confirms the server ip is listening on all the ports of the websites created (3 sites, each with a different port number)
Firewall is disabled as it's only virtual server with no internet access.
I'm aware I can add a domain address and put this in the hosts file, but I'm really just curious as to why I can't browse the sites hosted in IIS locally by the server's IP or loopback.
Thanks in advance

Directing Domain Name to Tomcat

I am developing web pages and deployed it in Tomcat. I want it to share among my friends. I read about IIS and Apache.Please suggest me any way to direct domain name to tomcat installed in my computer.
Personally, I would stay away from IIS.
Deploy an instance of Apache/HTTPD in windows - and proxy/reverse-proxy the traffic on whatever port you want to your tomcat instance.
You can find some decent resources as for Windows deployables here:
https://httpd.apache.org/docs/current/platform/windows.html
Then when you have your server set up and functioning, look into the ProxyPass directive within Apache.
https://httpd.apache.org/docs/current/mod/mod_proxy.html
Don't forget to open a port forwarding on your router, if necessary.
As far as directing your domain name to your computer, look into getting an account at ZoneEdit to set up your DNS to point whatever domain name you want to your routers/cable modems IP address. Then you can set up your port forwarding.

ip addressed not responding : but 127.0.0.1 responding : Apache

I currently have Apache running as part of XAMPP and I am able to run the PHP scripts by accessing them at 127.0.0.1/<program_name>.php but when I try to access them as <my_ip>/<program_name>.php I get no response.
Am I doing something incorrectly or does my configuration need fixing?
assuming you are trying to access from an external ip address you need to setup your router (port forwarding) to send web traffic to the LAN ip of your machine.
you also may need to disable various firewalls at various points in your network.
In short there is not enough information given to provide you a definitive answer.

I want to host my own home web server. I installed Apache already but I can't log in other computers

I'm using Windows Vista, I have Apache installed already. Apache is working great, but I want to allow my website to be viewed publicly.
When I entered my ip address(the one hosting the website) on other computers, the page doesn't show up. It just loads but don't show up.
How can I edit my httpd to allow everyone to have access to my website?
Thanks
-- EDITED
Yes, I forwarded it already. Here's the screenie:
alt text http://www.picamatic.com/show/2009/02/26/09/29/2470958_522x128.jpg
Is it correct way? Or do i need to change the port?
You will need to configure the server's firewall to allow incoming connections, and your router to forward connections to the servers.
Also be aware that many ISPs block incoming port 80 connections to avoid having their customers host their own sites (Check your ISP's contract, you may be violating it by hosting a web server)
It's possible to set your router to use a different port and forward it as port 80 to your server if your ISP is blocking port 80. Check with your router's user's manual about forwarding ports. Some routers might not support changing the incoming port to a different one, in which case you would have to change the port Apache runs on as well.
From your screen shot set the public port to something other than 80 (by convention use a port between 1024–49151), and leave the private port to 80.
Also, make sure you're using your public IP on other clients. Do not use the 192.168.. addresses, they're meant only for private networks.
Outside users should then be able to use the link http://[your public router IP]:[new port] to connect.
Be sure if you are using any type of router that you enable "IP forwarding" otherwise your server remains hidden behind it.
This option can be changed on the configuration webpage for the router.
`bstpierre' is correct in that some ISP's block port 80. I use port 8080 myself. Good luck!