View previous topic :: View next topic |
Author |
Message |
gentoobobby Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Cloud.gif)
Joined: 17 Jan 2006 Posts: 293
|
Posted: Tue May 30, 2006 11:54 am Post subject: Apache (confused) |
|
|
Hi ok i have got apache on my system now with sql , php mod_ftp and a few other things .
The problem im having is i dont no how to setup a website yet im all so confused .
i have webmin on the system which i thought would make things easier . But it hasent .
im not sure how i set up the ftp accounts or how to set bandwith limitations with on just one user.
Is there any easy guides which show u this ?
Or would some one be able to help me out so confused about this all . |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lxg Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19265729674c9fac4bb9adf.png)
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Tue May 30, 2006 1:12 pm Post subject: |
|
|
If you do virtual hosting, set up virtual hosts in /etc/apache2/vhosts.d and add a virtual host inside /var/www for each domain. (You might also want to set up virtual host logging in httpd.conf). Make sure to configure the vhosts properly, e.g. for .htaccess-based mod_rewrite you need things like AllowOverride All and FollowSymLinks
For the FTP part, I'd recommend to take a dedicated FTP server like vsftpd. Configure it properly for local users (and anonymous, if you need). Then add a system user for each account, while setting the login shell to /bin/false (so they can't login via shell, but only do FTP), and set the home directory to a virtual host, so they can FTP into their home dir. Just a suggestion:
Code: | useradd newuser -d /var/www/example.com/ -s /bin/false newuser
passwd newuser
mkdir -p /var/www/example.com/htdocs /var/www/example.com/cgi-bin
chown -R newuser:apache /var/www/example.com/ |
_________________ lxg.de – codebits and tech talk |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gentoobobby Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Cloud.gif)
Joined: 17 Jan 2006 Posts: 293
|
Posted: Tue May 30, 2006 1:37 pm Post subject: |
|
|
Hey man thats what im a bit confused on
I dont understand whata virtual host is
I have been playing in the webmin menu and add a new virtual host
I had to add the domain and directory where i wanted the files to be stored is that a virtual host ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lxg Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19265729674c9fac4bb9adf.png)
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Tue May 30, 2006 2:17 pm Post subject: |
|
|
First, in my opinion, using webmin is not a good idea. It's not secure and it's pretty confusing. Unless you have very (very, very) many users and/or vhosts, do it the Gentoo way and take the command line.
Now for the virtual hosts: your machine is a physical host. You can reach it under a domain (actually an IP). Now you can be able to route other domains to this server, too. Let's say example.com is your default domain, then example2.com can also go to the same physical server, but it can appear to visitors users as an entirely different host, e.g. by two different web sites.
In order to set up your server like this, you need virtual hosts on the server. While your server is only contacted by its IP (it doesn't get any information from the DNS server), many protocolls implement a possibility to tell the server which vhost is desired. For example, in HTTP, this is the Referer (sic!) header. It contains the domain the user wants to have. (There's also IP-based virtual hosting, where multiple IPs are assigned to your server, but this is quite rare; mostly interesting for SSL applications.)
Now your Apache gets the request for a certain domain. In order to process it, you need to define a virtual host for that domain (and the subdomain www ). Take a look into /etc/apache2/vhosts.d/00_default_vhost.conf, everything should be explained there. Create a directory for each vhost in /var/www, and that's it for starters.
However, once you're done with the basic setup, you'll need to do some fine tuning, and don't forget to think about security.
edit: It's the Host header of course; not the Referer! See http://www.cs.tut.fi/~jkorpela/http.html _________________ lxg.de – codebits and tech talk
Last edited by lxg on Tue May 30, 2006 5:48 pm; edited 3 times in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gentoobobby Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Cloud.gif)
Joined: 17 Jan 2006 Posts: 293
|
Posted: Tue May 30, 2006 2:28 pm Post subject: |
|
|
Hey man cheers il have a blast at that do u mind me getting back to u at all ? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lxg Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/19265729674c9fac4bb9adf.png)
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Tue May 30, 2006 3:40 pm Post subject: |
|
|
Of course, you're welcome. ![Smile :)](images/smiles/icon_smile.gif) _________________ lxg.de – codebits and tech talk |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|