
|
View Full Version : My own server in LAN (help!)
somegrunger 10-31-2003, 01:58 AM Hello there
I am new to LANs. Networking and Linux so I would like to ask for some help on what I want to do. I'll try to describe that below.
I currently have a Home LAN consisting of 4 computers of which mine also runs SuSe Linux 8.1 (apart from Windows). The aim of my "project' is to create a Server (my PC) serving data in the other computers in the LAN.
In my PC I have installed:
1/ Apache 2
2/ MySQL
3/ PHP
4/ an FTP server
When I run my server (meaning all the above appliances are running) I can connect to it with another PC on the network by using my PC's IP.
e.g. http/://this.is.my.IP in the LAN - will display the contents of the:
/usr/local/apache2/htdocs Directory of my PC to any client in the LAN that requests that page.
BUT: when I ftp to the same location ftp/://this.is.my.IP - loged on as root it will display the contents of the root directory.
My questions are:
1/ How can I get to display the htdocs contents (of Apache directory) when i ftp to my server (as it happens when you ftp to your free website provided by yahoo, tripod etc... - whatever you ftp to you can http also and it's the SAME!)
2/ Let's say that I want to create a small hosting company in my house where my PC is the server and the other PCs are the Clients. How can I give certain locations in my PC (server) a dedicated IP that will be the address that the client PCs will connect to (FTP or HTTP) so they can upload/see their sites? Do I need some kind of IP Assigner if that exists??? lol (Sorry if that's too complicated, just consider a small hosting company in your LAN - doing this to understand how things work)
The ideal solution would be to have a client connecting to an IP (within the LAN - not external on the internet) and being able to upload a website and then when http to it will be able to see the site applying. Imagine that I give my clietns an IP.
e.g. User "Andrew" will have his own site which will represent the home/andrew directory in the server and he will be able to ftp/http to an IP assigned to that location (of the server).
3/ Finally how can I connect my LAN to the Internet so I can get other clients from outside my LAN.
Please let me know if I need additional software that I have not listed above. :) :) :)
A BIG SUPER THANK YOU TO THOSE WHO ARE GOING TO SPEND THEIR TIME TO HELP ME OUT :) :) :)
ANDREW
a rising server admin :)
John[H4Y] 10-31-2003, 06:04 AM Originally posted by somegrunger
When I run my server (meaning all the above appliances are running) I can connect to it with another PC on the network by using my PC's IP.
e.g. http/://this.is.my.IP in the LAN - will display the contents of the:
/usr/local/apache2/htdocs Directory of my PC to any client in the LAN that requests that page.
BUT: when I ftp to the same location ftp/://this.is.my.IP - loged on as root it will display the contents of the root directory.
My questions are:
1/ How can I get to display the htdocs contents (of Apache directory) when i ftp to my server (as it happens when you ftp to your free website provided by yahoo, tripod etc... - whatever you ftp to you can http also and it's the SAME!)
FTPing as root is dangerous. Depending on the FTP server, you either need to create new linux user accounts or new virtual user accounts. Generally, you would just put a symbolic link in the home directory of the FTP user that points to the htdocs directory or the directory you setup for their Apache virtual host.
2/ Let's say that I want to create a small hosting company in my house where my PC is the server and the other PCs are the Clients. How can I give certain locations in my PC (server) a dedicated IP that will be the address that the client PCs will connect to (FTP or HTTP) so they can upload/see their sites? Do I need some kind of IP Assigner if that exists??? lol (Sorry if that's too complicated, just consider a small hosting company in your LAN - doing this to understand how things work)
The ideal solution would be to have a client connecting to an IP (within the LAN - not external on the internet) and being able to upload a website and then when http to it will be able to see the site applying. Imagine that I give my clietns an IP.
e.g. User "Andrew" will have his own site which will represent the home/andrew directory in the server and he will be able to ftp/http to an IP assigned to that location (of the server).
Again to have seperate sites, you want to use Apache's virtual host features. See apache.org for more info. To assign IPs for each computer, you merely specify a static IP for the NIC cards. In Linux, you can use ifconfig to specify the IP or the network config tool in your XFree86. All you do is pick an internal (private) IP instead of using DHCP. At home, most people use 192.168.0.xxx.
3/ Finally how can I connect my LAN to the Internet so I can get other clients from outside my LAN.
Please let me know if I need additional software that I have not listed above. :) :) :)
[/B]
You don't need any additional software. A computer can have an internal (private) IP and a public (internet) IP. The computer that will be serving the websites should have a direct connection to the internet so it can be accessed easily by the outside world. You can use IP forwarding to share net access with it. However, for security it is good to put a firewall in front of the server and open only the necessary ports for inbound connections.
Hope this helps a little. I'm sure you will have questions. Feel free to shoot away.
somegrunger 11-01-2003, 04:46 AM Again to have seperate sites, you want to use Apache's virtual host features. See apache.org for more info. To assign IPs for each computer, you merely specify a static IP for the NIC cards. In Linux, you can use ifconfig to specify the IP or the network config tool in your XFree86. All you do is pick an internal (private) IP instead of using DHCP. At home, most people use 192.168.0.xxx.
First of all thanks for replying. Ok, what is "ifconfig" and how can I use it ? Where can I find documentation for it? What is the network config tool and where can I access it? and what is XFree86? LOL Sorry but I am new... Would appreciate your help.
Thanks very much for your time :)
servers_tuww 11-01-2003, 05:49 AM Yea, they are a good help!:)
John[H4Y] 11-01-2003, 07:23 AM Originally posted by somegrunger
[B]
First of all thanks for replying. Ok, what is "ifconfig" and how can I use it ? Where can I find documentation for it? What is the network config tool and where can I access it? and what is XFree86? LOL Sorry but I am new... Would appreciate your help.
Thanks very much for your time :)
ifconfig is a command line tool used for managing network connections including in most distros of Linux. Run "man ifconfig" at the shell to find out more.
XFree86 is Linux's version of Windows. There are some graphical tools that use ifconfig but make it easier to use. If you are running "Gnome" or "KDE", you are running XFree86 (Gnome and KDE are Window Managers for Xfree86, basically "skins"). The easiest way to install XFree86 (aka X-Windows) is to opt for it to be installed during the OS installation. I am not too familiar with SuSe, but I would bet it includes the option to install XFree86. For a more beginning user like you, maybe it would be better to install an easier to use OS such as Redhat or Mandrake. http://linuxiso.org
Winkie 11-01-2003, 10:13 AM I would recommend you download a LiveCD of Gentoo (http://www.gentoo.org)
read through the documentation and take things SLOWLY. Gentoo (or Debian) will give you a very good grounding in all things linux, Gentoo's USE flags can be confusing at times but easily managable.
somegrunger 11-01-2003, 11:05 AM Originally posted by John[H4Y]
ifconfig is a command line tool used for managing network connections including in most distros of Linux. Run "man ifconfig" at the shell to find out more.
XFree86 is Linux's version of Windows. There are some graphical tools that use ifconfig but make it easier to use. If you are running "Gnome" or "KDE", you are running XFree86 (Gnome and KDE are Window Managers for Xfree86, basically "skins"). The easiest way to install XFree86 (aka X-Windows) is to opt for it to be installed during the OS installation. I am not too familiar with SuSe, but I would bet it includes the option to install XFree86. For a more beginning user like you, maybe it would be better to install an easier to use OS such as Redhat or Mandrake.
Ok thanks alot for your help. So let's say that I want to create my own hosting company in the LAN like i mentioned above and want to assign an IP to /home/user where user = a user that I will create in my system. This way the user will connect to this IP to manage/edit his/her site. Do you happen to know how I can do that? If yes please help me out.
Thanks Very Much
Andrew :)
Winkie 11-01-2003, 11:08 AM Andrew, please, for the sake of us all, stop jumping ahead of yourself, you likely don't even know how apache works, Please calm down until you have a good linux grounding.
John[H4Y] 11-01-2003, 11:50 AM Yeah, it's beginning to sound like we would have to type out a 500 page manual to get you to where you need to be in order to get a full understanding of how to do what you want to do. I think you mostly need to read up on Apache, specifically virtual hosts, and you should throw in a good Linux book while you're at it. Then come back to this thread and hopefully what I have said will make a little more sense to you.
somegrunger 11-01-2003, 02:25 PM OK I read some of the virtual hosts and tried to do what I want to do but as obvious didn't work. I am going to tell you what I did so you can tell me what I did wrong.
1. I created an entry in the "hosts" file.
e.g 127.0.0.3 andrew.local andrew
2. Then I added to httpd.conf file the following:
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *
<VirtualHost *>
DocumentRoot /usr/local/andrew
ServerName andrew
</VirtualHost>
I did this hoping that when i type a "andrew" on the browser (as localhost) it will display the /home/andrew contents. When I tried it it gave me "you don't have permission to access andrew on this server and I checked the permissions (of home/andrew) and that was not the reason.
Can you help??
Thanks
Andrew
John[H4Y] 11-01-2003, 08:08 PM A few problems, you would want "andrew" to point to 127.0.0.1, not 127.0.0.3. Then, if you want all your other computers to know where "andrew" is, add andrew to their respective host files as well, but use the server machine's private LAN or public internet IP on the other computer's hosts files. (in windows, it is located at windows\system32\drivers\etc\hosts). If you want each user to be able to just FTP to hostnames such as "andrew" or "bob" or whatever (which is not even necessary.. they can all just FTP to a single IP), you just want all the host entries to go to the same IP address.
I don't have time to go through the exact way to configure httpd.conf right now, but you need to setup a name-based virtual host for andrew. Looks like you almost have the right idea. You can then setup an FTP user "andrew" and place his FTP root in the same folder as the web root.
You really don't need seperate IPs for this. You can use one IP address and just have you LAN users login with their own usernames through FTP or SSH such as "andrew" or "bob". Each user does not need their own IP. You are over-complicating a few things, but it seems like you might eventually find the right path. Good luck.
somegrunger 11-02-2003, 07:51 AM OK well thanks, your help is very much appreciated, but that's not what I want to do in the first place (although I 'll do it to practice thank you)
I will try to explain one more time what I really want you (if you want too) to guide me through sir.
I am aiming into creating a "small hosting company" and want to assing IP addresses to several locations of my drive just like it would happen when you rent hosting from some company plus I wanna give my clients IPs for their sites.
I already know how to setup a yahoo or angelfire or tripod members/users/andrew type of site since you told me that I simply place a virtual link pointing to the general apache2/htdocs directory. But what about cgi-bin? How do I create independent cgi-bins?? Anyway... below is what I really want to do.
e.g. 111.222.333.444 (an IP) will point to /home/andrew or any other location that I will define. I picked /home/andrew since "andrew" will be just a "client" as of a user that I will add, remove to my system. The only difference with reality will be that Internet is my LAN. In other words I am trying to create a small internet world within my LAN. Why am I doing this? Just to understand how hosting companies work + want to start my own soon and I WILL no matter what you keep bubling. :)
If you think you can help me sir with that then I' d be so much greatful to you. Please take into consideration that I am not jumping ahead of myself or anything. I keep spending hours on Linux and learning new stuff every day.
Thanks
Andrew :)
|