Solved

Virtual Hosting

Posted on 2006-10-25
3
270 Views
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?
0
Comment
Question by:horalia
[X]
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
3 Comments
 
LVL 10

Accepted Solution

by:
rivusglobal earned 500 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. 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
 

Author Comment

by:horalia
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.
0
 
LVL 10

Expert Comment

by:rivusglobal
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.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

623 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