learning some lamp server setup

f1sh3r

Senior member
Oct 9, 2004
636
0
0
ok, i just installed ubuntu 7.10 on my laptop, and i plan on using it for some web dev stuff. I used synaptic package manager tasksel method to install LAMP server.

do i have to edit my hosts.* files, iptables, and the like to keep jerks out? if so, how?

i cant create files directly in /var/www without root access. where do i put my website folders so i can freely access the files?

 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: f1sh3r
ok, i just installed ubuntu 7.10 on my laptop, and i plan on using it for some web dev stuff. I used synaptic package manager https://help.ubuntu.com/community/Tasksel">tasksel</a> method to install LAMP server.

do i have to edit my hosts.* files, iptables, and the like to keep jerks out? if so, how?

Well.. no. You don't have to at all.

Iptables and netfilter is for building and configuring Linux firewalls and doing some routing.. Generally you wouldn't want to configure that manually on Linux since that stuff tends to be too complicated. There are lots of firewalls you can use that'll do that configuration stuff for you, but if you realy want to there are plenty of people that do configure that stuff for themselves.

Firewalls are generally not nessicary for a server. They are usefull for doing things like dealing with services that you can't configure correctly or you have services that you want to be avialable to certian people on a network (like using vpn stuff like ipsec or whatnot). It's much better to simply eliminate unneeded services or have them only listen to local loopback network interface.

If there are no services running on your machine, or at listenning to network interface, then it's 100% secure from remote attack. Attackers can't exploit what isn't there. So with that mentality then minimal is best.

No nfs, no routing, no samba, etc etc. A web server should only have httpd running, listenning, to a external network interface. Ideally. Weither or not that is good for you is up to you.

If your running this from a home network then generally it'll be behind a firewall anyways so all of this is not too important. Only port forward port '80' and port '443' or whatever and you'll be fine.


i cant create files directly in /var/www without root access. where do i put my website folders so i can freely access the files?

Well Apache is pretty much infinately configurable. You can tell Apache to stick the web files anywere you like with any sort of aliases for directories and all that fun stuff. Virtual webhosting and different websites depending on the hostname the other user is using and all that sort of stuff.

So you can look at the existing configuration file and pretty much mostly figure out what you want. Just make a backup of the original file and copy it back if you can't get the edited version working. (don't worry, apache configuration files are a common complaint. This is why hosting people use other programs to configure this sort of stuff nornally)

Or if you want to get started quickly and easily then change the permissions of the directory so you can edit files as your user. I don't know what the default permissions are for that directory in Ubuntu, but you can check it out and maybe add yourself to a http or www group and give group permissions to that directory and files (if it's not already setup for that sort of thing). This is probably the easiest and quickest.

If ubuntu doesn't already have a http or www group for that directory then it would be something like:

sudo addgroup webmaster
sudo addgroup f1sh3r webmaster
sudo chown -R root:webmaster /var/www

If Ubuntu already has group setup for this like http or whatever then use that. Remember that for group changes to go into effect for your user you have to log out and log back in.


personally I just like to setup a /home/drag/www folder for when I muck around with a hobby website. It's all up to you what you want.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
oh to quickly see what you have running on your system try one of these commands:

sudo netstat -aptu