Improve company productivity with a Business Account.Sign Up

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

Virtual Hosting

I just set up a LAMP web server with the following specifications:
1. FC5
2. Apache 2.2.0
3. MySQL Ver 14.12 Distrib 5.0.18, for redhat-linux-gnu (i386) using readline 5.0
4. PHP 5.1.2.
5. Static IP address
6. Two mirrored drives

I also have set up the main site from where users can access reports and update information to the MySQL server. So far, so good. My main problem is the way the users access the web site. They just type in the server's IP address and off they go. I would like for them to type in a name instead. I tried to do so by using the GUI provided by Fedora to change the HTTP settings, but I only ended up screwing httpd.conf. Luckily, I had a backup. How do I do this? I thought that by adding a hostname to the server under Network settings would be enough. I'm already reading http://httpd.apache.org/docs/1.3/vhosts/index.html to get a better understanding of all of this, I would just like for some Experts to give me some advice. One more thing, in order to make the web page accessible to others in the network, I had to flush the iptables. Is this good practice?
0
horalia
Asked:
horalia
  • 2
1 Solution
 
rivusglobalCommented:
Hi horalia,

    First off, if your services are accessable from the outside world ( not an intranet or local network ) you'd do best to register a domainname for easier access to your server ( for eg. www.yourdomain.com ).  Some registrars provide DNS services which will allow you to associate that name ( www.domain.com and domain.com ) to your webserver's IP address without you having to run, maintain, and learn how to setup your own DNS server.

    Second, virtual hosts is only required if you are going to host the websites for 2 or more of these registered domainnames.  So by the sounds of it, you won't need to embark on setting up Apache for virtual hosts. Although it's not too tough and can be explained simply enough.

    Thirdly, flushing your iptables is not a good practice as you appears to have an open by default firewall.  Obviously, if your firewall was closed by default, then nobody would have access to that server except directly via console/keyboard.  Website communication takes place on port 80 by default, so you will have to add an iptables rule that allows all communication to take place over port 80.  Likewise, open port 3306 for the mysql server, and you'll be able to leave your firewall up and running, blocking all the other unused ports on the box.
0
 
horaliaAuthor Commented:
Sorry for not mentioning this before, I wrote too much and excluded one very important fact! The services will be accesible only to company employees who have connection to the local network. I have coded everything in php and added a users table to mysql which authenticates whomever is signing in to the web site. As far as I know, we will not be allowing anyone direct access either to the server or db except using the web page. Does this change the recommendation for iptables? Most likely, I will be setting up another web page on the same server which will contain other type of content.
0
 
rivusglobalCommented:
Instead of using IP addresses you should assign a domainname using your company's DNS server if they have one.  If they don't and you don't want to create one that every PC will have to use, and you're dealing with a small number of employees, you could use the windows hosts file to point to a made up domain assigned to the webserver IP address.

The recommendation for iptables still stands, as anyone that needs access to a webserver (and thus a webpage on that server) will almost always require that port 80 on the webserver NOT be firewalled.  I say almost, only because you can run a webserver on a port other than port 80 but it doesn't change the fact you need to open whatever port it is on the firewall.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now