Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Virtual Hosting

Posted on 2006-10-25
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 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?
Question by:horalia
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 10

Accepted Solution

rivusglobal earned 2000 total points
ID: 17807925
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. ).  Some registrars provide DNS services which will allow you to associate that name ( and ) 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.

Author Comment

ID: 17807946
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.
LVL 10

Expert Comment

ID: 17808187
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.

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question