[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 600
  • Last Modified:

Setting up an intranet

I've only been working with this for a couple of days, so please bear with me.... I installed Fedora 5 along with Apache on a machine to be used as a web server. I have apache running successfully on this machine. My question is, how and where do I place the settings to allow other users in my network to view the web pages I have created? Since I will not be placing sensitive information, how can I open the site to everyone in the network? Thanks!
0
horalia
Asked:
horalia
  • 14
  • 8
  • 3
2 Solutions
 
ahoffmannCommented:
> how can I open the site to everyone in the network
that's the default with apache

> how and where do I place the settings to allow other users in my network to view the web pages I have created?
do you still need this, if everyone (see above) should access it?

Anyway, in apache it is done using .htaccess file in each directory you want to protect.
See http://httpd.apache.org/docs/1.3/howto/auth.html or http://httpd.apache.org/docs/2.0/howto/auth.html for details (realy too much to write here).
0
 
horaliaAuthor Commented:
OK, I'll read the first link, I already read the second one you suggested, but found it a little confusing. So I assume by what you're telling me that there is no one option I have to change in the httpd.config file?
0
 
ahoffmannCommented:
the links just differ in the version of apache, 1.3.x vs. 2.0.x
that's why I gave both 'cause you didn't mention your apache version.

> .. there is no one option I have to change in the httpd.config file
i.g there is only one (AllowOverride) to change, just if you feel bad with the default settings you have to change more.
See http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride also.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
horaliaAuthor Commented:
OK, I will read these articles after finding out the Apache version. Like I said with my first posting, all I want is for users in the network to have access to the web site. Hope I can get this working by today!
0
 
periwinkleCommented:
Just to make certain we're on the same page, you have:

(1) Installed the apache web server
(2) configured the apache httpd.conf file so that you know where files are going to be placed (restarting if changes are made)
(3) placed your files in the directory where the files exist

Do you have a domain pointing to your server so that it is named?  How do you refer to your server on your local network - i.e. do you have dns the resolves http://www.somename.com or http://somename to your server?
0
 
horaliaAuthor Commented:
(1)Yes, I have installed the apache server.
(2)Yes, I had the apache httpd.conf file configured, but while I was trying set up the access, I apparently made a change to it that now I can't start the service. To start the service, I do it from a Terminal window using the root login and password using the following statement: service httpd start.
I also made sure first that Apache was installed by typing the following command:
rpm - qa | grep httpd
(3)No, I haven't placed any files in the directory yet.

And no, I don't have a domain pointing to the server, at least I don't think I do. During the fedora installation, I asked the setup to obtain the IP address automatically. The reason I did this is that my work computer is set up this way as well. I did assign a name to the server in the httpd.conf file, I named it prod, just for grims. I also kept the original httpd.conf setting of:
Order allow, deny
Allow from all

I forgot to state this important piece of information in my question, this will be an intranet for a department in my company. The pages I have created were done in PHP, using MySQL and MSSQL as the database. They reside on my computer which, just for the sake of learning, runs XAMPP. Any help, ideas, comments to get this thing running will be greatly appreciated. I don't have any experience whatsoever setting up a web server, I was told it is quite easy, specially using a Linux box. Thanks!
0
 
periwinkleCommented:
What errors are in your error log after you have tried to start it?
0
 
horaliaAuthor Commented:
I only get the error FAILED when starting it. Is there another way to start the service where I could see the log?
0
 
periwinkleCommented:
try using the apacectl command:

apachectl configtest
(will test the configuration)

apachectl start
(will start the server)

apachectl startsll
(will start the server with ssl support, if you have it properly configured)
0
 
horaliaAuthor Commented:
OK, I will try your suggestion in a few more minutes and let you know. Thanks!
0
 
horaliaAuthor Commented:
OK, have typed in your instructions and this is the error that I get:

[root@localhost ~]# apachectl configtest
Syntax error on line 331 of /etc/httpd/conf/httpd.conf:
order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
[root@localhost ~]# apachectl start
[root@localhost ~]# apachectl startsll

I copied it exactly from the terminal window. I have already checked the httpd.config file, this is what I have in the section that controls who can get in the page:
#
# Controls who can get stuff from this server.
#
    Order allow, deny
    Allow all
</Directory>
0
 
periwinkleCommented:
Whoa... if there is an error with configtest, then it won't proceed properly.  Also, you don't do both start and startssl - only one or the other.

It looks like there here is a space between allow, and deny;  take out the space and run apachectl configtest to test it again.  

Then, if that succeeds, only do one or the other of:

apachectl start

or

apachectl startssl
0
 
horaliaAuthor Commented:
OK, Apache is now working appropriately, I also created a PHP page and it loaded it successfully. Now back to my main problem, how do I configure Apache to allow everyone else in the network to see this webpage?
0
 
periwinkleCommented:
Kudos on getting this far!

What URL did you use to load the page?  

Do you have a static IP address on your network for your computer?
0
 
horaliaAuthor Commented:
To load the page on the web server, I just used http://localhost. The page I created was just a simple phpinfo page and I named it index.php. When I loaded localhost, the phpinfo page was loaded.

I checked the network configuration on the web server and this is what I found:

Devices Tab
Nickname: eth0
Hostname(optional) prod
Automatically obtain DNS from provider (checked)

DNS Tab
HostName: localhost.localdomain
Primary DNS: 10.10.10.10
Secondary DNS: 10.10.10.11
(of course, IP's are bogus)

As you can see, I know very little, if anything, about networking. I just know that the machine is connected to the network, I can surf and see other computers in the domain. Thanks!
0
 
periwinkleCommented:
I'm a little foggy on this area, but I believe that you use the command

hostname

to give your system a hostname and also set the hostname in the configuration file /etc/sysconfig/network ... you may wish to put a pointer question in the Linux administration area for this.
0
 
horaliaAuthor Commented:
OK, so now my second problem is giving the box a hostname. Let me find out how to do this, I'm hoping on getting this server up and running to start placing the web files in place. Give me a few minutes, I'll go check out my Linux book and post again.
0
 
horaliaAuthor Commented:
Hmmm, I was under the impression that the box's hostname was defined in httpd.config under ServerName. Am I correct?
0
 
periwinkleCommented:
The httpd.conf file is only configuring Apache. The ServerName is used to specify WHICH domain/name is being discussed;  you can have many domains point to one box.

That doesn't help you in the way of giving the full box a name, which is done via networking, via hostname and the /etc/sysconfig/network file.  Of course, the rest of the world needs to know how to resolve that name... that's why I asked if you had assigned a static ip address for your server on your network.  It can be a local network static ip - i.e. a 192.168.x.x one - it doesn't have to be an outside IP address.

The default configuration is the first one defined;  that will catch any web server requests that come to your server even if the ServerName (or 'ServerAlias' which are 'alternative' names for that ServerName) isn't specified.  
0
 
horaliaAuthor Commented:
Thanks for the info. I already posted a question on the Linux forum, lets see what these guys say.... I'll let you know.
0
 
ahoffmannCommented:
> how do I configure Apache to allow everyone else in the network to see this webpage?
as I already said: you don't need to do anything, that's the default

> HostName: localhost.localdomain
it's a bad decision to name it "localhost", change the hostname to a real name
Then you either need to tell your DNS server to resolve that name to its IP, or you need to configure each client which want to access your linux box with a proper entry in its hosts file.

>  I was under the impression that the box's hostname was defined in httpd.config under ServerName. Am I correct?
no, you're wrong.
as already explained: httpd.conf is for apache only, it has nothing to do with the machines hostname
0
 
horaliaAuthor Commented:
OK, thanks. Lot's to read!
0
 
horaliaAuthor Commented:
After asking some more (reading the online manuals was getting me nowhere, I had already followed most of the instructions), I was suggested to flush the firewall rules using iptables -L, and it worked beautifully. I am able to view the initial web page from computers located on different domains. I still have a lot of reading to do, I don't deny it, but at least now I can see a dim light at the end of the tunnel!
0
 
horaliaAuthor Commented:
I will divide the points evenly between ahoffman and periwinkle unless either of you have any objections, since both of you gave me usefull suggestions.  
0
 
periwinkleCommented:
Congratulations on getting this far!  Happy to have helped, and by all means, divide the points however you see fit!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 14
  • 8
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now