We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Virtual Hosting

Medium Priority
Last Modified: 2013-11-15
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?
Watch Question

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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Horalia RodriguezIT Developer


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.
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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.