LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2018, 08:06 AM   #1
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD
Posts: 566

Rep: Reputation: 114Reputation: 114
Lightbulb Needing an easy method to access Apache other than hosts file ...


Hello everybody, we have been given an IP address by our IT department that we have assigned/given to an local Apache server which we will use to develop internal websites. The website are using the .local extension and the server is still currently in the testing phase and is not managed by the IT department.

I would like to know if there is an easier method for each computer to access the server other than modifying the hosts file on each machine.

Please bare in mind we do not have access to our main DNS server on the network which is why I have resorted to using the hosts file on our local machines in the meantime.

I though maybe we would need to request from our IT department to add the .local lookup zone for us on their DNS server. Is this correct.?

Perhaps someone from the community has other suggestions.?

If you require any further information let me know.

P.S) I was not sure how to word my Subject so please bare with me.

Thank you
 
Old 01-10-2018, 11:27 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,689

Rep: Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206
Just use the IP address. No /etc/hosts or DNS required.
 
Old 01-15-2018, 02:43 AM   #3
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD
Posts: 566

Original Poster
Rep: Reputation: 114Reputation: 114
Thanks Sean, please excuse my ignorance. If we are hosting 2 sites or more how will we navigate to the different site by using an IP address? As an example we have

http://business.local
http://education.local

IP address 192.168.245.176
 
Old 01-15-2018, 05:36 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,689

Rep: Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206
Presuming that you have control of the apache config (*.conf) files, one way would be the Alias directive:
Code:
Alias /business /path/to/business/content
Alias /education /path/to/education/content
then
Code:
 192.168.245.176/business 
or
 192.168.245.176/education
will display the requested site.

If you want to have "business.local" resolve, then you must either use DNS or the hosts file on each PC.
How many remote PCs are involved? What OS are they running?
Have you discussed the problem with your IT department?
 
Old 01-16-2018, 08:51 AM   #5
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD
Posts: 566

Original Poster
Rep: Reputation: 114Reputation: 114
Thanks Sean, I will look into this option. I suspected the Alias could be the answer as we do have access to the config files. I will play a little with it tonight. Thanks again
 
Old 01-17-2018, 08:41 AM   #6
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD
Posts: 566

Original Poster
Rep: Reputation: 114Reputation: 114
Hi Sean, I have tried many different configs to try and get it to work but to no avail.

# With commas
Code:
ServerAdmin admin@business.local
ServerName business.local
ServerAlias /business "/var/www/business.local/public_html"
DocumentRoot /var/www/business.local/public_html
# Without commas
Code:
ServerAdmin admin@business.local
ServerName business.local
ServerAlias /business /var/www/business.local/public_html
DocumentRoot /var/www/business.local/public_html
# Just the name
Code:
ServerAdmin admin@business.local
ServerName business.local
ServerAlias /business
DocumentRoot /var/www/business.local/public_html
# IP address
Code:
ServerAdmin admin@business.local
ServerName business.local
ServerAlias 192.168.245.176/business
DocumentRoot /var/www/business.local/public_html
# IP address (with and without commas
Code:
ServerAdmin admin@business.local
ServerName business.local
ServerAlias 192.168.245.176/business "/var/www/business.local/public_html"
DocumentRoot /var/www/business.local/public_html
Each time I made a change I ran

Code:
/etc/init.d/apache2 reload
or
Code:
service apache2 restart
I am certainly on the verge of giving up and just using the hosts file. I was hoping maybe if I sent the code perhaps you or someone else could have other suggestions.

Thanks again. I hope I am not being too much of a noob as I have really tried to sort this out on my own
 
Old 01-17-2018, 08:43 AM   #7
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD
Posts: 566

Original Poster
Rep: Reputation: 114Reputation: 114
Bare in mind the server does already work and I can access both websites but I would like to avoid modifying my computers hosts file or my colleagues
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't access Apache HTTP Server from VM while network setup method is NetworkManager service ComputerCritic Linux - Software 7 05-28-2017 07:50 PM
i need to access the /ec/hosts file tbrownarcher Debian 6 07-28-2012 10:06 PM
LXer: Apache virtual hosts quick and easy LXer Syndicated Linux News 0 10-04-2007 08:30 AM
encrypted filesystem with apache needing access stoffell Linux - Security 1 10-14-2003 11:21 AM
Access apache virtual hosts from lan te_conway Linux - Networking 2 07-16-2002 10:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration